]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:07 +0000 (11:41 +0100)
commitec5bd580890b684291498bc28b94fcbc7d8712b0
tree85f56fbb6a4ceb9e29393bcc5c98e6ad2776f0c0
parent3d867fcbfd7907e753fb7e0c62ef3dbff2c1754e
NFSv4.2: Fix a memory stomp in decode_attr_security_label

[ Upstream commit 43c1031f7110967c240cb6e922adcfc4b8899183 ]

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

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