cifs: Fix use-after-free in SMB2_write
authorZhangXiaoxu <zhangxiaoxu5@huawei.com>
Sat, 6 Apr 2019 07:47:38 +0000 (15:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Apr 2019 07:36:33 +0000 (09:36 +0200)
commit8fb89b43b65fcd35f15d982712904b96fc64c68a
tree41b5c80b6cbb97e15f5cd19791fa60ae372f593a
parent8092ecc306d81186a64cda42411121f4d35aaff4
cifs: Fix use-after-free in SMB2_write

commit 6a3eb3360667170988f8a6477f6686242061488a upstream.

There is a KASAN use-after-free:
BUG: KASAN: use-after-free in SMB2_write+0x1342/0x1580
Read of size 8 at addr ffff8880b6a8e450 by task ln/4196

Should not release the 'req' because it will use in the trace.

Fixes: eccb4422cf97 ("smb3: Add ftrace tracepoints for improved SMB3 debugging")

Signed-off-by: ZhangXiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org> 4.18+
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2pdu.c