diff options
author | Eric Dumazet <edumazet@google.com> | 2021-03-29 22:25:22 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-30 02:31:51 +0300 |
commit | 6289a98f0817a4a457750d6345e754838eae9439 (patch) | |
tree | 2b7c7464b157ec0f70f96daa5e4f1320ff540561 /samples/bpf/tcp_tos_reflect_kern.c | |
parent | 40cb881b5aaa0b69a7d93dec8440d5c62dae299f (diff) | |
download | linux-6289a98f0817a4a457750d6345e754838eae9439.tar.xz |
sit: proper dev_{hold|put} in ndo_[un]init methods
After adopting CONFIG_PCPU_DEV_REFCNT=n option, syzbot was able to trigger
a warning [1]
Issue here is that:
- all dev_put() should be paired with a corresponding prior dev_hold().
- A driver doing a dev_put() in its ndo_uninit() MUST also
do a dev_hold() in its ndo_init(), only when ndo_init()
is returning 0.
Otherwise, register_netdevice() would call ndo_uninit()
in its error path and release a refcount too soon.
Fixes: 919067cc845f ("net: add CONFIG_PCPU_DEV_REFCNT")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/bpf/tcp_tos_reflect_kern.c')
0 files changed, 0 insertions, 0 deletions