🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27000

[PATCH net v2 0/2] macvlan, macsec: fix double free of conntrack extensions by clones

#27000
From: Juan Agustin Niccolini
Date: Fri, 04 Dec 2026 15:23
44 lines
12476 bytes
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
Technical Details
Message-ID: <20261204152345.9806-1-juanagusnicco@gmail.com>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377437-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377437-linux-kernel-netdev=dewy.ru
From: juanagusnicco@gmail.com (Juan Agustin Niccolini)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2 0/2] macvlan, macsec: fix double free of conntrack extensions by clones
Date: Fri,  4 Dec 2026 10:23:43 -0500
Organization: Usenet Network
Message-ID: <20261204152345.9806-1-juanagusnicco@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2793753"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:tqdgtKjkDUIFs4U0DbH06R8c/bk= sha256:g8TQzYXQvGsgVXiuC7DA+Lju7I/QM2CGa6UhlP8XyLg=
	sha1:Kg6PZ0BhaYQa/zycDYX+Qm9eMSY= sha256:caeT4UBn1P3wwK+XGqwGx+ORexlHRFfaZNX6BZkgHb0=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 49567117C47; Fri,  4 Dec 2026 18:24:03 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.297
X-Spam-Status: No, score=-3.297 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id RcJCmoxufXgr;
	Fri,  4 Dec 2026 18:24:00 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377437-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id E8C3F117BFA; Fri,  4 Dec 2026 18:23:51 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 5836C8208E; Fri,  4 Dec 2026 15:23:50 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796397830;
	b=XF3D80M6EzjgXGvIEpPSLRw5EXKs0Qz35AYrozQBtfzHnV5av+EoZTXh4iqh7lImhozw
	 kscX04IYgwjOzNaVVxSRYwW3+pF+O1QUwpVX4l9V28Kmq+0m+m2PeI63MXv66uPwqWM45
	 I9Z2Rf+hmd1TpcNgTfhUDJGOUpKnVe3Z00rBRJdTv7xFSPtMyjuVql2p17CCbXN++0i3A
	 5g6oxqEfyMoqRaxCdR4i/uFgja9OsQKnlrdGpy6VpjxuI96c4o1eEX7kk6859Ognuldj2
	 uw3F9GB1eM2WMCJ3EVOvKf4Kp512Lb88ryCfx0jBY85sg9ViA4sWZkln0odvQMwoZcA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796397830;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
	bh=hYM/OLij2t/6wdGMxQasd7MWZN9pbeEI7yN4onL4I+s=;
	b=YtIWUyIq1L2BlD0cLN85gzbVdNkUDy8kkuwyqGVc6mvx3xP5LoZvbnApvK7+JT7NWHqR
	 2tPBZ8K2bu8J+9RpqWWHUdELb8nH8l09n70y7pT1J4u9kg7aOo2WdTGG2Xpy/CfdOFprC
	 qshd9z1LejErAiZ6k3GBE5apmawmX+BkSJ0ZR2I/5m1lPbTveJwYNOoPn/Mci3UUnd9Vy
	 lR5e3T29oX7TifKthWuduLmojVDL2d8sLsTNU0JgUcQPI9W+yd3+PX+YRUXfaPXDL27f2
	 q44t5DL8fF7EOvZ49bJk0dnIWoV8uBIxuM18nUjspxwSD40R8pOZQLCdgshiE4ldiwQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=O16wvze5;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 30B2B606A333;
	Fri,  4 Dec 2026 15:23:50 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=O16wvze5
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.179
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796397829;
	b=vSo+BG8POXurYh+jYxVqm6pz2u+hJpEBBXF8pEGTFNx7m5BCT20rtgk3W+/tS/nW2LLn
	 6FTNVcx9Lm6SF0T2KyijSfLBj4cnyWT2TQyI7alPIULJnDf1GQEUvRbgHLSjGym/gthSj
	 38r4IToh1iXSPwtt9YcEZWA5Vt9LiFl3BlkyQV9nNf7SwbU+pXmED9e1+iAibMiyFCERF
	 Zt6wTktgAppDTcu6sMQs42OQLTFAznlBUrQXbbou0/WwvObKvlaGv5HsAbdke9zhJ5PPB
	 KxnNUFAB665NfLchVRdeqjgReALYB5YtLHZEe7aXfC+bVKvk8VDt0ikKK883B5MTGYw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796397829;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding;
	bh=hYM/OLij2t/6wdGMxQasd7MWZN9pbeEI7yN4onL4I+s=;
	b=tfDOtg70iMFXYbSt/KmKtXtDfdTSkBjC67SIlfhyN1qrx2i6FPFQrp/G58Zp7VeBsREU
	 Oozc7OFZgvksiOvdIqlfU5OyXp9KZnUr/vmi1/6iRhg0Oc06YS4cfIkt2ahhu+xQ0DwVl
	 WbqCvfWTmL0hfQSGkNLPzrGs0bW3D9J17zmdVoMVFa4gNRcw7TWJh5/vxB+TM84Yp/wNX
	 oPWYGzvjqej7FTmf5sFH7uEPPx9S8hMj8c5vCv5YFPmgh9QNG5XU0A5xxoXNA4LNE40vr
	 Rpkp265Z9CwcfLOnjvtI2scA2tDbwkrymMpdIP2yZrVxRjdPKyMfXo3fewZG1PNXi/g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=O16wvze5;
	arc=none smtp.remote-ip=209.85.128.179
