]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] don't reference freed command in scsi_init_sgtable
authorChristoph Hellwig <hch@lst.de>
Tue, 15 Apr 2014 10:24:55 +0000 (12:24 +0200)
committerJames Bottomley <JBottomley@Parallels.com>
Mon, 21 Apr 2014 14:57:21 +0000 (07:57 -0700)
commit38e905109647dd0ed77f35e7e61464369b16b01d
treefa90a6a3e94a5c3112b3bbdf114c637aa7166eba
parent2d25e6245a7147734fe5f3d9c044dd6f80d9abc8
[SCSI] don't reference freed command in scsi_init_sgtable

Patch

commit 56fef79abba8d5612a86a937dba6ce8a2ef5d938
Author: Christoph Hellwig <hch@infradead.org>
Date:   Thu Feb 20 14:20:55 2014 -0800

    [SCSI] do not manipulate device reference counts in scsi_get/put_command

Introduced a use after free: when scsi_init_io fails we have to release our
device reference, but we do this trying to reference the just freed command.
Add a local scsi_device pointer to fix this.

Fixes: 56fef79abba8d5612a86a937dba6ce8a2ef5d938
Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/scsi_lib.c