diff options
author | Roland Dreier <roland@purestorage.com> | 2013-01-02 12:47:58 -0800 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-01-10 21:00:35 -0800 |
commit | 72b59d6ee8adaa51f70377db0a1917ed489bead8 (patch) | |
tree | fcfc00e42478a608a24ae4df9795568abc808f4c /drivers/scsi/st.h | |
parent | e627c615553a356f6f70215ebb3933c6e057553e (diff) | |
download | op-kernel-dev-72b59d6ee8adaa51f70377db0a1917ed489bead8.zip op-kernel-dev-72b59d6ee8adaa51f70377db0a1917ed489bead8.tar.gz |
target: Fix use-after-free in LUN RESET handling
If a backend IO takes a really long then an initiator might abort a
command, and then when it gives up on the abort, send a LUN reset too,
all before we process any of the original command or the abort. (The
abort will wait for the backend IO to complete too)
When the backend IO final completes (or fails), the abort handling
will proceed and queue up a "return aborted status" operation. Then,
while that's still pending, the LUN reset might find the original
command still on the LUN's list of commands and try to return aborted
status again, which leads to a use-after free when the first
se_tfo->queue_status call frees the command and then the second
se_tfo->queue_status call runs.
Fix this by removing a command from the LUN state_list when we first
are about to queue aborted status; we shouldn't do anything
LUN-related after we've started returning status, so this seems like
the correct thing to do.
Signed-off-by: Roland Dreier <roland@purestorage.com>
Cc: stable@vger.kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/scsi/st.h')
0 files changed, 0 insertions, 0 deletions