Patchwork [3.5.yuz,extended,stable] Patch "NFSD: pass null terminated buf to kstrtouint()" has been added to staging queue

mail settings
Submitter Herton Ronaldo Krzesinski
Date Nov. 15, 2012, 5:47 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/199136/
State New
Headers show


Herton Ronaldo Krzesinski - Nov. 15, 2012, 5:47 a.m.
This is a note to let you know that I have just added a patch titled

    NFSD: pass null terminated buf to kstrtouint()

to the linux-3.5.y-queue branch of the 3.5.yuz extended stable tree 
which can be found at:;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.yuz tree, see



From b475512a3100e0ddfa57df16d9dc3c6e414d7a59 Mon Sep 17 00:00:00 2001
From: Malahal Naineni <>
Date: Sun, 9 Sep 2012 10:25:47 -0500
Subject: [PATCH] NFSD: pass null terminated buf to kstrtouint()

commit 9959ba0c241a71c7ed8133401cfbbee2720da0b5 upstream.

The 'buf' is prepared with null termination with intention of using it for
this purpose, but 'name' is passed instead!

Signed-off-by: Malahal Naineni <>
Signed-off-by: J. Bruce Fields <>
Signed-off-by: Herton Ronaldo Krzesinski <>
 fs/nfsd/nfs4idmap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index dae36f1..b6f782e 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -598,7 +598,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 = kstrtouint(name, 10, id);
+	ret = kstrtouint(buf, 10, id);
 	return ret == 0;