From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 10:43:01 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B79221065690; Fri, 7 Nov 2008 10:43:01 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A625F8FC0A; Fri, 7 Nov 2008 10:43:01 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA7Ah1Fh081564; Fri, 7 Nov 2008 10:43:01 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA7Ah1jd081563; Fri, 7 Nov 2008 10:43:01 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811071043.mA7Ah1jd081563@svn.freebsd.org> From: Doug Rabson Date: Fri, 7 Nov 2008 10:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184744 - head/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 10:43:01 -0000 Author: dfr Date: Fri Nov 7 10:43:01 2008 New Revision: 184744 URL: http://svn.freebsd.org/changeset/base/184744 Log: Range-check NFSv2 procedure numbers before converting to NFSv3. Submitted by: csjp Modified: head/sys/nfsserver/nfs_fha.c Modified: head/sys/nfsserver/nfs_fha.c ============================================================================== --- head/sys/nfsserver/nfs_fha.c Fri Nov 7 07:02:28 2008 (r184743) +++ head/sys/nfsserver/nfs_fha.c Fri Nov 7 10:43:01 2008 (r184744) @@ -180,11 +180,16 @@ fha_extract_info(struct svc_req *req, st i->locktype = LK_EXCLUSIVE; /* - * Extract the procnum and convert to v3 form if necessary. + * Extract the procnum and convert to v3 form if necessary, + * taking care to deal with out-of-range procnums. Caller will + * ensure that rq_vers is either 2 or 3. */ procnum = req->rq_proc; - if (!v3) + if (!v3) { + if (procnum > NFSV2PROC_STATFS) + goto out; procnum = nfsrv_nfsv3_procid[procnum]; + } /* * We do affinity for most. However, we divide a realm of affinity