netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/neighbor: clear error in case strict check is not set
@ 2024-11-15  0:32 Jakub Kicinski
  2024-11-15 14:06 ` Simon Horman
  2024-11-19  3:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2024-11-15  0:32 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski, joel.granados

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.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: joel.granados@kernel.org
---
 net/core/neighbour.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 77b819cd995b..cc58315a40a7 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -2876,6 +2876,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];
 
-- 
2.47.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net/neighbor: clear error in case strict check is not set
  2024-11-15  0:32 [PATCH net-next] net/neighbor: clear error in case strict check is not set Jakub Kicinski
@ 2024-11-15 14:06 ` Simon Horman
  2024-11-19  3:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-11-15 14:06 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni, joel.granados

On Thu, Nov 14, 2024 at 04:32:21PM -0800, Jakub Kicinski wrote:
> 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.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: joel.granados@kernel.org

Reviewed-by: Simon Horman <horms@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net/neighbor: clear error in case strict check is not set
  2024-11-15  0:32 [PATCH net-next] net/neighbor: clear error in case strict check is not set Jakub Kicinski
  2024-11-15 14:06 ` Simon Horman
@ 2024-11-19  3:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-11-19  3:00 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni, joel.granados

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 14 Nov 2024 16:32:21 -0800 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next] net/neighbor: clear error in case strict check is not set
    https://git.kernel.org/netdev/net-next/c/0de6a472c3b3

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-11-19  3:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-15  0:32 [PATCH net-next] net/neighbor: clear error in case strict check is not set Jakub Kicinski
2024-11-15 14:06 ` Simon Horman
2024-11-19  3:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).