]> 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>
Thu, 7 Feb 2013 01:31:59 +0000 (12:31 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Feb 2013 05:47:43 +0000 (16:47 +1100)
commit349eace8f2dd547615844d03c932e18e796f9dff
tree5136f881160d025464fb9a50d03dfd56ad6b2db4
parenteeb9d3d8c3bbf40fbecd128b13c27ccba4f22d82
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