]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit2717eed6c98ba9c4a8771c6f94ff5a73cc7471f9
tree59d1fdc9cec0b0ad756a6c2b2d9d70ad1c6c8a01
parent2f9c8545e7d1bfa758eb4cd1bf13235301ee4c9d
cifs: fix handle leak in smb2_query_symlink()

BugLink: https://bugs.launchpad.net/bugs/1838349
commit e6d0fb7b34f264f72c33053558a360a6a734905e upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/cifs/smb2ops.c