From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385409; b=Iak/QW9IRM46hXOXgvzYo2LNxl0elGIfWfhnYcKmFBkjbraNu4njTWVDHSrGvFhDXrRi F8UQboIj7sX59ydyTbe2xp3y63CW/4OE8xKRupob9hZ+PzYJMmsvUCxzv9aR3d+b1UT06 0JupDKIIuggAv4OBI8QYvFOAIH01oyshbLpnIJj+H/oXXUpdNSAcSwkN42/7/yvhj+wor nTmOOmrCOisYlUwl2ylb5F2je2ILzntn/ZC1bZYfZmZ8yPH3ETEeyCUOmSPfiJ9hBCUP+ l7EhPnYjSOixRr4Ipv2XRIGPnIeockskCnrCnxB4Bktw3bKNTgBcOR7IHzCBWBBRcNQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385409; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=xEXPnhQ0zrSjmPWs0gDE29vDGwRl0DbXUH0Y5Kdjdbo=; b=uTa/ESoXXiD6H8n27wVbCNVM8xN02H1/U1qDKo+/i5hjPMfjEc9f8nYKBccu6ZLHQDJQ T4IniQyUfzJr0mDp51KBbybh/39Q3bq9cQo1AC407cbGW+Fmp3tbqBa1TmoiJDjzccF6V 0Y0UuKv4QNrMSacQzZPfPEcWB5hnxX1Bm3+urDLjQKnKSBwDmKI4LbQeIEVaTuvenFuAl 8PumyACnBqFPP/cMsxBdgIAL7rW0mV/W6GU76JS1jMrkM1oa81PBPB2U0Ndb0+hzF9G7N zf7j35N6D998Dr78dCQ1pXmxyDN+Oh5lh4paiW5+fsCG8UYeGALko4/TYgMo8RgvJXg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yWu+65Cp; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 798E2606A322; Fri, 4 Dec 2026 11:56:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yWu+65Cp Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF4C51F000C2; Fri, 4 Dec 2026 11:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385409; bh=xEXPnhQ0zrSjmPWs0gDE29vDGwRl0DbXUH0Y5Kdjdbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yWu+65Cp1ushNyrSpYFs7Ib6ea48pJyIjYYwos3yO3dScxz4eqmwK3CFYFgAo0O/Z +RgvhjfG+E2q7jz5LgwbadOwQwuVHwODKzZqez977Z4yI/TOQRQUvo56ma4tKFxfln THodDueF1FixzpgJpTN2ABJL4/AuY6rQUmRQdvP8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ilya Maximets , Sasha Levin , Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Sridhar Samudrala , Kees Cook , Jean-Paul Sergent Subject: [PATCH 6.6 0504/1167] net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp Date: Fri, 4 Dec 2026 18:58:51 +0900 Message-ID: <20261204100715.190299091@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jean-Paul Sergent commit 74a7db839308dd7d1c3f72dd1e3299784df3affb upstream. Commit 3fcece12bc1b6 ("net: store port/representator id in metadata_dst") dropped the options_len equality check when converting skb_metadata_dst_cmp() to a type switch, so the memcmp length is taken from skb a alone. When skb b carries fewer options than a, the comparison reads past b's allocation. Hit in practice with Cilium geneve GRO aggregation, comparing an skb carrying 12 bytes of tunnel options against one carrying none: memcmp: detected buffer overflow: 108 byte read of buffer size 96 WARNING: CPU: 0 PID: 15 at lib/string_helpers.c:1036 __fortify_report __fortify_panic+0x9/0x10 skb_metadata_dst_cmp+0x11b/0x120 dev_gro_receive+0x303/0x620 gro_cell_poll+0x67/0xa0 Restore the check: unequal options_len means different metadata and no aggregation; the memcmp only runs when both sides carry the same options length. Fixes: 3fcece12bc1b6 ("net: store port/representator id in metadata_dst") Cc: stable@vger.kernel.org Cc: Ilya Maximets Cc: Sasha Levin Cc: Jakub Kicinski Cc: "David S. Miller" Cc: Eric Dumazet Cc: Paolo Abeni Cc: Simon Horman Cc: Sridhar Samudrala Cc: Kees Cook Signed-off-by: Jean-Paul Sergent Link: https://patch.msgid.link/20261109082410.206140-1-jpsergent@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman --- include/net/dst_metadata.h | 2 ++ 1 file changed, 2 insertions(+) --- a/include/net/dst_metadata.h +++ b/include/net/dst_metadata.h @@ -115,6 +115,8 @@ static inline int skb_metadata_dst_cmp(c return memcmp(&a->u.port_info, &b->u.port_info, sizeof(a->u.port_info)); case METADATA_IP_TUNNEL: + if (a->u.tun_info.options_len != b->u.tun_info.options_len) + return 1; return memcmp(&a->u.tun_info, &b->u.tun_info, sizeof(a->u.tun_info) + a->u.tun_info.options_len);