summaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2011-03-01 05:02:57 +0000
committerSteve French <sfrench@us.ibm.com>2011-05-19 14:10:48 +0000
commit34c87901e113799a45423fdac29c7478c889a95d (patch)
tree1398028abbfc10d181f3a3c805c78ebb689d9e70 /fs/cifs/connect.c
parentfd62cb7e7411f1f5ca774145665316d3612fed9a (diff)
downloadop-kernel-dev-34c87901e113799a45423fdac29c7478c889a95d.zip
op-kernel-dev-34c87901e113799a45423fdac29c7478c889a95d.tar.gz
Shrink stack space usage in cifs_construct_tcon
We were reserving MAX_USERNAME (now 256) on stack for something which only needs to fit about 24 bytes ie string krb50x + printf version of uid Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 68b7dbf..8d72acb 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3258,7 +3258,9 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid)
struct cifsSesInfo *ses;
struct cifsTconInfo *tcon = NULL;
struct smb_vol *vol_info;
- char username[MAX_USERNAME_SIZE + 1];
+ char username[28]; /* big enough for "krb50x" + hex of ULONG_MAX 6+16 */
+ /* We used to have this as MAX_USERNAME which is */
+ /* way too big now (256 instead of 32) */
vol_info = kzalloc(sizeof(*vol_info), GFP_KERNEL);
if (vol_info == NULL) {
OpenPOWER on IntegriCloud