From: Paolo Abeni <pabeni@redhat.com>
To: Jakub Kicinski <kuba@kernel.org>,
Fernando Fernandez Mancera <fmancera@suse.de>,
Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Simon Horman <horms@kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
netdev@vger.kernel.org, eric.dumazet@gmail.com,
syzbot+456957213f32970c0762@syzkaller.appspotmail.com
Subject: Re: [PATCH net] net: hsr: fix memory leak on slave unregistration by removing synced VLANs
Date: Tue, 21 Jul 2026 10:59:24 +0200 [thread overview]
Message-ID: <0db18429-58f5-46de-8cb4-0a934ff4d650@redhat.com> (raw)
In-Reply-To: <20260720181259.4e5f976f@kernel.org>
On 7/21/26 3:12 AM, Jakub Kicinski wrote:
> On Tue, 14 Jul 2026 22:45:24 +0200 Fernando Fernandez Mancera wrote:
>>> When an HSR master device is brought UP, it auto-adds VLAN 0 via
>>> vlan_vid0_add(), which propagates VID 0 to its slave devices.
>>>
>>> If a slave device is later unregistered while HSR is active (e.g., during
>>> netns cleanup or interface destruction), hsr_del_port() is called to
>>> detach the slave port from the HSR master. However, hsr_del_port() currently
>>> does not delete the VLAN IDs that were synced to the slave device by HSR.
>>>
>>> As a result, the slave device retains a refcount on VID 0 (and any other
>>> synced VLANs). When the slave device is destroyed, its vlan_info /
>>> vlan_vid_info structure remains allocated, leading to a memory leak.
>>>
>>> Fix this by calling vlan_vids_del_by_dev(port->dev, master->dev) in
>>> hsr_del_port() before unlinking the slave device, matching the cleanup
>>> behavior in bonding and team drivers.
>>>
>>> Fixes: 1a8a63a5305e ("net: hsr: Add VLAN CTAG filter support")
>>> Reported-by: syzbot+456957213f32970c0762@syzkaller.appspotmail.com
>>> Closes: https://lore.kernel.org/netdev/6a4cb6ca.57639fcc.86d58.000b.GAE@google.com/T/#u
>>> Signed-off-by: Eric Dumazet <edumazet@google.com>
>>
>> Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
>
> Just to confirm - is the sashiko review a false positive?
> https://sashiko.dev/#/patchset/20260707082327.3238690-1-edumazet%40google.com
I'm sorry, meanwhile PW archived the patch; a repost is needed.
Thanks,
Paolo
next prev parent reply other threads:[~2026-07-21 8:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 8:23 [PATCH net] net: hsr: fix memory leak on slave unregistration by removing synced VLANs Eric Dumazet
2026-07-07 11:38 ` Felix Maurer
2026-07-14 20:45 ` Fernando Fernandez Mancera
2026-07-21 1:12 ` Jakub Kicinski
2026-07-21 8:59 ` Paolo Abeni [this message]
2026-07-21 10:05 ` Eric Dumazet
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=0db18429-58f5-46de-8cb4-0a934ff4d650@redhat.com \
--to=pabeni@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=fmancera@suse.de \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=syzbot+456957213f32970c0762@syzkaller.appspotmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox