Skip to content

Commit b9b8301

Browse files
edumazetkuba-moo
authored andcommitted
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: 1580cbc ("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]>
1 parent 7ed2d91 commit b9b8301

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/netdevsim/netdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,10 +635,10 @@ nsim_pp_hold_write(struct file *file, const char __user *data,
635635
page_pool_put_full_page(ns->page->pp, ns->page, false);
636636
ns->page = NULL;
637637
}
638-
rtnl_unlock();
639638

640639
exit:
641-
return count;
640+
rtnl_unlock();
641+
return ret;
642642
}
643643

644644
static const struct file_operations nsim_pp_hold_fops = {

0 commit comments

Comments
 (0)