From nobody Thu Dec 23 01:44:11 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 98D6D191034A; Thu, 23 Dec 2021 01:44:11 +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 4JKCfM2Tn2z3sln; Thu, 23 Dec 2021 01:44:11 +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 367B427B25; Thu, 23 Dec 2021 01:44:11 +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 1BN1iBWN049998; Thu, 23 Dec 2021 01:44:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BN1iBmK049997; Thu, 23 Dec 2021 01:44:11 GMT (envelope-from git) Date: Thu, 23 Dec 2021 01:44:11 GMT Message-Id: <202112230144.1BN1iBmK049997@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: 55a60738e7af - stable/12 - 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 55a60738e7af6f388a1ac733bfcaec6d6b70d538 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640223851; 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=opgFTdFNO1Zip4sCyhYatb1POqFDAn7QrcLCWARjFWc=; b=pt8eJ/LMdZOgRk8ddw+4+MyVqscA0v4S00+TLufUnxCTU6azNhn8f4ZkpaCUFiUD83R+pi 2I58waohEECkCiTD7T0e7+zoGhDK4l9JAXx6cNcO32Q6g/SQQ0GJuhmOdNh0KmnPnzfmIb hJ2B0f+gm6sRhRRNImB9HaR39cqNS3UMdHVmDVm9LYEppdKMUg0k7wINZDWu9SivtpBdRE TzZ9QTaYRG6nCyR/BYAWET0AByHEYar4q7JagwxxOPJSNswtsLT/2MjatWmVmKB4B9lIZj xP+0axB6qLz7qvkfV70AUcjwqrI5ygNBAimpsLpmgigLRvRtdRCaZvOakRz52Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640223851; a=rsa-sha256; cv=none; b=YJNlL20TJ5EZHd0gPZK+HsLI4lva1MqB2Y3MuvVe8OQ9e5O1rTGEx3zAgGNK20IqA+S+Sg ALJ+yBZbOu2KD+bd8sutPhC8AzwANKPVqIZqbopvpvfO8e90TmrdvJHvHSW+iCofj2ALmQ 9Y4nfQSxWfVQEeLZlm07NSDixImU54joqyNbRhi3ntwabujB2yodAcmlmZ0r2DzgPjzHAA 7EbheHCaglbMGJ4GECWdOKaGARHX8TdmesmnkUbAp9N92/5u96yNtTW0jsbMuzVSM8xcuZ Hgu8DiyMDnPOpVphP2qzVIv83CT1qUOXTFGPnpw1zP2BLIJk2bqJ4xsr3Joraw== 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=55a60738e7af6f388a1ac733bfcaec6d6b70d538 commit 55a60738e7af6f388a1ac733bfcaec6d6b70d538 Author: Rick Macklem AuthorDate: 2021-12-09 22:32:22 +0000 Commit: Rick Macklem CommitDate: 2021-12-23 01:41:00 +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. PR: 260272 (cherry picked from commit ab639f2398bf7efd4dfd38cd6527e22f6e781ae9) --- 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 df3039239e59..b9f2f6e21dcf 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -2200,7 +2200,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 || @@ -7458,7 +7460,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 ||