]> git.baikalelectronics.ru Git - kernel.git/commit
block: fix use after free in __blkdev_direct_IO
authorChristoph Hellwig <hch@lst.de>
Tue, 24 Jan 2017 13:50:19 +0000 (14:50 +0100)
committerJens Axboe <axboe@fb.com>
Tue, 24 Jan 2017 14:55:53 +0000 (07:55 -0700)
commit2b8bc9488544e1c06c6a56fd425cb4bd9df669e4
treeb9c39916a4397b1eb628e07e4fc6aff91219e393
parent8488b0c703ffe7c40ca25bebfd489abf231aee7f
block: fix use after free in __blkdev_direct_IO

We can't dereference the dio structure after submitting the last bio for
this request, as I/O completion might have happened before the code is
run. Introduce a local is_sync variable instead.

Fixes: 5e2ce7db ("block: new direct I/O implementation")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Matias Bjørling <m@bjorling.me>
Tested-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
fs/block_dev.c