From mboxrd@z Thu Jan 1 00:00:00 1970 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 EF02A2566 for ; Tue, 18 Apr 2023 12:32:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75172C4339B; Tue, 18 Apr 2023 12:32:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1681821150; bh=Eb4T2jATtws6LzdQNXtFucRx4B9oTT3CMr2YxnRi6zc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JtYIJ2BYJg1hP5+ZGpeKxyPIEOZVs+dSAz+kB/xnk/vOMOMfcjdCwBF3hPpeW+ltv 6WxxMVYZpSTuKBXtxXO2WNhmgrz4JJDOQakTAmn2h8icNine3WURvVhRW6D3b1I5KD w/QIVNV4bhZvc21HLFhOMYPZc8VRsGpqz9yeQQf4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dai Ngo , Jeff Layton , Chuck Lever , Sasha Levin Subject: [PATCH 5.10 018/124] NFSD: callback request does not use correct credential for AUTH_SYS Date: Tue, 18 Apr 2023 14:20:37 +0200 Message-Id: <20230418120310.316967798@linuxfoundation.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230418120309.539243408@linuxfoundation.org> References: <20230418120309.539243408@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Dai Ngo [ Upstream commit 7de82c2f36fb26aa78440bbf0efcf360b691d98b ] Currently callback request does not use the credential specified in CREATE_SESSION if the security flavor for the back channel is AUTH_SYS. Problem was discovered by pynfs 4.1 DELEG5 and DELEG7 test with error: DELEG5 st_delegation.testCBSecParms : FAILURE expected callback with uid, gid == 17, 19, got 0, 0 Signed-off-by: Dai Ngo Reviewed-by: Jeff Layton Fixes: 8276c902bbe9 ("SUNRPC: remove uid and gid from struct auth_cred") Signed-off-by: Chuck Lever Signed-off-by: Sasha Levin --- fs/nfsd/nfs4callback.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index af2064e36ac61..f5b7ad0847f20 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -875,8 +875,8 @@ static const struct cred *get_backchannel_cred(struct nfs4_client *clp, struct r if (!kcred) return NULL; - kcred->uid = ses->se_cb_sec.uid; - kcred->gid = ses->se_cb_sec.gid; + kcred->fsuid = ses->se_cb_sec.uid; + kcred->fsgid = ses->se_cb_sec.gid; return kcred; } } -- 2.39.2