Skip to content

Commit

Permalink
nfsd4: memory corruption in numeric_name_to_id()
Browse files Browse the repository at this point in the history
"id" is type is a uid_t (32 bits) but on 64 bit systems strict_strtoul()
modifies 64 bits of data.  We should use kstrtouint() instead.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
Dan Carpenter authored and J. Bruce Fields committed Mar 28, 2012
1 parent 9276910 commit 3af7061
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfsd/nfs4idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ numeric_name_to_id(struct svc_rqst *rqstp, int type, const char *name, u32 namel
/* Just to make sure it's null-terminated: */
memcpy(buf, name, namelen);
buf[namelen] = '\0';
ret = strict_strtoul(name, 10, (unsigned long *)id);
ret = kstrtouint(name, 10, id);
return ret == 0;
}

Expand Down

0 comments on commit 3af7061

Please sign in to comment.