]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
fuse: do not use iocb after it may have been freed
authorRobert Doebbelin <robert@quobyte.com>
Mon, 7 Mar 2016 08:50:56 +0000 (09:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2016 16:08:58 +0000 (09:08 -0700)
commit32b9807433507058fce25092a0d11abac494d00d
tree04975cd6f8afea52e7480522830b40963a55e706
parent2775a60447ae12350711b443be1083117b6f13b8
fuse: do not use iocb after it may have been freed

commit 7cabc61e01a0a8b663bd2b4c982aa53048218734 upstream.

There's a race in fuse_direct_IO(), whereby is_sync_kiocb() is called on an
iocb that could have been freed if async io has already completed.  The fix
in this case is simple and obvious: cache the result before starting io.

It was discovered by KASan:

kernel: ==================================================================
kernel: BUG: KASan: use after free in fuse_direct_IO+0xb1a/0xcc0 at addr ffff88036c414390

Signed-off-by: Robert Doebbelin <robert@quobyte.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Fixes: bcba24ccdc82 ("fuse: enable asynchronous processing direct IO")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/fuse/file.c