From: Juan Agustin Niccolini <juanagusnicco@gmail.com>
To: Sabrina Dubroca <sd@queasysnail.net>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, Kyuwon Cho <kyuwon.cho@skku.edu>,
Cosmin Ratiu <cratiu@nvidia.com>,
Haseeb Malik <haseebulhaq55@gmail.com>,
Paul Blakey <paulb@mellanox.com>,
Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
Yossi Kuperman <yossiku@mellanox.com>,
Jiri Pirko <jiri@resnulli.us>
Subject: [PATCH net 0/2] macvlan, macsec: fix double free of conntrack extensions by clones
Date: Thu, 3 Dec 2026 01:37:43 -0500 [thread overview]
Message-ID: <20261203063745.75353-1-juanagusnicco@gmail.com> (raw)
macvlan in source mode and macsec both have a double free of a
conntrack extension area. Each hands its own device a clone of a
received frame that keeps the original's conntrack entry, still
unconfirmed if tc act_ct attached it at the lower device's ingress.
When the clone and the original reach nftables on different CPUs, both
reallocate that entry's extension area and the old area is freed twice.
An unprivileged user can trigger both from a user and network
namespace: RPS can be enabled there for new devices through
net.core.rps_default_mask, which makes the clone run on another CPU.
This is the bug that "macvlan: drop the conntrack entry of broadcast
clones" fixes for macvlan's broadcast clones:
https://lore.kernel.org/netdev/179607207068.562302.5326868635249894085@skku.edu/
These are the other two places that deliver such clones. Both patches
drop the clone's entry, as that patch does, and apply with or without
it.
Both bugs were discovered during an LLM-based review of that patch.
Reproducers for both: https://github.com/AgusNicco/macvlan-macsec-double-free
Juan Agustin Niccolini (2):
macvlan: drop the conntrack entry of source-mode clones to fix a
double free
macsec: drop the conntrack entry of delivered clones to fix a double
free
drivers/net/macsec.c | 3 +++
drivers/net/macvlan.c | 1 +
2 files changed, 4 insertions(+)
base-commit: 5584a17feee004afa77ffb0df938011d7239de87
--
2.43.0
next reply other threads:[~2026-12-03 6:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 6:37 Juan Agustin Niccolini [this message]
2026-12-03 6:37 ` [PATCH net 1/2] macvlan: drop the conntrack entry of source-mode clones to fix a double free Juan Agustin Niccolini
2026-12-03 6:37 ` [PATCH net 2/2] macsec: drop the conntrack entry of delivered " Juan Agustin Niccolini
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=20261203063745.75353-1-juanagusnicco@gmail.com \
--to=juanagusnicco@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=cratiu@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=haseebulhaq55@gmail.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=kyuwon.cho@skku.edu \
--cc=marcelo.leitner@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=paulb@mellanox.com \
--cc=sd@queasysnail.net \
--cc=yossiku@mellanox.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