]> git.karo-electronics.de Git - karo-tx-linux.git/commit
fs/direct-io.c: fix possible use-after-free with AIO
authorJan Kara <jack@suse.cz>
Wed, 20 Feb 2013 02:16:39 +0000 (13:16 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:54:01 +0000 (16:54 +1100)
commitd0cf72a3de5f6b6d1821e33cdeeb331be2963128
tree2bd5853bde97185baee857d2b38fbcc81432ddfd
parent251ecbbe6c720c992967dcb5599df03cc8efb318
fs/direct-io.c: fix possible use-after-free with AIO

Running AIO is pinning inode in memory using file reference.  Once AIO is
completed using aio_complete(), file reference is put and inode can be
freed from memory.  So we have to be sure that calling aio_complete() is
the last thing we do with the inode.

Acked-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Jeff Moyer <jmoyer@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/direct-io.c