aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/netmisc.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-03-01 02:06:52 -0500
committerSteve French <sfrench@us.ibm.com>2012-03-31 18:32:18 -0400
commit2545e0720a5a4bf8ebccc6f793f97a246cf3f18d (patch)
tree377dc4e2bc40e93189f44a3e48515a50722e31c5 /fs/cifs/netmisc.c
parentb2a3ad9ca502169fc4c11296fa20f56059c7c031 (diff)
cifs: writing past end of struct in cifs_convert_address()
"s6->sin6_scope_id" is an int bits but strict_strtoul() writes a long so this can corrupt memory on 64 bit systems. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/netmisc.c')
-rw-r--r--fs/cifs/netmisc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index dd23a321bdda..581c225f7f50 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -197,8 +197,7 @@ cifs_convert_address(struct sockaddr *dst, const char *src, int len)
197 memcpy(scope_id, pct + 1, slen); 197 memcpy(scope_id, pct + 1, slen);
198 scope_id[slen] = '\0'; 198 scope_id[slen] = '\0';
199 199
200 rc = strict_strtoul(scope_id, 0, 200 rc = kstrtouint(scope_id, 0, &s6->sin6_scope_id);
201 (unsigned long *)&s6->sin6_scope_id);
202 rc = (rc == 0) ? 1 : 0; 201 rc = (rc == 0) ? 1 : 0;
203 } 202 }
204 203