From nobody Thu Dec 23 01:38:15 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 C0842190EF53; Thu, 23 Dec 2021 01:38:15 +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 4JKCWW3bM0z3rmb; Thu, 23 Dec 2021 01:38:15 +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 5B58B27878; Thu, 23 Dec 2021 01:38:15 +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 1BN1cF1f037166; Thu, 23 Dec 2021 01:38:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BN1cF1U037165; Thu, 23 Dec 2021 01:38:15 GMT (envelope-from git) Date: Thu, 23 Dec 2021 01:38:15 GMT Message-Id: <202112230138.1BN1cF1U037165@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: c4ad95fb8e42 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: c4ad95fb8e4221ffcf435c4714923db7d791737b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640223495; 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=II32VSz36/vzaqVJkGwAHXzijCKF9gKL6AZ95eCshy8=; b=DYPz59wVmncWjBrsk3x8QHQNEHZuTgjre7ZodzPpuhE6qBABDRpBB6dZnVTfEg9mSRLFMV oEAfcGS3exP3Nw5XaMbTBvk8ConEb4Lphgf43rcQFEZuMXZXjuIu3Lu1V0CXvaTeNppdl1 MabJzXABfUlqmIAVkl5hxRvXiYSovoCT9r8VnvDaSy5nDOp2zggiYO3tyyP1K8uGARM0Jl +fwZc+stmuXQlJD1+AXVjvoi5oF45+ACmTnGBM61g3tgm4zYFgsaLrjYCjPvsjnixfpZYb Zl4YRKrZMJpSVRmp5jQj7hAE2gMLJ2KzuRndveN7dTxwVk5QMIaLYHNucuQdxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640223495; a=rsa-sha256; cv=none; b=bQC2PlO1kKevr/S+1AU3ZQW19AD6GcZ8Bk4T9zy1qgeXzeftT1C1vB6smwEp3Oh7UWrxsK xr2WOSLewQlz70+YGHSLRsQZmsqLf87phVZYiwRSd48mDO7ruSYUnNKksSiQDY2aF3sn1S NdmnqZ7i4TmXDwzMjCDMD68/xF11mwLd5y0insQcuW5I9UhfDN4UuFoNGcHXd2jpsGuXFG EHDefwYUR9PU5zQxWK3WEVjBKAvwmnr7n6+ntwKKHVKd/Ynae2RcDlruzssbBLGL+z1Ub6 2Hvo4gR1pIZ6gK/Jdp3EX2jhtmyOxDqPg6iP2PKmUEhrbGMLa0HCXXa3EDg5Ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c4ad95fb8e4221ffcf435c4714923db7d791737b commit c4ad95fb8e4221ffcf435c4714923db7d791737b Author: Rick Macklem AuthorDate: 2021-12-09 22:32:22 +0000 Commit: Rick Macklem CommitDate: 2021-12-23 01:34:53 +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 a87495da8568..bd2e1f24eef2 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -2267,7 +2267,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 || @@ -7908,7 +7910,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 ||