Skip to content

Commit fdfa083

Browse files
bvanasscherleon
authored andcommitted
RDMA/srpt: Support specifying the srpt_service_guid parameter
Make loading ib_srpt with this parameter set work. The current behavior is that setting that parameter while loading the ib_srpt kernel module triggers the following kernel crash: BUG: kernel NULL pointer dereference, address: 0000000000000000 Call Trace: <TASK> parse_one+0x18c/0x1d0 parse_args+0xe1/0x230 load_module+0x8de/0xa60 init_module_from_file+0x8b/0xd0 idempotent_init_module+0x181/0x240 __x64_sys_finit_module+0x5a/0xb0 do_syscall_64+0x5f/0xe0 entry_SYSCALL_64_after_hwframe+0x6e/0x76 Cc: LiHonggang <[email protected]> Reported-by: LiHonggang <[email protected]> Fixes: a42d985 ("ib_srpt: Initial SRP Target merge for v3.3-rc1") Signed-off-by: Bart Van Assche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent e6f57c6 commit fdfa083

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/infiniband/ulp/srpt/ib_srpt.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,16 @@ module_param(srpt_srq_size, int, 0444);
7979
MODULE_PARM_DESC(srpt_srq_size,
8080
"Shared receive queue (SRQ) size.");
8181

82+
static int srpt_set_u64_x(const char *buffer, const struct kernel_param *kp)
83+
{
84+
return kstrtou64(buffer, 16, (u64 *)kp->arg);
85+
}
8286
static int srpt_get_u64_x(char *buffer, const struct kernel_param *kp)
8387
{
8488
return sprintf(buffer, "0x%016llx\n", *(u64 *)kp->arg);
8589
}
86-
module_param_call(srpt_service_guid, NULL, srpt_get_u64_x, &srpt_service_guid,
87-
0444);
90+
module_param_call(srpt_service_guid, srpt_set_u64_x, srpt_get_u64_x,
91+
&srpt_service_guid, 0444);
8892
MODULE_PARM_DESC(srpt_service_guid,
8993
"Using this value for ioc_guid, id_ext, and cm_listen_id instead of using the node_guid of the first HCA.");
9094

0 commit comments

Comments
 (0)