JIRA: https://issues.redhat.com/browse/RHEL-73723
Conflicts: the __netns_tracker_alloc interface has been updated upstream
b6d7c0eb2dcbd, but in RHEL the hunk for notrefcnt_tracker was not included
(See RHEL commit 3b0a87ad0e, RHEL-24101). We merge it in here. Also,
we've dropped the rds hunk, as that seems unmantained in RHEL and is missing
the path where that hunk should operate.
commit 0cafd77dcd032d1687efaba5598cf07bce85997f
Author: Eric Dumazet <edumazet@google.com>
Date: Thu Oct 20 23:20:18 2022 +0000
net: add a refcount tracker for kernel sockets
Commit ffa84b5ffb37 ("net: add netns refcount tracker to struct sock")
added a tracker to sockets, but did not track kernel sockets.
We still have syzbot reports hinting about netns being destroyed
while some kernel TCP sockets had not been dismantled.
This patch tracks kernel sockets, and adds a ref_tracker_dir_print()
call to net_free() right before the netns is freed.
Normally, each layer is responsible for properly releasing its
kernel sockets before last call to net_free().
This debugging facility is enabled with CONFIG_NET_NS_REFCNT_TRACKER=y
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Tested-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>