]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] possible use-after-free of bio
authorJens Axboe <axboe@suse.de>
Sat, 16 Apr 2005 22:25:40 +0000 (15:25 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 16 Apr 2005 22:25:40 +0000 (15:25 -0700)
commitc2f7e43498ff1186332bf70650b6e2febb6453be
tree1174930dbb68a02e007cab92d500e86fc9958ecb
parent3b22b35c5a429d78223d183afeec7c1e9c0bb74c
[PATCH] possible use-after-free of bio

There is a possibility that a bio will be accessed after it has been freed
on SCSI.  It happens if you submit a bio with BIO_SYNC marked and the
auto-unplugging kicks the request_fn, SCSI re-enables interrupts in-between
so if the request completes between the add_request() in __make_request()
and the bio_sync() call, we could be looking at a dead bio.  It's a slim
race, but it has been triggered in the Real World.

So assign bio_sync() to a local variable instead.

Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/block/ll_rw_blk.c