Skip to content

Commit 2545e07

Browse files
Dan CarpenterSteve French
authored andcommitted
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>
1 parent b2a3ad9 commit 2545e07

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎fs/cifs/netmisc.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ cifs_convert_address(struct sockaddr *dst, const char *src, int len)
197197
memcpy(scope_id, pct + 1, slen);
198198
scope_id[slen] = '\0';
199199

200-
rc = strict_strtoul(scope_id, 0,
201-
(unsigned long *)&s6->sin6_scope_id);
200+
rc = kstrtouint(scope_id, 0, &s6->sin6_scope_id);
202201
rc = (rc == 0) ? 1 : 0;
203202
}
204203

0 commit comments

Comments
 (0)