From nobody Fri Nov 26 23:32:07 2021 X-Original-To: dev-commits-src-main@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 11AD718AC38E; Fri, 26 Nov 2021 23:32:08 +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 4J19xz5k5bz3hqN; Fri, 26 Nov 2021 23:32:07 +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 A44661193B; Fri, 26 Nov 2021 23:32:07 +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 1AQNW7Zd036039; Fri, 26 Nov 2021 23:32:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AQNW7kL036038; Fri, 26 Nov 2021 23:32:07 GMT (envelope-from git) Date: Fri, 26 Nov 2021 23:32:07 GMT Message-Id: <202111262332.1AQNW7kL036038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 22f7bcb523e7 - main - nfscl: Sanity check irdcnt in nfsrpc_createsession List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 22f7bcb523e7138248832fb304559c8f23276e08 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637969527; 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=60eVjEps9jbjj8SiH2i8IWLZcVSgckrnVZi/IYFOaC4=; b=Jgqt34h/oNTuafXZrMOO08bvM8W4+LgUS6PfaeWMb6DUZrMfsj9CbirLlc/CHGBd5SAwO5 RQYAtWCNAbCaCCRrR77KZY/Kpywast3RWwwu684weo+VVxqtOiNc0vvfXowCDanCv24ZIw b2flLCKX3gtp6O/h96aD88YiQOU8A4zxXkXI38weqcQO+RhKvfp93n6avRuBXy5gdDKAFy TuoCTbQpLThmxh0n9Xa/NkWXVCHqNczPl+DuYW7gq5FEyOM5wehDZtU43hnQTPv8TDXRyy dUR1J+DPr6kArpFxA2RyKp4ZIdQHQ2h45eO6+AUi0R/K/ynM1wjrtPwNVdSe9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637969527; a=rsa-sha256; cv=none; b=HrsSrjtZafHaYcsWQu3ZZUVJ7v7tvWdIkT9uo0C2IJvQMd8R+0FUMaTEVA0wkFCMnIz1AE M0q1ti0SuT/9Sgk7W6bl0UcSkKvyQbyqI8prjKDCKu0JKjnxMohz1WgO9zsX0bjcYNEI3c F3XOLUB0jh3IFM9/i3QaZseI2hQpIaJj18Rk1ySYZuIloDZwvtcxKM7ytqp4Sz9h1vD5zR Jl/Jz22g5pKuEJ3q7+a7twiIYX3OGdEnIkG/iK3EvvKQtoiw5My78ZMtgd4bIBhbgUUVIB lUs3eKFwrKXqnzOYHhyaLPOAixIEC+hWSll90I1rYstP1poB2cbGR+sr6MtIpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=22f7bcb523e7138248832fb304559c8f23276e08 commit 22f7bcb523e7138248832fb304559c8f23276e08 Author: Rick Macklem AuthorDate: 2021-11-26 23:28:40 +0000 Commit: Rick Macklem CommitDate: 2021-11-26 23:28:40 +0000 nfscl: Sanity check irdcnt in nfsrpc_createsession Reported by: rtm@lcs.mit.edu Tested by: rtm@lcs.mit.edu PR: 259996 MFC after: 2 weeks --- 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 f520743e8c32..7646c1b404da 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -5233,6 +5233,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);