linux/drivers/infiniband/hw/cxgb4
Steve Wise 308aa2b8f7 iw_cxgb4: only allow 1 flush on user qps
Once the qp has been flushed, it cannot be flushed again.  The user qp
flush logic wasn't enforcing it however.  The bug can cause
touch-after-free crashes like:

Unable to handle kernel paging request for data at address 0x000001ec
Faulting instruction address: 0xc008000016069100
Oops: Kernel access of bad area, sig: 11 [#1]
...
NIP [c008000016069100] flush_qp+0x80/0x480 [iw_cxgb4]
LR [c00800001606cd6c] c4iw_modify_qp+0x71c/0x11d0 [iw_cxgb4]
Call Trace:
[c00800001606cd6c] c4iw_modify_qp+0x71c/0x11d0 [iw_cxgb4]
[c00800001606e868] c4iw_ib_modify_qp+0x118/0x200 [iw_cxgb4]
[c0080000119eae80] ib_security_modify_qp+0xd0/0x3d0 [ib_core]
[c0080000119c4e24] ib_modify_qp+0xc4/0x2c0 [ib_core]
[c008000011df0284] iwcm_modify_qp_err+0x44/0x70 [iw_cm]
[c008000011df0fec] destroy_cm_id+0xcc/0x370 [iw_cm]
[c008000011ed4358] rdma_destroy_id+0x3c8/0x520 [rdma_cm]
[c0080000134b0540] ucma_close+0x90/0x1b0 [rdma_ucm]
[c000000000444da4] __fput+0xe4/0x2f0

So fix flush_qp() to only flush the wq once.

Cc: stable@vger.kernel.org
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2018-09-04 15:07:56 -06:00
..
cm.c iw_cxgb4: pass window scale in flowc work request 2018-08-08 09:54:55 -06:00
cq.c iw_cxgb4: RDMA write with immediate support 2018-08-02 20:16:02 -06:00
device.c iw_cxgb4: Support FW write completion WR 2018-08-02 20:16:02 -06:00
ev.c rdma/cxgb4: Add support for 64Byte cqes 2018-07-13 11:52:55 -06:00
id_table.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
iw_cxgb4.h iw_cxgb4: pass window scale in flowc work request 2018-08-08 09:54:55 -06:00
Kconfig iw_cxgb4: add INFINIBAND_ADDR_TRANS dependency 2018-06-04 09:35:24 -06:00
Makefile iw_cxgb4: dump detailed driver-specific QP information 2018-05-03 15:51:27 -04:00
mem.c iw_cxgb4: correctly enforce the max reg_mr depth 2018-06-25 15:27:51 -06:00
provider.c RDMA/providers: Remove pointless functions 2018-07-30 20:31:54 -06:00
qp.c iw_cxgb4: only allow 1 flush on user qps 2018-09-04 15:07:56 -06:00
resource.c rdma/cxgb4: Add support for kernel mode SRQ's 2018-07-25 21:08:04 -06:00
restrack.c iw_cxgb4: provide detailed driver-specific MR information 2018-05-24 09:39:25 -06:00
t4.h iw_cxgb4: Support FW write completion WR 2018-08-02 20:16:02 -06:00
t4fw_ri_api.h iw_cxgb4: Support FW write completion WR 2018-08-02 20:16:02 -06:00