CIFS: Fix a possible invalid memory access in smb2_query_symlink()
authorPavel Shilovsky <pshilovsky@samba.org>
Sun, 24 Jul 2016 07:37:38 +0000 (10:37 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Aug 2016 16:09:20 +0000 (18:09 +0200)
commitadc58bfd4d75183a65f806b1b5354d1b65f832c6
treebd91c301379a75155c115d65cba2419f44077b0a
parent047617448daecf05e57498d8697acd3dbd38672d
CIFS: Fix a possible invalid memory access in smb2_query_symlink()

commit 7893242e2465aea6f2cbc2639da8fa5ce96e8cc2 upstream.

During following a symbolic link we received err_buf from SMB2_open().
While the validity of SMB2 error response is checked previously
in smb2_check_message() a symbolic link payload is not checked at all.
Fix it by adding such checks.

Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2ops.c