linux/drivers/infiniband/ulp
Bart Van Assche 2b298f9181 RDMA/srp: Do not call scsi_done() from srp_abort()
commit e193b7955d upstream.

After scmd_eh_abort_handler() has called the SCSI LLD eh_abort_handler
callback, it performs one of the following actions:
* Call scsi_queue_insert().
* Call scsi_finish_command().
* Call scsi_eh_scmd_add().
Hence, SCSI abort handlers must not call scsi_done(). Otherwise all
the above actions would trigger a use-after-free. Hence remove the
scsi_done() call from srp_abort(). Keep the srp_free_req() call
before returning SUCCESS because we may not see the command again if
SUCCESS is returned.

Cc: Bob Pearson <rpearsonhpe@gmail.com>
Cc: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fixes: d853667091 ("IB/srp: Avoid having aborted requests hang")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230823205727.505681-1-bvanassche@acm.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2023-10-10 22:00:45 +02:00
..
ipoib IB/IPoIB: Fix legacy IPoIB due to wrong number of queues 2023-02-14 19:11:43 +01:00
iser IB/iser: Fix login with authentication 2022-08-16 15:56:33 +03:00
isert Revert "IB/isert: Fix incorrect release of isert connection" 2023-09-13 09:42:57 +02:00
opa_vnic IB: move from strlcpy with unused retval to strscpy 2022-08-21 14:18:02 +03:00
rtrs RDMA/rtrs: Fix rxe_dealloc_pd warning 2023-06-21 16:00:57 +02:00
srp RDMA/srp: Do not call scsi_done() from srp_abort() 2023-10-10 22:00:45 +02:00
srpt RDMA/srpt: Add a check for valid 'mad_agent' pointer 2023-05-11 23:03:34 +09:00
Makefile RDMA/rtrs: include client and server modules into kernel compilation 2020-05-17 18:57:15 -03:00