From: Stanislav Fomichev <stfomichev@gmail.com>
To: Ido Schimmel <idosch@nvidia.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, edumazet@google.com, jiri@resnulli.us,
andrew+netdev@lunn.ch, penguin-kernel@i-love.sakura.ne.jp
Subject: Re: [PATCH net v3 0/2] team: Fix reference count leak when changing port netns
Date: Tue, 24 Feb 2026 17:33:04 -0800 [thread overview]
Message-ID: <aZ5RUG7DzE--oZ9e@mini-arch> (raw)
In-Reply-To: <20260224125709.317574-1-idosch@nvidia.com>
On 02/24, Ido Schimmel wrote:
> Patch #1 fixes a reference count leak that was reported by syzkaller.
> The leak happens when a net device that is member in a team is changing
> netns. The fix is to align the team driver with the bond driver and have
> it suppress NETDEV_CHANGEMTU events for a net device that is being
> unregistered.
>
> Without this change, the NETDEV_CHANGEMTU event causes inetdev_event()
> to recreate an inet device for this net device in its original netns,
> after it was previously destroyed upon NETDEV_UNREGISTER. Later on, when
> inetdev_event() receives a NETDEV_REGISTER event for this net device in
> the new nents, it simply leaks the reference:
>
> case NETDEV_REGISTER:
> pr_debug("%s: bug\n", __func__);
> RCU_INIT_POINTER(dev->ip_ptr, NULL);
> break;
>
> addrconf_notify() handles this differently and reuses the existing inet6
> device if one exists when a NETDEV_REGISTER event is received. This
> creates a different problem where it is possible for a net device to
> reference an inet6 device that was created in a previous netns.
>
> A more generic fix that we can try in net-next is to revert the changes
> in the bond and team drivers and instead have IPv4 and IPv6 destroy and
> recreate an inet device if one already exists upon NETDEV_REGISTER.
>
> Patch #2 adds a selftest that passes with the fix and hangs without it.
>
> v3:
> - Add a selftest.
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Thanks!
next prev parent reply other threads:[~2026-02-25 1:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 12:57 [PATCH net v3 0/2] team: Fix reference count leak when changing port netns Ido Schimmel
2026-02-24 12:57 ` [PATCH net v3 1/2] team: avoid NETDEV_CHANGEMTU event when unregistering slave Ido Schimmel
2026-02-24 12:57 ` [PATCH net v3 2/2] selftests: team: Add a reference count leak test Ido Schimmel
2026-02-24 14:43 ` Jiri Pirko
2026-02-25 1:33 ` Stanislav Fomichev [this message]
2026-02-26 3:20 ` [PATCH net v3 0/2] team: Fix reference count leak when changing port netns patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aZ5RUG7DzE--oZ9e@mini-arch \
--to=stfomichev@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=idosch@nvidia.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=penguin-kernel@i-love.sakura.ne.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.