summaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorSteve French2009-03-18 06:57:22 +0100
committerSteve French2009-03-18 06:57:22 +0100
commitb363b3304bcf68c4541683b2eff70b29f0446a5b (patch)
treeda2a563b452cc14f900394f3ad56aa47701c5ea5 /fs/cifs/connect.c
parent[CIFS] Rename compose_mount_options to cifs_compose_mount_options. (diff)
downloadkernel-qcow2-linux-b363b3304bcf68c4541683b2eff70b29f0446a5b.tar.gz
kernel-qcow2-linux-b363b3304bcf68c4541683b2eff70b29f0446a5b.tar.xz
kernel-qcow2-linux-b363b3304bcf68c4541683b2eff70b29f0446a5b.zip
[CIFS] Fix memory overwrite when saving nativeFileSystem field during mount
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>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index cd4ccc8ce471..0de3b5615a22 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3674,7 +3674,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,