gadgetfs: use-after-free in ->aio_read()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 6 Feb 2015 07:07:45 +0000 (02:07 -0500)
committerSasha Levin <sasha.levin@oracle.com>
Sat, 28 Mar 2015 14:01:39 +0000 (10:01 -0400)
commitc81fc59be42c6e0d5061d00ee910c59db08da90e
tree255d1fd5e0bf4fe3f88c0393c699ec563fd2d9ca
parentc7fd1867c7d0626bf00373cec0f64b0ce4f4ec84
gadgetfs: use-after-free in ->aio_read()

[ Upstream commit f01d35a15fa04162a58b95970fc01fa70ec9dacd ]

AIO_PREAD requests call ->aio_read() with iovec on caller's stack, so if
we are going to access it asynchronously, we'd better get ourselves
a copy - the one on kernel stack of aio_run_iocb() won't be there
anymore.  function/f_fs.c take care of doing that, legacy/inode.c
doesn't...

Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/usb/gadget/legacy/inode.c