From: Dan Carpenter Date: Wed, 28 Mar 2012 10:44:59 +0000 (+0300) Subject: nfsd4: memory corruption in numeric_name_to_id() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3af706135bcc06b1519ba50beaf1b47d32d0fc26;p=linux-beck.git nfsd4: memory corruption in numeric_name_to_id() "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 Signed-off-by: J. Bruce Fields --- diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c index 69ca9c5bb600..322d11ce06a4 100644 --- a/fs/nfsd/nfs4idmap.c +++ b/fs/nfsd/nfs4idmap.c @@ -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; }