summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2024-11-14 16:32:21 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-12-14 19:44:53 +0100
commit6978e400bf90aa2d49b43355048c1058310c0f16 (patch)
tree49c5b26698de56346c86335e9a13f8c55f2e37c1 /net
parentcf0d36cf00583b2b2a371eae0b6a617a264ab0a0 (diff)
downloadlinux-6978e400bf90aa2d49b43355048c1058310c0f16.tar.gz
linux-6978e400bf90aa2d49b43355048c1058310c0f16.tar.bz2
linux-6978e400bf90aa2d49b43355048c1058310c0f16.zip
net/neighbor: clear error in case strict check is not set
[ Upstream commit 0de6a472c3b38432b2f184bd64eb70d9ea36d107 ] Commit 51183d233b5a ("net/neighbor: Update neigh_dump_info for strict data checking") added strict checking. The err variable is not cleared, so if we find no table to dump we will return the validation error even if user did not want strict checking. I think the only way to hit this is to send an buggy request, and ask for a table which doesn't exist, so there's no point treating this as a real fix. I only noticed it because a syzbot repro depended on it to trigger another bug. Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20241115003221.733593-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/core/neighbour.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index e571007d083c..4dfe17f1a76a 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -2734,6 +2734,7 @@ static int neigh_dump_info(struct sk_buff *skb, struct netlink_callback *cb)
err = neigh_valid_dump_req(nlh, cb->strict_check, &filter, cb->extack);
if (err < 0 && cb->strict_check)
return err;
+ err = 0;
s_t = cb->args[0];