NFSv4.2: Fix a memory stomp in decode_attr_security_label
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 18 Oct 2022 22:21:14 +0000 (18:21 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 28 Nov 2022 03:09:59 +0000 (22:09 -0500)
commit43c1031f7110967c240cb6e922adcfc4b8899183
treeb03042f640eaebcb4c680a7c2d415c1a677ff7b1
parentc8a62f440229ae7a10874776344dfcc17d860336
NFSv4.2: Fix a memory stomp in decode_attr_security_label

We must not change the value of label->len if it is zero, since that
indicates we stored a label.

Fixes: b4487b935452 ("nfs: Fix getxattr kernel panic and memory overflow")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs4xdr.c