diff options
author | Eric Dumazet <edumazet@google.com> | 2021-03-22 11:21:45 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-22 16:57:36 -0700 |
commit | add2d73631070c951b0de81a01d1463a15cfbd47 (patch) | |
tree | 17f432ad418341482f02ec52ef9daacc01e0ee77 /tools | |
parent | 0ca99c84df6b589b4673460c48ac4064181098cc (diff) |
net: set initial device refcount to 1
When adding CONFIG_PCPU_DEV_REFCNT, I forgot that the
initial net device refcount was 0.
When CONFIG_PCPU_DEV_REFCNT is not set, this means
the first dev_hold() triggers an illegal refcount
operation (addition on 0)
refcount_t: addition on 0; use-after-free.
WARNING: CPU: 0 PID: 1 at lib/refcount.c:25 refcount_warn_saturate+0x128/0x1a4
Fix is to change initial (and final) refcount to be 1.
Also add a missing kerneldoc piece, as reported by
Stephen Rothwell.
Fixes: 919067cc845f ("net: add CONFIG_PCPU_DEV_REFCNT")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Guenter Roeck <groeck@google.com>
Tested-by: Guenter Roeck <groeck@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions