Commit 34c87901 authored by Steve French's avatar Steve French

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: default avatarSteve French <sfrench@us.ibm.com>
parent fd62cb7e
...@@ -274,7 +274,8 @@ struct cifsSesInfo { ...@@ -274,7 +274,8 @@ struct cifsSesInfo {
int capabilities; int capabilities;
char serverName[SERVER_NAME_LEN_WITH_NULL * 2]; /* BB make bigger for char serverName[SERVER_NAME_LEN_WITH_NULL * 2]; /* BB make bigger for
TCP names - will ipv6 and sctp addresses fit? */ TCP names - will ipv6 and sctp addresses fit? */
char *user_name; char *user_name; /* must not be null except during init of sess
and after mount option parsing we fill it */
char *domainName; char *domainName;
char *password; char *password;
struct session_key auth_key; struct session_key auth_key;
......
...@@ -3258,7 +3258,9 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid) ...@@ -3258,7 +3258,9 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid)
struct cifsSesInfo *ses; struct cifsSesInfo *ses;
struct cifsTconInfo *tcon = NULL; struct cifsTconInfo *tcon = NULL;
struct smb_vol *vol_info; 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); vol_info = kzalloc(sizeof(*vol_info), GFP_KERNEL);
if (vol_info == NULL) { if (vol_info == NULL) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment