]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.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)
committerTim Gardner <tim.gardner@canonical.com>
Thu, 21 Apr 2016 12:53:22 +0000 (06:53 -0600)
commit9980e2fe1e7061dc391374d7768443c626196239
treeb2bce5f1ae19a67584848f9d32b301ae9b0612c9
parent1d15c6c60708600fdd821d62e4ba9f3be7f538b8
fuse: do not use iocb after it may have been freed

BugLink: http://bugs.launchpad.net/bugs/1572722
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>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
fs/fuse/file.c