Skip to content

Commit 27d1764

Browse files
committed
NFSD: Clear SECLABEL in the suppattr_exclcreat bitmap
>From RFC 8881: 5.8.1.14. Attribute 75: suppattr_exclcreat > The bit vector that would set all REQUIRED and RECOMMENDED > attributes that are supported by the EXCLUSIVE4_1 method of file > creation via the OPEN operation. The scope of this attribute > applies to all objects with a matching fsid. There's nothing in RFC 8881 that states that suppattr_exclcreat is or is not allowed to contain bits for attributes that are clear in the reported supported_attrs bitmask. But it doesn't make sense for an NFS server to indicate that it /doesn't/ implement an attribute, but then also indicate that clients /are/ allowed to set that attribute using OPEN(create) with EXCLUSIVE4_1. Ensure that the SECURITY_LABEL and ACL bits are not set in the suppattr_exclcreat bitmask when they are also not set in the supported_attrs bitmask. Fixes: 8c18f20 ("nfsd41: SUPPATTR_EXCLCREAT attribute") Cc: stable@vger.kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent df8d829 commit 27d1764

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

fs/nfsd/nfs4xdr.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3375,6 +3375,11 @@ static __be32 nfsd4_encode_fattr4_suppattr_exclcreat(struct xdr_stream *xdr,
33753375
u32 supp[3];
33763376

33773377
memcpy(supp, nfsd_suppattrs[resp->cstate.minorversion], sizeof(supp));
3378+
if (!IS_POSIXACL(d_inode(args->dentry)))
3379+
supp[0] &= ~FATTR4_WORD0_ACL;
3380+
if (!args->contextsupport)
3381+
supp[2] &= ~FATTR4_WORD2_SECURITY_LABEL;
3382+
33783383
supp[0] &= NFSD_SUPPATTR_EXCLCREAT_WORD0;
33793384
supp[1] &= NFSD_SUPPATTR_EXCLCREAT_WORD1;
33803385
supp[2] &= NFSD_SUPPATTR_EXCLCREAT_WORD2;

0 commit comments

Comments
 (0)