From patchwork Sun Sep 9 15:25:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: malahal naineni X-Patchwork-Id: 1427831 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 2E50FDF280 for ; Sun, 9 Sep 2012 15:25:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753654Ab2IIPZy (ORCPT ); Sun, 9 Sep 2012 11:25:54 -0400 Received: from e8.ny.us.ibm.com ([32.97.182.138]:56688 "EHLO e8.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752199Ab2IIPZy (ORCPT ); Sun, 9 Sep 2012 11:25:54 -0400 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 9 Sep 2012 11:25:53 -0400 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e8.ny.us.ibm.com (192.168.1.108) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 9 Sep 2012 11:25:50 -0400 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id C8DD638C803B for ; Sun, 9 Sep 2012 11:25:49 -0400 (EDT) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q89FPn3X37093512 for ; Sun, 9 Sep 2012 11:25:49 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q89FPmTr002121 for ; Sun, 9 Sep 2012 11:25:48 -0400 Received: from malahal (malahal.austin.ibm.com [9.41.105.170]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q89FPmw6002093 for ; Sun, 9 Sep 2012 11:25:48 -0400 Received: by malahal (Postfix, from userid 155450) id D9362BFE5A; Sun, 9 Sep 2012 10:25:47 -0500 (CDT) From: Malahal Naineni To: linux-nfs@vger.kernel.org Subject: [PATCH] NFSD: pass null terminated buf to kstrtouint() Date: Sun, 9 Sep 2012 10:25:47 -0500 Message-Id: <1347204347-23706-1-git-send-email-malahal@us.ibm.com> X-Mailer: git-send-email 1.7.0.4 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12090915-9360-0000-0000-00000A695A14 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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 --- fs/nfsd/nfs4idmap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c index fdc91a6..ccfe0d0 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; }