]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: fix handle leak in smb2_query_symlink()
authorRonnie Sahlberg <lsahlber@redhat.com>
Tue, 9 Apr 2019 21:47:22 +0000 (07:47 +1000)
committerSteve French <stfrench@microsoft.com>
Tue, 16 Apr 2019 14:38:26 +0000 (09:38 -0500)
commitf8067eccda314337aeb23a315dc9a6cfcfb2ce03
tree5b0981d05bd73ae29925e651ee77a52ddd8fed82
parentc734a97ee0f1a8993724ce01d89e1a50e92cad57
cifs: fix handle leak in smb2_query_symlink()

If we enter smb2_query_symlink() for something that is not a symlink
and where the SMB2_open() would succeed we would never end up
closing this handle and would thus leak a handle on the server.

Fix this by immediately calling SMB2_close() on successfull open.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
CC: Stable <stable@vger.kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
fs/cifs/smb2ops.c