Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96f3c706 authored by Trond Myklebust's avatar Trond Myklebust Committed by Greg Kroah-Hartman
Browse files

NFSv4.2: Clear FATTR4_WORD2_SECURITY_LABEL when done decoding



[ Upstream commit eef7314caf2d73a94b68ba293cd105154d3a664e ]

We need to clear the FATTR4_WORD2_SECURITY_LABEL bitmap flag
irrespective of whether or not the label is too long.

Fixes: aa9c2669 ("NFS: Client implementation of Labeled-NFS")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 2672977d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4169,6 +4169,7 @@ static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap,
		p = xdr_inline_decode(xdr, len);
		if (unlikely(!p))
			return -EIO;
		bitmap[2] &= ~FATTR4_WORD2_SECURITY_LABEL;
		if (len < NFS4_MAXLABELLEN) {
			if (label) {
				if (label->len) {
@@ -4181,7 +4182,6 @@ static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap,
				label->lfs = lfs;
				status = NFS_ATTR_FATTR_V4_SECURITY_LABEL;
			}
			bitmap[2] &= ~FATTR4_WORD2_SECURITY_LABEL;
		} else
			printk(KERN_WARNING "%s: label too long (%u)!\n",
					__func__, len);