diff options
| author | Eric Dumazet <[email protected]> | 2024-12-16 08:37:03 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-12-18 01:46:17 +0000 |
| commit | b9b8301d369b4c876de5255dbf067b19ba88ac71 (patch) | |
| tree | a3c2ea4ce5b730c203b9a0e78f2f2ae28299a0e5 /drivers/net/netdevsim/netdev.c | |
| parent | qed: fix possible uninit pointer read in qed_mcp_nvm_info_populate() (diff) | |
| download | kernel-b9b8301d369b4c876de5255dbf067b19ba88ac71.tar.gz kernel-b9b8301d369b4c876de5255dbf067b19ba88ac71.zip | |
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]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/netdevsim/netdev.c')
| -rw-r--r-- | drivers/net/netdevsim/netdev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c index 0be47fed4efc..e068a9761c09 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 = { |
