* [PATCH net] net: netdevsim: fix nsim_pp_hold_write()
@ 2024-12-16 8:37 Eric Dumazet
2024-12-16 17:17 ` Simon Horman
2024-12-18 2:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Eric Dumazet @ 2024-12-16 8:37 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: netdev, Simon Horman, eric.dumazet, Eric Dumazet, syzbot
nsim_pp_hold_write() has two problems:
1) It may return with rtnl held, as found by syzbot.
2) Its return value does not propagate an error if any.
Fixes: 1580cbcbfe77 ("net: netdevsim: add some fake page pool use")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
drivers/net/netdevsim/netdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
index 0be47fed4efc5664c436c91669de5d7c13ef3411..e068a9761c094e91c584d0b29a46166ec31f42d5 100644
--- a/drivers/net/netdevsim/netdev.c
+++ b/drivers/net/netdevsim/netdev.c
@@ -635,10 +635,10 @@ nsim_pp_hold_write(struct file *file, const char __user *data,
page_pool_put_full_page(ns->page->pp, ns->page, false);
ns->page = NULL;
}
- rtnl_unlock();
exit:
- return count;
+ rtnl_unlock();
+ return ret;
}
static const struct file_operations nsim_pp_hold_fops = {
--
2.47.1.613.gc27f4b7a9f-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: netdevsim: fix nsim_pp_hold_write()
2024-12-16 8:37 [PATCH net] net: netdevsim: fix nsim_pp_hold_write() Eric Dumazet
@ 2024-12-16 17:17 ` Simon Horman
2024-12-18 2:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-12-16 17:17 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S. Miller, Jakub Kicinski, Paolo Abeni, netdev,
eric.dumazet, syzbot
On Mon, Dec 16, 2024 at 08:37:03AM +0000, Eric Dumazet wrote:
> nsim_pp_hold_write() has two problems:
>
> 1) It may return with rtnl held, as found by syzbot.
>
> 2) Its return value does not propagate an error if any.
>
> Fixes: 1580cbcbfe77 ("net: netdevsim: add some fake page pool use")
> Reported-by: syzbot <syzkaller@googlegroups.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: netdevsim: fix nsim_pp_hold_write()
2024-12-16 8:37 [PATCH net] net: netdevsim: fix nsim_pp_hold_write() Eric Dumazet
2024-12-16 17:17 ` Simon Horman
@ 2024-12-18 2:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-12-18 2:00 UTC (permalink / raw)
To: Eric Dumazet; +Cc: davem, kuba, pabeni, netdev, horms, eric.dumazet, syzkaller
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 16 Dec 2024 08:37:03 +0000 you wrote:
> nsim_pp_hold_write() has two problems:
>
> 1) It may return with rtnl held, as found by syzbot.
>
> 2) Its return value does not propagate an error if any.
>
> Fixes: 1580cbcbfe77 ("net: netdevsim: add some fake page pool use")
> Reported-by: syzbot <syzkaller@googlegroups.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
>
> [...]
Here is the summary with links:
- [net] net: netdevsim: fix nsim_pp_hold_write()
https://git.kernel.org/netdev/net/c/b9b8301d369b
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-12-18 2:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-16 8:37 [PATCH net] net: netdevsim: fix nsim_pp_hold_write() Eric Dumazet
2024-12-16 17:17 ` Simon Horman
2024-12-18 2: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).