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: 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:
parent
2672977dc0
commit
96f3c70600
@ -4169,6 +4169,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) {
|
||||||
@ -4181,7 +4182,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);
|
||||||
|
Loading…
Reference in New Issue
Block a user