summaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2pdu.c
diff options
context:
space:
mode:
authorRonnie Sahlberg2018-06-08 05:21:18 +0200
committerSteve French2018-06-08 06:39:41 +0200
commit9d874c36552afbd08778687aeaff24a8a7260f20 (patch)
tree0fab42a276b8045ecb1f96112ed1c4ca7d21508a /fs/cifs/smb2pdu.c
parentsmb3: do not allow insecure cifs mounts when using smb3 (diff)
downloadkernel-qcow2-linux-9d874c36552afbd08778687aeaff24a8a7260f20.tar.gz
kernel-qcow2-linux-9d874c36552afbd08778687aeaff24a8a7260f20.tar.xz
kernel-qcow2-linux-9d874c36552afbd08778687aeaff24a8a7260f20.zip
cifs: fix a buffer leak in smb2_query_symlink
This leak was introduced in 91cb74f5142c14dd921ab2d064b7b128054f9fae and caused us to leak one small buffer for every symlink query. Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/smb2pdu.c')
-rw-r--r--fs/cifs/smb2pdu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 92e54b1638be..48e2004c75fb 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1889,7 +1889,7 @@ alloc_path_with_tree_prefix(__le16 **out_path, int *out_size, int *out_len,
int
SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
__u8 *oplock, struct smb2_file_all_info *buf,
- struct kvec *err_iov)
+ struct kvec *err_iov, int *buftype)
{
struct smb2_create_req *req;
struct smb2_create_rsp *rsp;
@@ -2052,6 +2052,7 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
cifs_stats_fail_inc(tcon, SMB2_CREATE_HE);
if (err_iov && rsp) {
*err_iov = rsp_iov;
+ *buftype = resp_buftype;
resp_buftype = CIFS_NO_BUFFER;
rsp = NULL;
}