Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH] RDMA/srpt: Support specifying the srpt_service_guid parameter
@ 2024-02-05  0:42 Bart Van Assche
  2024-02-05  7:58 ` Leon Romanovsky
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2024-02-05  0:42 UTC (permalink / raw)
  To: Jason Gunthorpe, Leon Romanovsky; +Cc: linux-rdma, Bart Van Assche, LiHonggang

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 <honggangli@163.com>
Reported-by: LiHonggang <honggangli@163.com>
Fixes: a42d985bd5b2 ("ib_srpt: Initial SRP Target merge for v3.3-rc1")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/infiniband/ulp/srpt/ib_srpt.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 58f70cfec45a..d2dce6ce30a9 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -79,12 +79,16 @@ module_param(srpt_srq_size, int, 0444);
 MODULE_PARM_DESC(srpt_srq_size,
 		 "Shared receive queue (SRQ) size.");
 
+static int srpt_set_u64_x(const char *buffer, const struct kernel_param *kp)
+{
+	return kstrtou64(buffer, 16, (u64 *)kp->arg);
+}
 static int srpt_get_u64_x(char *buffer, const struct kernel_param *kp)
 {
 	return sprintf(buffer, "0x%016llx\n", *(u64 *)kp->arg);
 }
-module_param_call(srpt_service_guid, NULL, srpt_get_u64_x, &srpt_service_guid,
-		  0444);
+module_param_call(srpt_service_guid, srpt_set_u64_x, srpt_get_u64_x,
+		  &srpt_service_guid, 0444);
 MODULE_PARM_DESC(srpt_service_guid,
 		 "Using this value for ioc_guid, id_ext, and cm_listen_id instead of using the node_guid of the first HCA.");
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] RDMA/srpt: Support specifying the srpt_service_guid parameter
  2024-02-05  0:42 [PATCH] RDMA/srpt: Support specifying the srpt_service_guid parameter Bart Van Assche
@ 2024-02-05  7:58 ` Leon Romanovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2024-02-05  7:58 UTC (permalink / raw)
  To: Jason Gunthorpe, Leon Romanovsky, Bart Van Assche; +Cc: linux-rdma, LiHonggang


On Sun, 04 Feb 2024 16:42:07 -0800, Bart Van Assche wrote:
> 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
> 
> [...]

Applied, thanks!

[1/1] RDMA/srpt: Support specifying the srpt_service_guid parameter
      https://git.kernel.org/rdma/rdma/c/8658e2f26d8be1

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-05  7:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-05  0:42 [PATCH] RDMA/srpt: Support specifying the srpt_service_guid parameter Bart Van Assche
2024-02-05  7:58 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox