From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.179 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== 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== 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 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 ; Fri, 4 Dec 2026 15:23:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 028F0606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com 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 Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-8b5981c4834so9908757b3.2 for ; Fri, 04 Dec 2026 07:23:48 -0800 (PST) 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) 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) From: Juan Agustin Niccolini To: Sabrina Dubroca , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, Kyuwon Cho , Cosmin Ratiu , Haseeb Malik , Michael Braun , Hannes Frederic Sowa , Mark Starovoytov , Igor Russkikh 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 Message-ID: <20261204152345.9806-1-juanagusnicco@gmail.com> X-Mailer: git-send-email 2.53.0 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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