net: netdevsim: fix nsim_pp_hold_write()
Subsystems (3)
PATCH 1/1 net: netdevsim: fix nsim_pp_hold_write()
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 <[email protected]>
Signed-off-by Eric Dumazet <[email protected]>
--- drivers/net/netdevsim/netdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/netdevsim/netdev.c +2 -2
@@ -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 = {
Signature · 1 line
2.47.1.613.gc27f4b7a9f-goog
Quoted 9 lines · Eric Dumazet
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 <[email protected]>Signed-off-by Eric Dumazet <[email protected]>
Reviewed-by Simon Horman <[email protected]>
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 11 lines · 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 <[email protected]>Signed-off-by Eric Dumazet <[email protected]>[...]
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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html