From: Nikolay Aleksandrov <razor@blackwall.org>
To: netdev@vger.kernel.org
Cc: idosch@nvidia.com, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
petrm@mellanox.com, vladimir.oltean@nxp.com,
bridge@lists.linux.dev, Nikolay Aleksandrov <razor@blackwall.org>
Subject: [PATCH net 0/2] net: bridge: vlan: fix memory leak & null pointer deref
Date: Fri, 11 Sep 2026 13:06:43 +0300 [thread overview]
Message-ID: <20260911100645.1360386-1-razor@blackwall.org> (raw)
Hi,
These are two issues I found while reworking the bridge vlan fast-path.
I need to fix them before I can post my larger patch-sets because they
will make these bugs more visible and easy to trigger.
Patch 01 fixes memory leaks on the vlan flush path (teardown). These have
existed since I converted the VLAN code to use rhashtables, but are hard
to hit because they require __vlan_vid_del or switch dev error to hit.
It is ok to abort vlan deletion when removing a single vlan, but we must
free their resources on teardown otherwise they're left dangling.
Patch 02 fixes a NULL pointer deref that is a consequence of patch 01's
bug. If the vlan delete fails when removing a bridge device vlan, the
error printing will try to dereference the port which is NULL.
Thanks,
Nik
Nikolay Aleksandrov (2):
net: bridge: vlan: fix leaks on switchdev deletion errors
net: bridge: vlan: avoid NULL dereference on flush errors
net/bridge/br_vlan.c | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
--
2.47.3
next reply other threads:[~2026-09-11 10:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-11 10:06 Nikolay Aleksandrov [this message]
2026-09-11 10:06 ` [PATCH net 1/2] net: bridge: vlan: fix leaks on switchdev deletion errors Nikolay Aleksandrov
2026-09-11 10:06 ` [PATCH net 2/2] net: bridge: vlan: avoid NULL dereference on flush errors Nikolay Aleksandrov
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=20260911100645.1360386-1-razor@blackwall.org \
--to=razor@blackwall.org \
--cc=bridge@lists.linux.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@mellanox.com \
--cc=vladimir.oltean@nxp.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