🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #22804

[PATCH net] geneve: fix out-of-bounds read in the DF inherit path

#22804
From: Xiang Mei
Date: Wed, 25 Nov 2026 23:55
59 lines
12402 bytes
The GENEVE_DF_INHERIT branch of geneve_xmit_skb() decides the inner
packet is IPv4 from skb_eth_hdr(skb)->h_proto and then reads
ip_hdr(skb)->frag_off, but skb_vlan_inet_prepare() only pulled an IPv4
header if skb_protocol(skb, true) is ETH_P_IP. For AF_PACKET/SOCK_RAW the
two are independent: a 14-byte frame with h_proto 0x0800 sent with
sll_protocol ETH_P_ARP passes the pull with only ETH_HLEN and the DF test
reads 6 bytes past skb->tail. The stale tailroom bit is copied into the
outer IPv4 DF bit on the wire, leaking one bit of slab memory per packet
to a user holding CAP_NET_ADMIN/CAP_NET_RAW in a user namespace. With
inner_proto_inherit there is no inner Ethernet header at all, so the
h_proto test is wrong there too.

The leak was observed. A PoC plants a known byte in a freed
skbuff_small_head object and reads it back one bit per probe from the
outer DF bit:

  planted=0xff recovered=0xff  MATCH
  planted=0xa5 recovered=0xa5  MATCH
  planted=0x5a recovered=0x5a  MATCH
  planted=0xc3 recovered=0xc3  MATCH
  phase B: 8/8 planted bytes recovered exactly (8 bits each)

With this patch every probe reads 0 (1/8, only the 0x00 pattern), while
the df=set/unset controls are unchanged.

Test skb_protocol(skb, true), the value the pull was keyed on, as the
TOS/TTL inheritance already does via ip_tunnel_get_dsfield() and
ip_tunnel_get_ttl().

