Netdev List
 help / color / mirror / Atom feed
* [PATCH net v2 0/2] macvlan, macsec: fix double free of conntrack extensions by clones
@ 2026-12-04 15:23 Juan Agustin Niccolini
  2026-12-04 15:23 ` [PATCH net v2 1/2] macvlan: drop the conntrack entry of source-mode clones to fix a double free Juan Agustin Niccolini
  2026-12-04 15:23 ` [PATCH net v2 2/2] macsec: drop the conntrack entry of delivered " Juan Agustin Niccolini
  0 siblings, 2 replies; 3+ messages in thread
From: Juan Agustin Niccolini @ 2026-12-04 15:23 UTC (permalink / raw)
  To: Sabrina Dubroca, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni
  Cc: netdev, Kyuwon Cho, Cosmin Ratiu, Haseeb Malik, Michael Braun,
	Hannes Frederic Sowa, Mark Starovoytov, Igor Russkikh

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, which is
still unconfirmed if tc act_ct attached it at the lower device's
ingress, or if the lower device is a bridge and conntrack ran on the
bridge for a frame to the host. 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

v2:
- Fixes tags cite the commits that added the clones instead of act_ct
  (Sashiko)
- say that conntrack on a bridge also leaves the entry unconfirmed
v1: https://lore.kernel.org/netdev/20261203063745.75353-1-juanagusnicco@gmail.com/

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: e9d78fc6741ac06d438cf64e314c28e57014432a
-- 
2.53.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-04 15:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 15:23 [PATCH net v2 0/2] macvlan, macsec: fix double free of conntrack extensions by clones Juan Agustin Niccolini
2026-12-04 15:23 ` [PATCH net v2 1/2] macvlan: drop the conntrack entry of source-mode clones to fix a double free Juan Agustin Niccolini
2026-12-04 15:23 ` [PATCH net v2 2/2] macsec: drop the conntrack entry of delivered " Juan Agustin Niccolini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox