aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2021-12-09 23:44:21 -0800
committerJakub Kicinski <kuba@kernel.org>2021-12-10 06:38:26 -0800
commit9ba74e6c9e9d0c5c1e5792a7111fc7d1a0589cb8 (patch)
tree0984bfcc460de30d23f22d4230992964496199da /include/linux/netdevice.h
parente5d75fc20b9278d07731f69e327adf16227813a6 (diff)
downloadlinux-9ba74e6c9e9d0c5c1e5792a7111fc7d1a0589cb8.tar.gz
net: add networking namespace refcount tracker
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. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 1a748ee9a421a7..235d5d082f1a44 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -48,7 +48,7 @@
#include <uapi/linux/pkt_cls.h>
#include <linux/hashtable.h>
#include <linux/rbtree.h>
-#include <linux/ref_tracker.h>
+#include <net/net_trackers.h>
struct netpoll_info;
struct device;
@@ -300,13 +300,6 @@ enum netdev_state_t {
__LINK_STATE_TESTING,
};
-
-#ifdef CONFIG_NET_DEV_REFCNT_TRACKER
-typedef struct ref_tracker *netdevice_tracker;
-#else
-typedef struct {} netdevice_tracker;
-#endif
-
struct gro_list {
struct list_head list;
int count;