[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1514480744.749800933@decadent.org.uk>
Date: Thu, 28 Dec 2017 17:05:44 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, "Steve French" <smfrench@...il.com>,
"David Disseldorp" <ddiss@...e.de>
Subject: [PATCH 3.16 141/204] SMB: fix leak of validate negotiate info
response buffer
3.16.52-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: David Disseldorp <ddiss@...e.de>
commit fe83bebc05228e838ed5cbbc62712ab50dd40e18 upstream.
Fixes: ff1c038addc4 ("Check SMB3 dialects against downgrade attacks")
Signed-off-by: David Disseldorp <ddiss@...e.de>
Signed-off-by: Steve French <smfrench@...il.com>
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
fs/cifs/smb2pdu.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -479,7 +479,7 @@ int smb3_validate_negotiate(const unsign
{
int rc = 0;
struct validate_negotiate_info_req vneg_inbuf;
- struct validate_negotiate_info_rsp *pneg_rsp;
+ struct validate_negotiate_info_rsp *pneg_rsp = NULL;
u32 rsplen;
cifs_dbg(FYI, "validate negotiate\n");
@@ -536,7 +536,7 @@ int smb3_validate_negotiate(const unsign
/* relax check since Mac returns max bufsize allowed on ioctl */
if (rsplen > CIFSMaxBufSize)
- return -EIO;
+ goto err_rsp_free;
}
/* check validate negotiate info response matches what we got earlier */
@@ -555,10 +555,13 @@ int smb3_validate_negotiate(const unsign
/* validate negotiate successful */
cifs_dbg(FYI, "validate negotiate info successful\n");
+ kfree(pneg_rsp);
return 0;
vneg_out:
cifs_dbg(VFS, "protocol revalidation - security settings mismatch\n");
+err_rsp_free:
+ kfree(pneg_rsp);
return -EIO;
}
Powered by blists - more mailing lists