Alok Prasad
f024a12b92
RDMA/qedr: Fix NULL deref for query_qp on the GSI QP
commit 4f960393a0 upstream.
This patch fixes a crash caused by querying the QP via netlink, and
corrects the state of GSI qp. GSI qp's have a NULL qed_qp.
The call trace is generated by:
$ rdma res show
BUG: kernel NULL pointer dereference, address: 0000000000000034
Hardware name: Dell Inc. PowerEdge R720/0M1GCR, BIOS 1.2.6 05/10/2012
RIP: 0010:qed_rdma_query_qp+0x33/0x1a0 [qed]
RSP: 0018:ffffba560a08f580 EFLAGS: 00010206
RAX: 0000000200000000 RBX: ffffba560a08f5b8 RCX: 0000000000000000
RDX: ffffba560a08f5b8 RSI: 0000000000000000 RDI: ffff9807ee458090
RBP: ffffba560a08f5a0 R08: 0000000000000000 R09: ffff9807890e7048
R10: ffffba560a08f658 R11: 0000000000000000 R12: 0000000000000000
R13: ffff9807ee458090 R14: ffff9807f0afb000 R15: ffffba560a08f7ec
FS: 00007fbbf8bfe740(0000) GS:ffff980aafa00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000034 CR3: 00000001720ba001 CR4: 00000000000606f0
Call Trace:
qedr_query_qp+0x82/0x360 [qedr]
ib_query_qp+0x34/0x40 [ib_core]
? ib_query_qp+0x34/0x40 [ib_core]
fill_res_qp_entry_query.isra.26+0x47/0x1d0 [ib_core]
? __nla_put+0x20/0x30
? nla_put+0x33/0x40
fill_res_qp_entry+0xe3/0x120 [ib_core]
res_get_common_dumpit+0x3f8/0x5d0 [ib_core]
? fill_res_cm_id_entry+0x1f0/0x1f0 [ib_core]
nldev_res_get_qp_dumpit+0x1a/0x20 [ib_core]
netlink_dump+0x156/0x2f0
__netlink_dump_start+0x1ab/0x260
rdma_nl_rcv+0x1de/0x330 [ib_core]
? nldev_res_get_cm_id_dumpit+0x20/0x20 [ib_core]
netlink_unicast+0x1b8/0x270
netlink_sendmsg+0x33e/0x470
sock_sendmsg+0x63/0x70
__sys_sendto+0x13f/0x180
? setup_sgl.isra.12+0x70/0xc0
__x64_sys_sendto+0x28/0x30
do_syscall_64+0x3a/0xb0
entry_SYSCALL_64_after_hwframe+0x44/0xae
Cc: stable@vger.kernel.org
Fixes: cecbcddf64 ("qedr: Add support for QP verbs")
Link: https://lore.kernel.org/r/20211027184329.18454-1-palok@marvell.com
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: Shai Malin <smalin@marvell.com>
Signed-off-by: Prabhakar Kushwaha <pkushwaha@marvell.com>
Signed-off-by: Alok Prasad <palok@marvell.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-26 11:48:24 +01:00
..
2021-08-26 08:37:22 -04:00
2021-11-12 13:18:01 +01:00
2021-11-26 11:48:17 +01:00
2021-11-26 11:48:18 +01:00
2021-07-20 16:21:08 +02:00
2021-11-02 17:39:23 +01:00
2021-09-22 11:43:02 +02:00
2021-09-22 11:42:55 +02:00
2021-07-20 16:21:08 +02:00
2021-05-22 10:40:23 +02:00
2021-05-26 11:29:07 +02:00
2021-07-20 16:21:14 +02:00
2021-09-22 11:43:02 +02:00
2021-03-03 17:44:37 +01:00
2021-10-06 10:23:41 +02:00
2020-06-20 10:24:18 +02:00
2021-09-26 13:36:17 +02:00
2020-10-01 20:40:02 +02:00
2021-09-26 13:36:18 +02:00
2019-12-21 10:42:32 +01:00
2021-11-26 11:48:22 +01:00
2021-07-20 16:21:05 +02:00
2021-04-07 12:05:40 +02:00
2021-10-27 09:33:57 +02:00
2021-07-20 16:21:12 +02:00
2021-10-27 09:33:59 +02:00
2021-10-17 10:05:40 +02:00
2021-05-22 10:40:26 +02:00
2021-11-26 11:48:20 +01:00
2021-11-26 11:48:21 +01:00
2021-05-22 10:40:16 +02:00
2021-09-22 11:43:02 +02:00
2020-09-12 11:47:36 +02:00
2021-10-27 09:33:58 +02:00
2021-11-26 11:48:24 +01:00
2021-11-26 11:48:17 +01:00
2021-08-04 11:58:01 +02:00
2021-10-06 10:23:42 +02:00
2020-12-29 13:45:00 +01:00
2021-10-27 09:34:00 +02:00
2021-07-20 16:21:05 +02:00
2020-06-20 10:24:21 +02:00
2021-10-06 10:23:39 +02:00
2021-07-20 16:21:10 +02:00
2021-11-26 11:48:18 +01:00
2021-07-20 16:21:15 +02:00
2020-12-29 13:44:58 +01:00
2020-11-10 10:23:57 +01:00
2021-09-22 11:43:10 +02:00
2021-10-27 09:33:57 +02:00
2021-11-26 11:48:20 +01:00
2021-09-22 11:43:10 +02:00
2021-11-26 11:48:24 +01:00
2021-11-02 17:39:23 +01:00
2020-10-29 09:05:41 +01:00
2021-03-03 17:44:44 +01:00
2021-09-22 11:42:57 +02:00
2021-10-27 09:33:58 +02:00
2021-07-20 16:21:05 +02:00
2021-09-26 13:36:18 +02:00
2021-09-22 11:43:07 +02:00
2021-11-26 11:48:23 +01:00
2021-08-15 13:01:03 +02:00
2021-07-20 16:21:05 +02:00
2021-09-22 11:43:04 +02:00
2021-10-27 09:34:01 +02:00
2021-09-22 11:43:03 +02:00
2020-11-10 21:04:57 +01:00
2020-12-29 13:45:00 +01:00
2021-10-17 10:05:39 +02:00
2021-09-26 13:36:18 +02:00
2021-05-26 11:29:06 +02:00
2021-11-26 11:48:22 +01:00
2021-02-23 13:59:14 +01:00
2021-07-28 09:14:24 +02:00
2021-09-22 11:43:02 +02:00
2021-07-20 16:21:11 +02:00
2021-11-12 13:18:01 +01:00
2021-09-22 11:43:00 +02:00
2021-11-26 11:48:21 +01:00
2021-07-20 16:20:57 +02:00
2021-11-12 13:18:02 +01:00
2021-07-28 09:14:27 +02:00
2021-09-26 13:36:18 +02:00
2021-10-06 10:23:41 +02:00
2020-07-22 09:10:53 +02:00
2021-11-26 11:48:17 +01:00
2021-09-22 11:43:04 +02:00
2021-09-03 09:44:40 +02:00
2021-09-22 11:43:05 +02:00
2020-10-29 09:05:35 +01:00
2021-09-03 09:44:40 +02:00
2020-02-28 15:42:33 +01:00
2020-11-10 10:23:57 +01:00
2021-11-26 11:48:21 +01:00
2021-08-26 08:37:23 -04:00