X-Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 028F0606A322
	for <netdev@vger.kernel.org>; Fri,  4 Dec 2026 15:23:48 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 028F0606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-8b5981c4834so9908757b3.2
        for <netdev@vger.kernel.org>; Fri, 04 Dec 2026 07:23:48 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1796397828; x=1797002628; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=hYM/OLij2t/6wdGMxQasd7MWZN9pbeEI7yN4onL4I+s=;
        b=O16wvze51s/iJcgXSKJe53AIssYb0Zt/HP8p5kL08h8YY57842Qs96gqbOgBGJodf7
         aVADXx6kbWWnrs5zUjCHPZnhkTmT+mDdwij/gBiuSnH2asrfbZq9bh1d1sTmUjBRe5DM
         o93QhgoX10mGCq32mtdNN7XpDAfn1+C73joRC8ycStnav7wLuArPS/vUCWIN+p3tytAS
         kt0UtR084FWFGPaHwyr4o/BtFXQHYaGKcsckor5S1SXUsm1G4coBC0LQemyVUsuna47W
         kG8n/FVxu/siS+ydkhIRr2874tZfbCW0nKXrttQSs0lMKypPByhTClqIohxDfhz8cacR
         ZrAQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796397828; x=1797002628;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=hYM/OLij2t/6wdGMxQasd7MWZN9pbeEI7yN4onL4I+s=;
        b=M8VEo7RWX5gQr/GXMy/zudFy79uYGcN3Y2GOHJwBG1WdWTP+eKytvddeJGlOJuHXdp
         M4SdfhBp0hoSen1ou/VEKZuzApCEKKPULRpePVKFJ2g6y4cHkCcPz4I/J9MXjAbVaFVy
         kW1A4176+YEzclM1xwuWool4OIup2m/mth3yfMODmm5RaDWoqEa4Sh8qq4N8hNeoFu7v
         3yPSitxrpnz68B44rw3z4xENiHWL6S3exj8Q9J+azxFpPdM6q+6FQF2uROcqaeSnEolF
         acHgwCXB9pm152a9H3QVht1MzBxovPUkJHjdXKHKs5KE5QCAQQTi3q1Cp5+3nV+1Ngn+
         I9lw==
X-Gm-Message-State: AB4q+uFFEvHRdI+BpdvhTgNq0S05+A8VGg7pLlrZ8sdfq31IotaVPy7v
	jVn77L64nc9ToB4rymxLlo1Z3tQH+o9xgLaWCdewcmBt1RixFfEfT2Tr
X-Gm-Gg: AZFdTZf5LCu/JBWVWOmfM6H+BKqR0TU+IroF418ZvGs2IUSBRnvrG3QTtOAUXfVhTq1
	OE6e/te+GMLWL6DyjlfNfQRhgxQ5ESuL+fE+NdyPnexHwD1Sc0sHMJVdxKfqua/Avqe7fy6fj32
	GN+YGpX1S2+P9HxxG+5Gjh9iC4e0gkFjxc1+VAlcDPep4Mvn8wFdrHzBgJNlMT/iCQAJPG4FC/O
	/spaRZI5SpKQsdATZ5hfEpMe3wfY5J+IcwgFs8g1k7ZUllDBy1k5VYf34Ihk7C1Toj1GH11UHM3
	c83uzgmgnShrPkgJJfSzX/3wkmTb094gkqvBrAxg9FMiUkc8SQzqMI6smThMwsYANOfNHDcENyp
	mgd2zP3492+ZpBKcoHhyKwoZemBY6f67C7ryCUWpE80wzNSU6Ma7ZvLGgcqnvhvhnHB0A2+sAUx
	B1MvMqgWA6nZUug0kWiQGwS65GDrKI9jV2Ly0X8I0l6aKntCwEJ4uY0XHOCcJEs7Am+4Jv8PKTu
	bhvyBoJ59L+TS36UUNwxEXZg/blLIIetcEiRd9gGzb+tOc3epoe1hibopqw/6B/rHvnPN86+M5b
	63y3M4Ao0vlCro88GvTp8Diw4a6lrmbXsHDO58IE32uvM+qR6pLAqL2lQVvbc6Mny2MfX6NLXZ2
	lxeykbBc=
X-Received: by 2002:a05:690c:449:b0:8b4:d8c6:4d9c with SMTP id 00721157ae682-8b660d4e9b7mr14358127b3.34.1796397827871;
        Fri, 04 Dec 2026 07:23:47 -0800 (PST)
X-Received: from eduroam-226-233-197.laptops.usf.edu ([131.247.226.233])
        by smtp.gmail.com with ESMTPSA id 956f58d0204a3-67f0cd04b79sm1230396d50.10.2026.12.04.07.23.46
        (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
        Fri, 04 Dec 2026 07:23:47 -0800 (PST)
X-Cc: netdev@vger.kernel.org,
	Kyuwon Cho <kyuwon.cho@skku.edu>,
	Cosmin Ratiu <cratiu@nvidia.com>,
	Haseeb Malik <haseebulhaq55@gmail.com>,
	Michael Braun <michael-dev@fami-braun.de>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>,
	Mark Starovoytov <mstarovo@pm.me>,
	Igor Russkikh <irusskikh@marvell.com>
X-Mailer: git-send-email 2.53.0
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list