diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2016-02-23 00:07:09 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-03-01 15:38:58 +0100 |
commit | 8d5dbec3bcb24a7d071962448e0fecaca8c75cc7 (patch) | |
tree | ccb8868cb74c02bb283bf69d84722dcfe83e1e8c /drivers/scsi/scsi_trace.c | |
parent | ncr5380: Fix NCR5380_select() EH checks and result handling (diff) | |
download | linux-8d5dbec3bcb24a7d071962448e0fecaca8c75cc7.tar.xz linux-8d5dbec3bcb24a7d071962448e0fecaca8c75cc7.zip |
ncr5380: Call scsi_eh_prep_cmnd() and scsi_eh_restore_cmnd() as and when appropriate
This bug causes the wrong command to have its sense pointer overwritten,
which sometimes leads to a NULL pointer deref. Fix this by checking which
command is being requeued before restoring the scsi_eh_save data.
It turns out that some targets will disconnect a REQUEST SENSE command.
The autosense algorithm doesn't anticipate this. Hence multiple commands
can end up undergoing autosense simultaneously, and they will all try to
use the same scsi_eh_save struct, which won't work. Defer autosense when
the scsi_eh_save storage is in use by another command.
Fixes: f27db8eb98a1 ("ncr5380: Fix autosense bugs")
Reported-and-tested-by: Michael Schmitz <schmitzmic@gmail.com>
Cc: <stable@vger.kernel.org> # 4.5
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_trace.c')
0 files changed, 0 insertions, 0 deletions