mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
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>
This commit is contained in:
committed by
Jakub Kicinski
parent
e5d75fc20b
commit
9ba74e6c9e
@@ -8,3 +8,12 @@ config NET_DEV_REFCNT_TRACKER
|
||||
help
|
||||
Enable debugging feature to track device references.
|
||||
This adds memory and cpu costs.
|
||||
|
||||
config NET_NS_REFCNT_TRACKER
|
||||
bool "Enable networking namespace refcount tracking"
|
||||
depends on DEBUG_KERNEL && STACKTRACE_SUPPORT
|
||||
select REF_TRACKER
|
||||
default n
|
||||
help
|
||||
Enable debugging feature to track netns references.
|
||||
This adds memory and cpu costs.
|
||||
|
Reference in New Issue
Block a user