Cc: stable@vger.kernel.org
Fixes: a025fb5f49ad ("geneve: Allow configuration of DF behaviour")
Reported-by: co+80332c538f1d1a9d@bugs.sh
Signed-off-by: Xiang Mei <xmei5@asu.edu>
---
 drivers/net/geneve.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 0ab729f055ea..74e9509598cf 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1471,11 +1471,11 @@ static int geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
 		if (cfg->df == GENEVE_DF_SET) {
 			df = htons(IP_DF);
 		} else if (cfg->df == GENEVE_DF_INHERIT) {
-			struct ethhdr *eth = skb_eth_hdr(skb);
+			__be16 inner_proto = skb_protocol(skb, true);
 
-			if (ntohs(eth->h_proto) == ETH_P_IPV6) {
+			if (inner_proto == htons(ETH_P_IPV6)) {
 				df = htons(IP_DF);
-			} else if (ntohs(eth->h_proto) == ETH_P_IP) {
+			} else if (inner_proto == htons(ETH_P_IP)) {
 				struct iphdr *iph = ip_hdr(skb);
 
 				if (iph->frag_off & htons(IP_DF))
-- 
2.43.0
Technical Details
Message-ID: <20261125235524.4139551-1-xmei5@asu.edu>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371753-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371753-linux-kernel-netdev=dewy.ru
From: xmei5@asu.edu (Xiang Mei)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net] geneve: fix out-of-bounds read in the DF inherit path
Date: Wed, 25 Nov 2026 16:55:24 -0700
Organization: Usenet Network
Message-ID: <20261125235524.4139551-1-xmei5@asu.edu>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="336596"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:pv4Tt5l/sO8eyppLGglv2J6Mmbc= sha256:VpHbn05me0xxE5UvDhxiEOKcCadY8Wp4fmDlL/aJwew= sha1:DMljFOlmT8xxh4T32EJC0vYUmNI= sha256:yidBXlBto/Ud1ho2zoZdKGScVDq5CGyAuyvlZubsFfM=
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 395AD125EAB; Thu, 26 Nov 2026 02:55:51 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 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, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=asu.edu
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 aC413SjoiVZx; Thu, 26 Nov 2026 02:55:48 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-371753-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=asu.edu
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 7716F125EA3; Thu, 26 Nov 2026 02:55:36 +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 2CF413B781; Wed, 25 Nov 2026 23:55:31 +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=1795650930; b=f1pBvrxEtl6hQcTcf/ENxbMM7N3J0juNKvFsvuatP++cxcVZMMLXeMhNt/Gy9LeMGcfW xvopriVGmiUWfsmzetLkSLOlzjVFN1UGBjAxTBVQG8WgxzBAy9jrUtuecWRYS93j0KIDL akp2Bnexbr9XtrXHTktxpUvxLosVAqSjBj1RXaGSat84f9IXSj3qGzUYwKJS+mibFGl2d 50tgb+rM+/4bSsQW3y+e2+iug4TLvM1uAPOIGhfGVbhYgY37rrcmn5yMTagj14yEt/7K7 d4CiHmmdJ34vZtCYMVHeypw5E2f1D9nHHgf4MOXukizqgV9qLPNGZsq2aH9zJu6O8Pg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795650930; 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=Y17RY7lnW2W3s1gLYweIbHY4WwiCO5fusa3god85Tng=; b=Eq/IrFrawDbzGIY7YpG7/2Srxecj0KfblZyYOozqh5+YRyGZpU/PquYwQFCawIk6htEt tbLLkAwXAxyxG3kNwGTFIBIXuQFCk8xb3tulR5pPXWNHXyTvaw/pG+j+vIJvhHTupa6v1 QjnFN4yQRtETthGsDTyEYR/5Nn56rWYSNFESqV00ECgvFTPBlc3hO3FGbtEFVVv9/BMju K6KgCRCfb1elpQe7rF7EdVcH/8R3u4QyJIiMmicQHQ3Egan0moAMAAIXH3hjv0twLUfpK URlYHkcbIxC/650Sce6yy/pDJqn3wbHjQCmiOqPoCrX64OeqDE2adTnfc9ax39aevmw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=asu.edu header.i=@asu.edu header.a=rsa-sha256 header.s=google header.b="P+DYusK/"; dmarc=pass header.from=asu.edu; spf=pass smtp.mailfrom=asu.edu; 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 0C44A606A339; Wed, 25 Nov 2026 23:55:30 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=asu.edu header.i=@asu.edu header.a=rsa-sha256 header.s=google header.b=P+DYusK/
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.174
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795650929; b=M4bF9U02HYJ53eqnwZeDKRxjgegrWbfmvRhgu3i2sSmMEMFGnyX9PpCkkV4H4vgWqhh/ 8YJPZksAi4uV8BkzSRoEDs6yynAfUgO1/zKTkvIZQ3J7fRga4pGiIu0fSOjBd6UYrVSPI fVfCED5MqnZfx90Cpi5KU9pwrADu5bXLY13z1BeYB7nJn46XvxVWwYO9M8cwCGJdrEXjE sfoHPElGToSRzU5zC2gaWUIr5qIY6bM+uzcRTEP0LWVS+/9fw9PmZveMHKTKcIQTfBQVV 1WTx8UQQI6JSlFAdt8CaxIVsqOMmD69bvfGOthTHlgeG5600z208z3Pyu/FwinHqSYw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795650929; 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=Y17RY7lnW2W3s1gLYweIbHY4WwiCO5fusa3god85Tng=; b=DWwbZZWyxd+h1OEY4uter87YmsJMeBTo16VuW8nZGx5EbnYpWD3QuEQjR8THHke8VHD2 jI7yYMMg3h2d94VvMJpxVRABhEyLKjMO/Qh+BFAJ+Tjk3HjXJ8YVEnmXHfCsgHSVAec5s lN13v6FavEH2VUnbcn+O2fBvnQiAn/TRmWZahBhZ8Dig8BUNXhiV+Q3iTy7I6hcEYvsZn 0jylYsTVmMQWQGdogkBc0QMiPFJtIOqMbew2I3fiQDyj7rFuE9l5X1WCO9aLtliXWBBqf K6DZaHjlYQuxXBBWZHj63l+3KibH7Ag1opHlRSi9YbZYzEfhPug4dUxh5MfmwXkRBLQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=asu.edu; spf=pass smtp.mailfrom=asu.edu; dkim=pass header.d=asu.edu header.i=@asu.edu header.a=rsa-sha256 header.s=google header.b="P+DYusK/"; arc=none smtp.remote-ip=74.125.82.174
X-Received: from mail-dy1-f174.google.com (mail-dy1-f174.google.com [74.125.82.174]) (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 1BEEA606A323 for <netdev@vger.kernel.org>; Wed, 25 Nov 2026 23:55:27 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1BEEA606A323
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=asu.edu
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=asu.edu
X-Received: by mail-dy1-f174.google.com with SMTP id 5a478bee46e88-38190551625so12592510eec.1 for <netdev@vger.kernel.org>; Wed, 25 Nov 2026 15:55:27 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=asu.edu; s=google; t=1795650927; x=1796255727; 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=Y17RY7lnW2W3s1gLYweIbHY4WwiCO5fusa3god85Tng=; b=P+DYusK//Rj533Zkh+1bXxaooxu2+GSPa/j6qooTwFz/U13kBHC0S5f3+D9QRd3Wk+ mXLXI5DBmWoFKsj9WGOz/yMKXI4EQJCxgORYnhUIqmU/xFF0VrfkDTtHxADB4qOjEN/P e6Y6tIBVS2zrulh/9h9/V3P6sSTVejkM8JgECx4EPe1RZDsBlG0ceefEj/VRlbQUKJ9/ p1GycljUbIDPJ9mK6v7rxzw6HN3o8dgmXxBzQAjxAcv1cHTmd6GhqLm2d8gnvxd8PXBf 9fYzd/fz+ksmv9SdZLe4DMw+aZD+oTQJDBapvYsEWnHWuCibywWr/7LsWgWlyciyD/Hw Mh3A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795650927; x=1796255727; 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=Y17RY7lnW2W3s1gLYweIbHY4WwiCO5fusa3god85Tng=; b=z3bT0OvVDsmwODeU3s7vjCn3Pkr3I+nBi6CE/qOhTa8UlQ1DquJ0MwwYIa2u3Ge7BJ 3T8mPzZXPZS9yhboOncRFgOkq2ZLldULbUOFFGDbtoEuud/w4fY7AV/64+CCfOl6EVab g97c64dIpcZ0AdT/w+WRT7pm5o8+eFsg3fNikHrtFSSB2DwYE1N3ER4C89KEdlmZB0V5 CoiqoK/NcSRTElF1DH/JDEK5TFGVnIRC9OZC12pppPlPb5G9BxOGnE/LDBzfNLQ6ggq2 IKg+2S5Z/HeZS6uTUAl2fYVyYKD7njxV1NTyoxamO+hyA3Q6SbxrWtYoZdf5EF+WidtG ny6A==
X-Gm-Message-State: APuU4Z9QpyVf5vXDg94B8ljEq92pLxOxG1RXU3u/2a6z1t5yK0R22LGl xg/RvkpslMp8pjocnSxcqfkLQO7yW05DF8cLeyudQcgQ/s6Vnck27T/InVobNSmDlg==
X-Gm-Gg: AZFdTZd5adRGuZsNRwCcwjWm3BgW4YrUQU/dAyLEpiaKmRy/dIvBGPcwZkVit0THSSd V7GWTn5k65PFl5EsBH5DUAE3aLesGY63KMqOH9xH5lHbr9a6BK7ZWe7qabKfDq5wJzFjRvduGhA L3R+yEbCLiK+opdkHq3lR7Saq5WO5vvWNdbYcrx5eT3isyL9jpV8cliAc6zhYCxoTX4/vYGk6O/ qCxAeG5gbH1rXYVVP2dqtHiiYMABoBzB7s6Lwz3CrUyg+zS4WUsLwVhmfepGOXCTe73kK1w15Rx i1z4JHnwAM+p0LP45hPHhjlQOVfl4c17M1jaS3yUW3OrNMxNBUPFikepxrpZot+zD4HJiY9lVOa 4JReIDmP6G1g3xhReBfHLiZ9qbJjLrrRHMWtKVcA+ozrnEsWJj4olE55V5K52HQeAj8jVlaMlVu AGhpDr6i7D/pDrD67Bc5o+NUwdnxoT4Ul6x2rLLztDv1c5BZ5hw37Q28HB6c3hxEYMKO3wHWMyz cdJ+16tZY9DlINUdwyUr/9wAaYXvm9QdXllS157AaZ6xEQJpH7YSZSeqOXco9ob26M96BiiVmVc a7is2hMb693bJmee/IH4NfHDfwtURZX+6eNs+zgI6ZV1KeNke0VabxCs3njvZsuLHRus
X-Received: by 2002:a05:7301:7187:b0:386:bd8:7ab3 with SMTP id 5a478bee46e88-3860bd88965mr19027537eec.29.1795650927153; Wed, 25 Nov 2026 15:55:27 -0800 (PST)
X-Received: from p1.. (209-147-138-4.nat.asu.edu. [209.147.138.4]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-385646633d0sm101477297eec.3.2026.11.25.15.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2026 15:55:26 -0800 (PST)
X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, co+80332c538f1d1a9d@bugs.sh, Xiang Mei <xmei5@asu.edu>
X-Mailer: git-send-email 2.43.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