]> git.hungrycats.org Git - linux/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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 2 May 2009 17:56:37 +0000 (10:56 -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>
Signed-off-by: Steve French <sfrench@us.ibm.com>
[chrisw: minor backport to CHANGES file]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/cifs/CHANGES
fs/cifs/connect.c

index 4c1cb9a5523e6427d3a510570fdcfdbe8956dd87..3c8b48df69615db747d66aef9f7d03bf442526cf 100644 (file)
@@ -1,4 +1,7 @@
 Fix oops in cifs_dfs_ref.c when prefixpath is not reachable when using DFS.
+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.55
 ------------
index b5b8649bd8edc2e05631f05280aa62a043a85042..6c71d4b517d4d62633620011d69030914d026e73 100644 (file)
@@ -3565,7 +3565,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,