Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1404004lqd; Thu, 25 Apr 2024 14:48:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYrbn7H2CStlhAqIHWHD6ndPT2fBSvvjXjHbLkcot+fM5LC8I6/msCF1cmCLQ7eQP9Bq9sj2wL8y6dTDBOTctPDYU/8nG0RRKV/qe2AA== X-Google-Smtp-Source: AGHT+IGLZNSF6PZQzj++peIv3QQruiCC6CzBPSB4Ijrt3oNbfqAmaFCdj1Dzg6EdBLjbAtEYbmPi X-Received: by 2002:a05:6a00:14c4:b0:6ea:bb66:9448 with SMTP id w4-20020a056a0014c400b006eabb669448mr1195151pfu.22.1714081684629; Thu, 25 Apr 2024 14:48:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714081684; cv=pass; d=google.com; s=arc-20160816; b=q2Po/Q2p+3NqtJd1bLGC4zNDHt/5s/Eh2nA27R1w5bYG5UKU1BtuUNGJv+gF+f/d83 SuHsmzTzk8MKAUZ34tAuzIlKmzGJPMlUxLuRoK+mu95WbSzzXwBq60tayJ/+FivHUoga wfQmsnXF5t8YCPQ39xyO9hY6a5mQtjOpzs0/0HZ8+dxTuS+qXLimFCvHTT2gguGEReC/ n/0SEKurJSPrbupfLjMWWwJKjwJAWZmuluB7UXu3uB+ZCZvHdl4AmiyuggOOClWgMLnm 7fVsYmzRyDnqpWdMa/eyLZURsTVYDlJ0Drd4ANIuaXCYvYbgWHEYxi1l8X04XH4qUJyN 4P6A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:message-id:date:cc:to :from:subject:dkim-signature; bh=n/uXETFH1X3xUuUTIheBd0W/aYiuDUV4YZG232wMHkM=; fh=upvWlFcQYbMw2NFTFfNQwp7bT8wQR6u6u2QcDgVzlko=; b=IpZZ89oEnAiv3NHHzIJnvgfuu5p5UnxaSQl7Sfelmyl5k6OA59EsNZWw28NS3rHldZ ZY1bPV9IX5BOZdG+XRgocbcxZ/TuNC2/rba18l00SnHmn/Ayt6j5FC0fgaWl+h63z8ai QA+fkcjfzXc7PsNHio6BxnBInhV/7kS3xQeEeNg22TxdAnsYZocQ/sE5Qr+0a5y89N2j ZuRoNy83Dc/FSuq4F0EWK0r3KyYT+02MV6zLiFMzgWVPl7WzE9uJVOGziI17tnEK3SAn qTCvzrNuu4hRkl/BBd0rErW1fkQNGSIoKdaYqOHOROm9UOKM+q+7WJyaE8S8r6hBzNLF pgjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DEZoH7Ru; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-3013-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3013-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u7-20020a655c07000000b005c279da45f1si10402395pgr.566.2024.04.25.14.48.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 14:48:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3013-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DEZoH7Ru; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-3013-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3013-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1EC432874BA for ; Thu, 25 Apr 2024 21:47:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D0CC1155758; Thu, 25 Apr 2024 21:46:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DEZoH7Ru" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A209A153834 for ; Thu, 25 Apr 2024 21:46:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714081588; cv=none; b=oJQ/pn+tDfTbJ7XVgfjST3d2VSiUduHgIfBAwMUbkDEdlsbb39a4i0C8fVR0JIzhmQCshWA1VwD/r8oI0/Z3beQO1RvNEEhAAbYpByR+MgRyw3QXnsWoPuoCer5sIhyb/yakhjBsUD1T0RyeU7voheig1XnpdL/wDbWsW1CzvDs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714081588; c=relaxed/simple; bh=l19NV/eoss0o5ZtuHfwwGEyqFf6Se8O9kWzeOivWCJs=; h=Subject:From:To:Cc:Date:Message-ID:MIME-Version:Content-Type; b=c90QuodjOc8ZiP4wpK2eQLQ7FwJD/BkfhLo8WCfAP6x09Ks9pZFS89qTgH78pP/jn+481Xauc8BwIUAVS5ue4OAQ1OWo7kFuy/ICAujkPubV555/pv2k9N3RZZa8vvJEOfEUj4ra8zvQzI1Mulx/XvKv7/ogqeatD1CHYLYSp8A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DEZoH7Ru; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBB1CC2BD10; Thu, 25 Apr 2024 21:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714081588; bh=l19NV/eoss0o5ZtuHfwwGEyqFf6Se8O9kWzeOivWCJs=; h=Subject:From:To:Cc:Date:From; b=DEZoH7Ruxp1xsALWjx6iazIvhzjKlCr2EnbsQxKcAa1y2tc3lmGALHRjbVwXeRmQ8 bbPWYH1MTVuZWgWA7owD7kPxVJbHImfqZszFATRzu6GcpZq6BEqG0ffAI3+xtCSo+L ODvvWrPIh4pCQgnyP798sR/HClJRw15Eyafh5qIri3Agsio6KwlwusnbS6K+FOanvZ Ch9Z9dW0/nfK3Ux0CPnlFHixNwwMjXojJSZJnmjGedjglKiK6wU8rQyMY+6AaZPyCG euc+ahPq8u0wAjLdPkkiFF53j0nF4nqfeskmDaJ7W0pa/r4ym08Vc3DfeNURKG7ttS jBVnfAh3WZEsg== Subject: [PATCH] NFSD: Fix nfsd4_encode_fattr4() crasher From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: Scott Mayhew , Chuck Lever Date: Thu, 25 Apr 2024 17:46:26 -0400 Message-ID: <171408158627.5888.8537954061249742363.stgit@oracle-102.chuck.lever.oracle.com.nfsv4.dev> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit From: Chuck Lever Ensure that args.acl is initialized early. It is used in an unconditional call to kfree() on the way out of nfsd4_encode_fattr4(). Reported-by: Scott Mayhew Fixes: 83ab8678ad0c ("NFSD: Add struct nfsd4_fattr_args") Signed-off-by: Chuck Lever --- fs/nfsd/nfs4xdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 85d43b3249f9..ea76100e50ca 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -3544,6 +3544,7 @@ nfsd4_encode_fattr4(struct svc_rqst *rqstp, struct xdr_stream *xdr, args.exp = exp; args.dentry = dentry; args.ignore_crossmnt = (ignore_crossmnt != 0); + args.acl = NULL; /* * Make a local copy of the attribute bitmap that can be modified. @@ -3602,7 +3603,6 @@ nfsd4_encode_fattr4(struct svc_rqst *rqstp, struct xdr_stream *xdr, } else args.fhp = fhp; - args.acl = NULL; if (attrmask[0] & FATTR4_WORD0_ACL) { err = nfsd4_get_nfs4_acl(rqstp, dentry, &args.acl); if (err == -EOPNOTSUPP)