]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] sg: checking sdp->detached isn't protected when open
authorVaughan Cao <vaughan.cao@oracle.com>
Thu, 29 Aug 2013 02:00:38 +0000 (10:00 +0800)
committerJames Bottomley <JBottomley@Parallels.com>
Tue, 3 Sep 2013 14:28:09 +0000 (07:28 -0700)
commit92eccf67d1626a1b9b289a1ac4094d4155201eca
tree2e924a5838335cbfca0cf52a0add8e38801773e2
parentb0916a76ef85af479ea454f41ffc77064054a166
[SCSI] sg: checking sdp->detached isn't protected when open

@detached is set under the protection of sg_index_lock. Without getting the
lock, new sfp will be added during sg removal and there is no chance for it
to be picked out. So check with sg_index_lock held in sg_add_sfp().

Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/sg.c