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

commit 088aaf17aa79300cab14dbee2569c58cfafd7d6e upstream.

There is a KASAN use-after-free:
BUG: KASAN: use-after-free in SMB2_read+0x1136/0x1190
Read of size 8 at addr ffff8880b4e45e50 by task ln/1009

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