NFSv4.2: Clear FATTR4_WORD2_SECURITY_LABEL when done decoding
[ Upstream commiteef7314caf
] We need to clear the FATTR4_WORD2_SECURITY_LABEL bitmap flag irrespective of whether or not the label is too long. Fixes:aa9c266962
("NFS: Client implementation of Labeled-NFS") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
193691ff5b
commit
58a1023eb5
@ -4166,6 +4166,7 @@ static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap,
|
|||||||
p = xdr_inline_decode(xdr, len);
|
p = xdr_inline_decode(xdr, len);
|
||||||
if (unlikely(!p))
|
if (unlikely(!p))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
bitmap[2] &= ~FATTR4_WORD2_SECURITY_LABEL;
|
||||||
if (len < NFS4_MAXLABELLEN) {
|
if (len < NFS4_MAXLABELLEN) {
|
||||||
if (label) {
|
if (label) {
|
||||||
if (label->len) {
|
if (label->len) {
|
||||||
@ -4178,7 +4179,6 @@ static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap,
|
|||||||
label->lfs = lfs;
|
label->lfs = lfs;
|
||||||
status = NFS_ATTR_FATTR_V4_SECURITY_LABEL;
|
status = NFS_ATTR_FATTR_V4_SECURITY_LABEL;
|
||||||
}
|
}
|
||||||
bitmap[2] &= ~FATTR4_WORD2_SECURITY_LABEL;
|
|
||||||
} else
|
} else
|
||||||
printk(KERN_WARNING "%s: label too long (%u)!\n",
|
printk(KERN_WARNING "%s: label too long (%u)!\n",
|
||||||
__func__, len);
|
__func__, len);
|
||||||
|
Reference in New Issue
Block a user