From: Trond Myklebust Date: Sun, 26 Jan 2020 22:31:13 +0000 (-0500) Subject: NFSv4: pnfs_roc() must use cred_fscmp() to compare creds X-Git-Tag: v5.5.4~89 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1dfa1b86f1292ad41f69589dba5bcbb2b6bc57a8;p=users%2Fdwmw2%2Flinux.git NFSv4: pnfs_roc() must use cred_fscmp() to compare creds commit 387122478775be5d9816c34aa29de53d0b926835 upstream. When comparing two 'struct cred' for equality w.r.t. behaviour under filesystem access, we need to use cred_fscmp(). Fixes: a52458b48af1 ("NFS/NFSD/SUNRPC: replace generic creds with 'struct cred'.") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 3ac6b4dea72d3..542ea8dfd1bc7 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1425,7 +1425,7 @@ retry: /* lo ref dropped in pnfs_roc_release() */ layoutreturn = pnfs_prepare_layoutreturn(lo, &stateid, &iomode); /* If the creds don't match, we can't compound the layoutreturn */ - if (!layoutreturn || cred != lo->plh_lc_cred) + if (!layoutreturn || cred_fscmp(cred, lo->plh_lc_cred) != 0) goto out_noroc; roc = layoutreturn;