From nobody Thu Dec 09 22:35:34 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 B5B5918E0BDB; Thu, 9 Dec 2021 22:35:34 +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 4J984k3L3Fz3p1l; Thu, 9 Dec 2021 22:35:34 +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 52CDB751D; Thu, 9 Dec 2021 22:35:34 +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 1B9MZYCq040834; Thu, 9 Dec 2021 22:35:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B9MZYIg040833; Thu, 9 Dec 2021 22:35:34 GMT (envelope-from git) Date: Thu, 9 Dec 2021 22:35:34 GMT Message-Id: <202112092235.1B9MZYIg040833@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: ab639f2398bf - main - nfscl: Check for an error return from nfsrv_getattrbits() 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/main X-Git-Reftype: branch X-Git-Commit: ab639f2398bf7efd4dfd38cd6527e22f6e781ae9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639089334; 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=PXgys8aDbmnB+TruUBLJ+S58sTb4kmB9fh0rZcL4o9E=; b=ZFafTr/c4bZ4/j7/5Geu95JLPJEFDA0rp5bIuam0Ame+I0nXQ5TtRRDzGWzTx2p/mcreTd hPKG09peYPhe5/tnSO26RXOLdhN3F4x/MjJabjwT3lBQDJNUaFMTUmgoidkv2eg400IeL6 TBI+Ka9IiTmo/afTuJwPWiFTeHuNoJ0fobOOuEiFBv1bheWNvv91ntkJjtsGqNIyLBaFQA dzpiQnjdJ7zL4oTpi65I9QxyadJ+BWhxvBnJoHFi/BYzJ4Pjncs7rXlsGaMpDsH1+CJzAp wc423COvvhdVqtGLoU40h/l8PfZpIaETwAmkFqQrYeMYRSogI5iWqddBNv3OAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639089334; a=rsa-sha256; cv=none; b=n3WINS4RYuMnjBOkPNk2LHUr4SJw+G1o3+Abf9Ruvyyi3Kr0rBnwxeybbOpbND2tzatmuK cE0R2miJhIBlUspzkwM5R2tJo1Cz975lQ2hMMaUvNZpxHVuZvUN1D/A6D/21mGjC5KAEaF mLCakmqSXy/oClHMWNxE1dfn0oQgDxWTDLHxDWh/BveibXgT+XZulm9JnPH2uru1DtZx9m avKlsRk2/Tc/MsKIDZUw3cmsqSzWU9ybVYK5dyVJodzWP0wt4kWLMX2IjvGnbxUpkbv0DO mZaKaqoRWcW4aK40qTgNOT/Dgu7H9doAm5AKqJKn7xc9iFlBvT28vxiZNHUx3w== 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=ab639f2398bf7efd4dfd38cd6527e22f6e781ae9 commit ab639f2398bf7efd4dfd38cd6527e22f6e781ae9 Author: Rick Macklem AuthorDate: 2021-12-09 22:32:22 +0000 Commit: Rick Macklem CommitDate: 2021-12-09 22:32:22 +0000 nfscl: Check for an error return from nfsrv_getattrbits() There were two places where the client code did not check for a parse error return from nfsrv_getattrbits(). This patch fixes both of these cases. Reported by: rtm@lcs.mit.edu Tested by: rtm@lcs.mit.edu PR: 260272 MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clrpcops.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 7646c1b404da..08bfac3575f7 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -2513,7 +2513,9 @@ nfsrpc_createv4(vnode_t dvp, char *name, int namelen, struct vattr *vap, stateid.other[1] = *tl++; stateid.other[2] = *tl; rflags = fxdr_unsigned(u_int32_t, *(tl + 6)); - (void) nfsrv_getattrbits(nd, &attrbits, NULL, NULL); + error = nfsrv_getattrbits(nd, &attrbits, NULL, NULL); + if (error) + goto nfsmout; NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); deleg = fxdr_unsigned(int, *tl); if (deleg == NFSV4OPEN_DELEGATEREAD || @@ -8154,7 +8156,9 @@ nfsrpc_createlayout(vnode_t dvp, char *name, int namelen, struct vattr *vap, stateid.other[0] = *tl++; stateid.other[1] = *tl++; stateid.other[2] = *tl; - nfsrv_getattrbits(nd, &attrbits, NULL, NULL); + error = nfsrv_getattrbits(nd, &attrbits, NULL, NULL); + if (error != 0) + goto nfsmout; NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); deleg = fxdr_unsigned(int, *tl); if (deleg == NFSV4OPEN_DELEGATEREAD ||