projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fe35a40
)
scsi: tcmu: fix use after free
author
Xiubo Li
<
[email protected]
>
Tue, 22 Jan 2019 10:10:51 +0000
(18:10 +0800)
committer
Martin K. Petersen
<
[email protected]
>
Wed, 23 Jan 2019 01:54:00 +0000
(20:54 -0500)
Fixes: a94a2572b977 ("scsi: tcmu: avoid cmd/qfull timers updated whenever a new cmd comes")
Reported-by: Dan Carpenter <
[email protected]
>
Cc: Mike Christie <
[email protected]
>
Signed-off-by: Xiubo Li <
[email protected]
>
Reviewed-by: Mike Christie <
[email protected]
>
Signed-off-by: Martin K. Petersen <
[email protected]
>
drivers/target/target_core_user.c
patch
|
blob
|
history
diff --git
a/drivers/target/target_core_user.c
b/drivers/target/target_core_user.c
index c34c88ef331996e7bc02783f3957ca88fd451841..5831e0eecea120f9157cb566311839b9273755ce 100644
(file)
--- a/
drivers/target/target_core_user.c
+++ b/
drivers/target/target_core_user.c
@@
-1317,12
+1317,13
@@
static int tcmu_check_expired_cmd(int id, void *p, void *data)
* target_complete_cmd will translate this to LUN COMM FAILURE
*/
scsi_status = SAM_STAT_CHECK_CONDITION;
+ list_del_init(&cmd->queue_entry);
} else {
+ list_del_init(&cmd->queue_entry);
idr_remove(&udev->commands, id);
tcmu_free_cmd(cmd);
scsi_status = SAM_STAT_TASK_SET_FULL;
}
- list_del_init(&cmd->queue_entry);
pr_debug("Timing out cmd %u on dev %s that is %s.\n",
id, udev->name, is_running ? "inflight" : "queued");