From: Guoqing Jiang <guoqing.jiang@linux.dev>
To: bmt@zurich.ibm.com, jgg@ziepe.ca, leon@kernel.org
Cc: linux-rdma@vger.kernel.org
Subject: [PATCH 3/5] RDMA/siw: Initialize siw_link_ops.list
Date: Thu, 27 Jul 2023 22:03:47 +0800 [thread overview]
Message-ID: <20230727140349.25369-4-guoqing.jiang@linux.dev> (raw)
In-Reply-To: <20230727140349.25369-1-guoqing.jiang@linux.dev>
In case siw module can't be inserted successfully, then if remove
the module from kernel, then siw_cm_exit can trigger below trace
because siw_link_ops.list is still NULL since rdma_link_register
is not called. So we need to init the list earlier.
[ 45.306864] BUG: kernel NULL pointer dereference, address: 0000000000000008
[ 45.306869] #PF: supervisor write access in kernel mode
[ 45.306871] #PF: error_code(0x0002) - not-present page
[ 45.306872] PGD 0 P4D 0
[ 45.306874] Oops: 0002 [#1] PREEMPT SMP NOPTI
[ 45.306876] CPU: 1 PID: 1742 Comm: modprobe Tainted: G OE 6.5.0-rc3+ #16
[ 45.306879] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.0-0-gd239552c-rebuilt.opensuse.org 04/01/2014
[ 45.306880] RIP: 0010:rdma_link_unregister+0x27/0x60 [ib_core]
...
[ 45.306916] Call Trace:
[ 45.306917] <TASK>
[ 45.306918] ? show_regs+0x72/0x90
[ 45.306922] ? __die+0x25/0x80
[ 45.306924] ? page_fault_oops+0x154/0x4d0
[ 45.306927] ? __this_cpu_preempt_check+0x13/0x20
[ 45.306929] ? lockdep_unlock+0x63/0xe0
[ 45.306933] ? do_user_addr_fault+0x381/0x8d0
[ 45.306934] ? rcu_is_watching+0x13/0x70
[ 45.306937] ? exc_page_fault+0x87/0x240
[ 45.306940] ? asm_exc_page_fault+0x27/0x30
[ 45.306944] ? rdma_link_unregister+0x27/0x60 [ib_core]
[ 45.306956] ? rdma_link_unregister+0x19/0x60 [ib_core]
[ 45.306967] siw_exit_module+0x87/0x590 [siw]
[ 45.306973] __do_sys_delete_module.constprop.0+0x18f/0x300
[ 45.306975] ? syscall_enter_from_user_mode+0x21/0x70
[ 45.306977] ? __this_cpu_preempt_check+0x13/0x20
[ 45.306978] ? lockdep_hardirqs_on+0x86/0x120
[ 45.306980] __x64_sys_delete_module+0x12/0x20
[ 45.306982] do_syscall_64+0x5c/0x90
Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
---
drivers/infiniband/sw/siw/siw_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/sw/siw/siw_main.c b/drivers/infiniband/sw/siw/siw_main.c
index b3547253c099..6709ed0de3a4 100644
--- a/drivers/infiniband/sw/siw/siw_main.c
+++ b/drivers/infiniband/sw/siw/siw_main.c
@@ -526,6 +526,7 @@ static int siw_newlink(const char *basedev_name, struct net_device *netdev)
}
static struct rdma_link_ops siw_link_ops = {
+ .list = LIST_HEAD_INIT(siw_link_ops.list),
.type = "siw",
.newlink = siw_newlink,
};
--
2.34.1
next prev parent reply other threads:[~2023-07-27 14:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 14:03 [PATCH 0/5] Fix potential issues for siw Guoqing Jiang
2023-07-27 14:03 ` [PATCH 1/5] RDMA/siw: Set siw_cm_wq to NULL after it is destroyed Guoqing Jiang
2023-07-27 14:03 ` [PATCH 2/5] RDMA/siw: Ensure siw_destroy_cpulist can be called more than once Guoqing Jiang
2023-07-27 14:03 ` Guoqing Jiang [this message]
2023-07-27 14:03 ` [PATCH 4/5] RDMA/siw: Set siw_crypto_shash to NULL after it is freed Guoqing Jiang
2023-07-27 14:03 ` [PATCH 5/5] RDMA/siw: Don't call wake_up unconditionally in siw_stop_tx_thread Guoqing Jiang
2023-07-27 17:17 ` [PATCH 0/5] Fix potential issues for siw Bernard Metzler
2023-07-27 17:29 ` Jason Gunthorpe
2023-07-27 18:15 ` Bart Van Assche
2023-07-28 1:16 ` Guoqing Jiang
2023-07-28 2:29 ` Guoqing Jiang
2023-07-28 11:10 ` Bernard Metzler
2023-07-28 9:36 ` Bernard Metzler
2023-08-09 19:04 ` Jason Gunthorpe
2023-08-10 1:14 ` Guoqing Jiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230727140349.25369-4-guoqing.jiang@linux.dev \
--to=guoqing.jiang@linux.dev \
--cc=bmt@zurich.ibm.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.