From nobody Fri Dec 10 01:04:26 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5FC2918D5B62; Fri, 10 Dec 2021 01:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J9CNW0xhHz4fwp; Fri, 10 Dec 2021 01:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0143E11808; Fri, 10 Dec 2021 01:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BA14Qo1040652; Fri, 10 Dec 2021 01:04:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BA14Q6H040651; Fri, 10 Dec 2021 01:04:26 GMT (envelope-from git) Date: Fri, 10 Dec 2021 01:04:26 GMT Message-Id: <202112100104.1BA14Q6H040651@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 911a1cc05e76 - stable/12 - nfscl: Sanity check irdcnt in nfsrpc_createsession List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 911a1cc05e7618a90438178fae28c02e77cda64f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639098267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aL03L9c9Vs8v2Lo1GHNdXvCW5A2M+R3WoBCD8ZRFONQ=; b=yu9G6eWR5y854Z1qcMbE7s2k0Bu3UN2nMUtzP/wAz4jI/Z6B8kXR0F2ppO0h6VuoJE2zaV fcI4920zboQqWm6bjC/aZ5pAY9DoScRJg7TDxS1YzyPgoEGp2xVUJYNQ9+mHlKiHvDPgL1 5HwSny3fplbbQT776FRHFgm/Nv4k2/rOYMg08TuMYrqtXIVQY/L07+GOJO0oZZMizNFAv/ m+JfUjBKgL8pnErZOO9MaN4HL1OZKnqXJ6xI0wjkmvirFvmpgaV+/RyA3XnAxXOCNElLIk RY1eTl0AF060/kwPcfgZjyUAYcz5LFwLf1Yn42vo8CmQ+S2bwJYB7S1lFT+xfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639098267; a=rsa-sha256; cv=none; b=kKZCiBrIMgG7ZNpe0w8JDdxpYf6ArGPuS5FLDnDu+Kg6E1wlIUpBw+PTwrTVA5KIud38cY m6kDnPAtz2HG3KZw6K4XuLpLYp75rlqnlUd6SkfbHBAZeHkPYo6h1oea/oPWOES4ZrQh5x UcVTd9avsIL47/0sBaYTokgCBRclStBKxnoyZMLJKW8uH54vm/31xOcmzscvtjI/RiYNUj Jtos0HXgv3pTODJ5eB5VysdywxLSl7Boe+uN9OQFwPOSciWq7eRmfZZthG7S/UnzC6lBeq 4Wwd2tb8js6/uLRW484DL2Pa105L3ggSm060u3+C/+5LNJ28ayw8ClCZavDinQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=911a1cc05e7618a90438178fae28c02e77cda64f commit 911a1cc05e7618a90438178fae28c02e77cda64f Author: Rick Macklem AuthorDate: 2021-11-26 23:28:40 +0000 Commit: Rick Macklem CommitDate: 2021-12-10 01:01:16 +0000 nfscl: Sanity check irdcnt in nfsrpc_createsession PR: 259996 (cherry picked from commit 22f7bcb523e7138248832fb304559c8f23276e08) --- sys/fs/nfsclient/nfs_clrpcops.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 9cfab016eecb..df3039239e59 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -4879,6 +4879,10 @@ nfsrpc_createsession(struct nfsmount *nmp, struct nfsclsession *sep, sep->nfsess_foreslots = fxdr_unsigned(uint16_t, *tl++); NFSCL_DEBUG(4, "fore slots=%d\n", (int)sep->nfsess_foreslots); irdcnt = fxdr_unsigned(int, *tl); + if (irdcnt < 0 || irdcnt > 1) { + error = NFSERR_BADXDR; + goto nfsmout; + } if (irdcnt > 0) NFSM_DISSECT(tl, uint32_t *, irdcnt * NFSX_UNSIGNED);