linux-stable/drivers/infiniband/ulp
Bart Van Assche 8a7a605e10 RDMA/srp: Rework SCSI device reset handling
commit 48396e80fb upstream.

Since .scsi_done() must only be called after scsi_queue_rq() has
finished, make sure that the SRP initiator driver does not call
.scsi_done() while scsi_queue_rq() is in progress. Although
invoking sg_reset -d while I/O is in progress works fine with kernel
v4.20 and before, that is not the case with kernel v5.0-rc1. This
patch avoids that the following crash is triggered with kernel
v5.0-rc1:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000138
CPU: 0 PID: 360 Comm: kworker/0:1H Tainted: G    B             5.0.0-rc1-dbg+ #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014
Workqueue: kblockd blk_mq_run_work_fn
RIP: 0010:blk_mq_dispatch_rq_list+0x116/0xb10
Call Trace:
 blk_mq_sched_dispatch_requests+0x2f7/0x300
 __blk_mq_run_hw_queue+0xd6/0x180
 blk_mq_run_work_fn+0x27/0x30
 process_one_work+0x4f1/0xa20
 worker_thread+0x67/0x5b0
 kthread+0x1cf/0x1f0
 ret_from_fork+0x24/0x30

Cc: <stable@vger.kernel.org>
Fixes: 94a9174c63 ("IB/srp: reduce lock coverage of command completion")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-27 10:07:00 +01:00
..
ipoib IB/ipoib: Clear IPCB before icmp_send 2018-11-13 11:16:52 -08:00
iser iser: set sector for ambiguous mr status errors 2018-12-08 13:05:06 +01:00
isert IB/isert: fix T10-pi check mask setting 2018-07-03 11:23:09 +02:00
srp RDMA/srp: Rework SCSI device reset handling 2019-02-27 10:07:00 +01:00
srpt ib_srpt: Fix a use-after-free in __srpt_close_all_ch() 2018-12-29 13:40:14 +01:00
Makefile