]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
CIFS: Fix memory overwrite when saving nativeFileSystem field during mount
authorSteve French <sfrench@us.ibm.com>
Thu, 26 Mar 2009 23:05:15 +0000 (23:05 +0000)
committerChris Wright <chrisw@sous-sol.org>
Thu, 2 Apr 2009 20:55:17 +0000 (13:55 -0700)
upstream commit: b363b3304bcf68c4541683b2eff70b29f0446a5b

CIFS can allocate a few bytes to little for the nativeFileSystem field
during tree connect response processing during mount.  This can result
in a "Redzone overwritten" message to be logged.

Signed-off-by: Sridhar Vinay <vinaysridhar@in.ibm.com>
Acked-by: Shirish Pargaonkar <shirishp@us.ibm.com>
CC: Stable <stable@kernel.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
[chrisw: minor backport to CHANGES file]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
fs/cifs/CHANGES
fs/cifs/connect.c

index 851388fafc7302dbae9d5b5f7f33da5101eed4cd..6562eb0353a344849f7c2da5d3b3c28648c39d48 100644 (file)
@@ -7,6 +7,9 @@ are authenticated as guest, as reconnections, invalidating the earlier
 user's smb session.  This fix allows cifs to mount multiple times to the
 same server with different userids without risking invalidating earlier
 established security contexts.
+Fix "redzone overwritten" bug in cifs_put_tcon (CIFSTcon may allocate too
+little memory for the "nativeFileSystem" field returned by the server
+during mount). 
 
 Version 1.56
 ------------
index da0f4ffa06132f725570a79f7e0b5fb0b65d1eb6..4b64f39a85da48a3b8a81f271a5a56475561aa2b 100644 (file)
@@ -3667,7 +3667,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
                            BCC(smb_buffer_response)) {
                                kfree(tcon->nativeFileSystem);
                                tcon->nativeFileSystem =
-                                   kzalloc(length + 2, GFP_KERNEL);
+                                   kzalloc(2*(length + 1), GFP_KERNEL);
                                if (tcon->nativeFileSystem)
                                        cifs_strfromUCS_le(
                                                tcon->nativeFileSystem,