Skip to content

net: netns refcount tracking, base series

Eric Dumazet netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 0 repliesApplied 6/6
  2. v117 patches 2 repliesSuperseded

Patches in v2 All 6 applied

#Subject and filesSizeRepliesApplied
1/6net: add networking namespace refcount trackerinclude/linux/netdevice.h include/net/net_namespace.h include/net/net_trackers.h +2 more+65 -80 repliesApplied
2/6net: add netns refcount tracker to struct sockinclude/net/sock.h net/core/sock.c+5 -30 repliesApplied
3/6net: add netns refcount tracker to struct seq_net_privatefs/proc/proc_net.c include/linux/seq_file_net.h+18 -40 repliesApplied
4/6net: sched: add netns refcount tracker to struct tcf_extsinclude/net/pkt_cls.h+6 -20 repliesApplied
5/6l2tp: add netns refcount tracker to l2tp_dfs_seq_datanet/l2tp/l2tp_debugfs.c+5 -40 repliesApplied
6/6ppp: add netns refcount trackerdrivers/net/ppp/ppp_generic.c+3 -20 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH V2 net-next 0/6] net: netns refcount tracking, base series

From: Eric Dumazet <[email protected]>

We have 100+ syzbot reports about netns being dismantled too soon, still unresolved as of today.

We think a missing get_net() or an extra put_net() is the root cause.

In order to find the bug(s), and be able to spot future ones, this patch adds CONFIG_NET_NS_REFCNT_TRACKER and new helpers to precisely pair all put_net() with corresponding get_net().

To use these helpers, each data structure owning a refcount should also use a "netns_tracker" to pair the get() and put().

Small sections of codes where the get()/put() are in sight do not need to have a tracker, because they are short lived, but in theory it is also possible to declare an on-stack tracker.

v2: Include core networking patches only.

Eric Dumazet (6):
net: add networking namespace refcount tracker
net: add netns refcount tracker to struct sock
net: add netns refcount tracker to struct seq_net_private
net: sched: add netns refcount tracker to struct tcf_exts
l2tp: add netns refcount tracker to l2tp_dfs_seq_data
ppp: add netns refcount tracker

 drivers/net/ppp/ppp_generic.c |  5 +++--
 fs/proc/proc_net.c            | 19 ++++++++++++++++---
 include/linux/netdevice.h     |  9 +--------
 include/linux/seq_file_net.h  |  3 ++-
 include/net/net_namespace.h   | 34 ++++++++++++++++++++++++++++++++++
 include/net/net_trackers.h    | 18 ++++++++++++++++++
 include/net/pkt_cls.h         |  8 ++++++--
 include/net/sock.h            |  2 ++
 net/Kconfig.debug             |  9 +++++++++
 net/core/net_namespace.c      |  3 +++
 net/core/sock.c               |  6 +++---
 net/l2tp/l2tp_debugfs.c       |  9 +++++----
 12 files changed, 102 insertions(+), 23 deletions(-)
 create mode 100644 include/net/net_trackers.h
Signature · 1 line
2.34.1.173.g76aa8bc2d0-goog