<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/Kconfig.debug, branch v5.17</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.17</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.17'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2021-12-10T14:38:26Z</updated>
<entry>
<title>net: add networking namespace refcount tracker</title>
<updated>2021-12-10T14:38:26Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2021-12-10T07:44:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9ba74e6c9e9d0c5c1e5792a7111fc7d1a0589cb8'/>
<id>urn:sha1:9ba74e6c9e9d0c5c1e5792a7111fc7d1a0589cb8</id>
<content type='text'>
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 &lt;edumazet@google.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: add net device refcount tracker infrastructure</title>
<updated>2021-12-07T00:05:07Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2021-12-05T04:21:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4d92b95ff2f95f13df9bad0b5a25a9f60e72758d'/>
<id>urn:sha1:4d92b95ff2f95f13df9bad0b5a25a9f60e72758d</id>
<content type='text'>
net device are refcounted. Over the years we had numerous bugs
caused by imbalanced dev_hold() and dev_put() calls.

The general idea is to be able to precisely pair each decrement with
a corresponding prior increment. Both share a cookie, basically
a pointer to private data storing stack traces.

This patch adds dev_hold_track() and dev_put_track().

To use these helpers, each data structure owning a refcount
should also use a "netdevice_tracker" to pair the hold and put.

netdevice_tracker dev_tracker;
...
dev_hold_track(dev, &amp;dev_tracker, GFP_ATOMIC);
...
dev_put_track(dev, &amp;dev_tracker);

Whenever a leak happens, we will get precise stack traces
of the point dev_hold_track() happened, at device dismantle phase.

We will also get a stack trace if too many dev_put_track() for the same
netdevice_tracker are attempted.

This is guarded by CONFIG_NET_DEV_REFCNT_TRACKER option.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
</feed>
