Commit e193b79
RDMA/srp: Do not call scsi_done() from srp_abort()
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: d853667 ("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>1 parent 0bb80ec commit e193b79
1 file changed
Lines changed: 5 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2784 | 2784 | | |
2785 | 2785 | | |
2786 | 2786 | | |
2787 | | - | |
2788 | 2787 | | |
2789 | 2788 | | |
2790 | 2789 | | |
| |||
2798 | 2797 | | |
2799 | 2798 | | |
2800 | 2799 | | |
2801 | | - | |
2802 | | - | |
2803 | | - | |
2804 | | - | |
2805 | | - | |
2806 | | - | |
2807 | | - | |
| 2800 | + | |
2808 | 2801 | | |
2809 | | - | |
2810 | | - | |
| 2802 | + | |
2811 | 2803 | | |
| 2804 | + | |
| 2805 | + | |
2812 | 2806 | | |
2813 | | - | |
| 2807 | + | |
2814 | 2808 | | |
2815 | 2809 | | |
2816 | 2810 | | |
| |||
0 commit comments