mbox series

[v2,net-next,0/3] net: device tracking improvements

Message ID 20220204224237.2932026-1-eric.dumazet@gmail.com (mailing list archive)
Headers show
Series net: device tracking improvements | expand

Message

Eric Dumazet Feb. 4, 2022, 10:42 p.m. UTC
From: Eric Dumazet <edumazet@google.com>

Main goal of this series is to be able to detect the following case
which apparently is still haunting us.

dev_hold_track(dev, tracker_1, GFP_ATOMIC);
    dev_hold(dev);
    dev_put(dev);
    dev_put(dev);              // Should complain loudly here.
dev_put_track(dev, tracker_1); // instead of here (as before this series)


v2: third patch:
  I replaced the dev_put() in linkwatch_do_dev() with __dev_put().

Eric Dumazet (3):
  ref_tracker: implement use-after-free detection
  ref_tracker: add a count of untracked references
  net: refine dev_put()/dev_hold() debugging

 include/linux/netdevice.h   | 69 ++++++++++++++++++++++++-------------
 include/linux/ref_tracker.h |  4 +++
 lib/ref_tracker.c           | 17 ++++++++-
 net/core/dev.c              |  2 +-
 net/core/link_watch.c       |  6 ++--
 5 files changed, 70 insertions(+), 28 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 5, 2022, 3:40 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Fri,  4 Feb 2022 14:42:34 -0800 you wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> Main goal of this series is to be able to detect the following case
> which apparently is still haunting us.
> 
> dev_hold_track(dev, tracker_1, GFP_ATOMIC);
>     dev_hold(dev);
>     dev_put(dev);
>     dev_put(dev);              // Should complain loudly here.
> dev_put_track(dev, tracker_1); // instead of here (as before this series)
> 
> [...]

Here is the summary with links:
  - [v2,net-next,1/3] ref_tracker: implement use-after-free detection
    https://git.kernel.org/netdev/net-next/c/e3ececfe668f
  - [v2,net-next,2/3] ref_tracker: add a count of untracked references
    https://git.kernel.org/netdev/net-next/c/8fd5522f44dc
  - [v2,net-next,3/3] net: refine dev_put()/dev_hold() debugging
    https://git.kernel.org/netdev/net-next/c/4c6c11ea0f7b

You are awesome, thank you!