🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24414

[PATCH net v2 1/3] ip_gre: clear the optional GRE fields in ipgre_header()

#24414
From: Kyuwon Cho
Date: Mon, 30 Nov 2026 05:56
31 lines
11603 bytes
ipgre_header() pushes the outer IPv4 header and t->hlen bytes of GRE
header, but fills in only the IPv4 header and the base GRE header. When
the tunnel sends a checksum, a key or a sequence number, those fields
keep whatever was in the skb's headroom, and a packet socket bound to
the device copies them to user space.

Clear the whole header before filling it in.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Suggested-by: Ido Schimmel <idosch@nvidia.com>
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Kyuwon Cho <kyuwoncho18@gmail.com>
---
 net/ipv4/ip_gre.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 5485586fa0e6..84dde2e16f18 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -907,6 +907,7 @@ static int ipgre_header(struct sk_buff *skb, struct net_device *dev,
 		return -needed;
 
 	iph = skb_push(skb, needed);
+	memset(iph, 0, needed);
 	greh = (struct gre_base_hdr *)(iph+1);
 	greh->flags = gre_tnl_flags_to_gre_flags(t->parms.o_flags);
 	greh->protocol = htons(type);
-- 
2.43.0
Technical Details
Message-ID: <f47cbe20b0581760174e281f0b457d2cd8f57337.1795755931.git.kyuwoncho18@gmail.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder2.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-373891-linux-kernel-netdev=dewy.ru
References: <cover.1795755931.git.kyuwoncho18@gmail.com>

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!feeder2.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-373891-linux-kernel-netdev=dewy.ru
From: kyuwoncho18@gmail.com (Kyuwon Cho)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2 1/3] ip_gre: clear the optional GRE fields in ipgre_header()
Date: Mon, 30 Nov 2026 14:56:15 +0900
Organization: Usenet Network
Message-ID: <f47cbe20b0581760174e281f0b457d2cd8f57337.1795755931.git.kyuwoncho18@gmail.com>
References: <cover.1795755931.git.kyuwoncho18@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="1347822"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:dH+xVnC8cTuF/2lLoDb3FmLdQy0= sha256:gzAkdwGb6YKB1mQpYT3peGote5BgHDM6Mkx/hoeQymA= sha1:sbqTWpyiLwXIUvIXaYKQltS1eXA= sha256:78ZF+BVhFvJ7VRXUVbE0ac0ZU3I+Ranj8Z/rOYEG598=
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 B19C1125FC6; Mon, 30 Nov 2026 08:56:40 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 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.249, 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 u2mu4Th-mlnK; Mon, 30 Nov 2026 08:56:38 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373891-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 AE22F125FC4; Mon, 30 Nov 2026 08:56:29 +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 A104E27638; Mon, 30 Nov 2026 05:56:27 +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=1796018187; b=jM8XhKHK4od9MeMGV8jH+cEFjJOEgDl7jC6uIwqOWmFLWj6X++3nlNkn5CMpg2MjebYQ +h0E/fjP2xB8WjI+bYncBTjMIVWr223qwDsgCeMvhaRzt2Lmd+I7iOq/wGtu6ZlBEOrjz VQgbmVL+43/C5Q/pXH3aeyJN8gDmbb90V0ZQAbn4oPTx0z1giKupxmnD/7qAhaYbjDZn7 6WuUTKb3NG9n30MgXv3SZFb2uD/7GgEC4dS+WaC1a4JZVfu2groIbNNIQp6ID7N2o5xhO WGGUBWNQxW5VOCP6F8herSCqWL9livuw2PYGRkIlLsE/DUcxRtDhoqickyq0fF1tA6A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796018187; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-ID: In-Reply-To:References:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=eotZfsXYa2e0mN1AJUGOyofj6cFkkcuWTK+XWrWbRTU=; b=FFtjua5D1GeOxos/PpVPnryAhgeQsKo59NGZ/R+NXEFs5+4rjIUiy+Bvb69o7I8ga8Co KwMWOLlt5ZQclMAn7DVLOVucbOorMvFopjpUTNdFK/ohkkuT+1hJOpicVGpM4jf0vcO61 50TRn/62fc+O2+o4ck8PYWc1Hs6151bAEBHefZKmlHp+rkms3WV91FEUwiciRm/oQ1OqO kRHI6PSate69b/zJM9qJec0K8+HXDqiQofzWZ1i2Ks58x0uXydBG1Qh3tjIhphnXrDtLn 6UcCUQeztl2aDpJqfNvrjrUC2qUt2x+D8phoVNwdxRqqU2JEX7EmoUjrHiDBPcL5MWw==
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=upOcb1Ky; 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 78339606A329; Mon, 30 Nov 2026 05:56:27 +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=upOcb1Ky
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.171
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796018186; b=22J3kLuANBqha/wOOOlPvRTUD/yRLLxqYhGed9We+pWaweJC0/ZkBBKj3DBj1I4FxkqC yJqMaRqQAxGNojkwGsjAkuN8+nVwADrQ4T/GxqqmdvoS2xq5PsIFJKBbZ00Gg3L3pD5ty 3lAPWR7yFm/tbXcfTZaU8z8ynv5M86NOuOBcdr78d6uGAM/hEg24quB5CafYqHy0Id2SD NC1f+vN7eEbY4/YRasYIjR42Wy0UYrJYYtm6K0xeZkZvk9liaJ/JPVz+SzUq2iRuoHOr7 ZofqekdtzxwGIREoY5bJ+XQuZ6ytZFpiB98iIUvtv7RURJnmz01PMB9sJ7oG+dFz5ew==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796018186; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=eotZfsXYa2e0mN1AJUGOyofj6cFkkcuWTK+XWrWbRTU=; b=5MPwV0GLa+KQwj+0evJB8SjgvJgTjY7tnxbgtO88WSCtg0a4Gn3W9ig42VxlSNgrK0n6 6I806P1NP5RI/ib3Ofuaza0bFWJPNqEJadrWQhfOq5x1I1VUfRSPlIjR8XHZ0+Tsv9/nV dbs6hDgwPhXsEgbP10vI1kGW5GWRmjKL9on/eG+Fj3P681OCzXUe66LWhbKFXsn6Tww0u qAk5IT9++dJtDnds/AhUA0i9f6fwjDPd34FoO2QQq8iBFPR1VHSi633BvZthsI23vDK0z vUsOM5867JREpmwlQtvALMUDYvMOdkTejttD4hB0UuqztSb+bj+JYYrL6TrwQkgj6kw==
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=upOcb1Ky; arc=none smtp.remote-ip=209.85.215.171
X-Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (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 453D6606A31C for <netdev@vger.kernel.org>; Mon, 30 Nov 2026 05:56:26 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 453D6606A31C
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-pg1-f171.google.com with SMTP id 41be03b00d2f7-cddc250d815so3774644a12.2 for <netdev@vger.kernel.org>; Sun, 29 Nov 2026 21:56:26 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796018185; x=1796622985; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=eotZfsXYa2e0mN1AJUGOyofj6cFkkcuWTK+XWrWbRTU=; b=upOcb1KyjDdtdTRie4ZrsNBnDaO0trRFVjvk0o1siDK6zArrWCBIWXmnE+7TowiquC BNFgnfstE9e+ZeadswrWZL4aOd9yZkCbrY4cVIW6x8eXGpRKt5NPHnZtIlaSFW7cxJnC wu84ciYIZPbJ1/cts+LA0wGMNsRtkgtR6q56zju+xWhBR2QNwEX2vc8DvXP8H5ISrO7y KalmNJlF7uTaqIJkGShKJiz2xF/Qqat0rZAiQU4gtJjGu9rm2q4lIeIVOjkKPukb7nIt vl3byBMcmKqQZVHIOlLCAGWGS5/XgfNYQC5rhR/khwJMf8ITPERFLSwm3odObzZEensZ QyOw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796018185; x=1796622985; h=content-transfer-encoding:mime-version:references:in-reply-to :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=eotZfsXYa2e0mN1AJUGOyofj6cFkkcuWTK+XWrWbRTU=; b=c6Tvzns4rbHeNxLg/ETtF4KibHCPgvpPpPjsedejMRta/2t1kCZ/eweC6zbMlfH4de 6Mz2A0O7m8sLECfo/bjc/fleiNpTlHolFf6VdSgTFIgYKVhYqkfsE4a+Hs8eh/clHFqe pR1846pOiErtLm515a6mUrYvU85NU9IawFHujklaPAVA5EeJiL27fXk69rwptl6Xcs9X dGwX+Fml0qOEA3il7FnFy7qY8AtYI4c0lW4mxfU1SzgyEY4nLv3wCKXpCfsh9LzyLN13 D6KJSf4x+R4tz3OInmiESnwlKCmRnlhU0nZqUfdq+F+2hz7rswEu4FnKXAPZXNTTeTtQ X18A==
X-Forwarded-Encrypted: i=1; AL+hErGlXKEpB7egdsqS96YbSivM76x+nHHvC75B05TStRAelKTqTa5hRJ01o1IC30ha0tzpdamjrwE=@vger.kernel.org
X-Gm-Message-State: APuU4Z9/WpZv+IBxSchBD3dDFZK9ccUTGCB+wlUEnhn+BVXOqNG5d5xt PT2r4j3hkyw6j9z14bavggLKPTS9mZ/JaLRxdI00jcXjOj9Vc8rWaBsI
X-Gm-Gg: AZFdTZclWCF0c025hbh3lOusc60F/zc2MIfw/HZLbR2yPgJSSpql+TDGsGq9vH3zt+l ho47iLV3Qs+nw+NOml4BBi8aJp5Rrn+qLNMypP1eUfE16HD2m8n5UDTP7Hq6sBEM/qsbZ81i/j5 yvyenwRtvzukpzSaFP410iA0UlEzBdxz8whnGZdDHu3mzccUjXKPIIRohDftdEVswHHH3q0QWuF EZoEaQOxyg45naVCV2ljfxCgh5Xf1NnMTtzr6a3dVPv+8XnudHhj/6VYoCUJzFSfYvctFY5d/CR 6Nu0O9aU6rRLD7bkKyQjyouwRIYof9BD1C7PRYNHK7Mii7qmbQZkRjx3ANoeeq9ro5kOY5SQtq/ RARdCZYc5mc+hGY7mIfVxPhnDl/FAQJ3aIAaVjDUZoHxWUhF4UMWhoFJDYf9nnwPEaNopMbT55h quYJwGiGtl557xTalYUPHSCeZm/2vBjLQ9lnxYkzkXBzKj05kjJ0gTAHIqsVDRrFzkS9VFN9kdJ hmFui3/XfdGtjx9AFuIgx1YafcKwuPwcaTqIO/LOIndqITKUAAwtsBmxv1YXRAaLaAono/Yj0+h 041uZ7nx4mTGdMJhrmmdzkenEuGdAdsO2hOJR7K8EOVzROLX//y6fZAGHG1UqBI+Ytqd8wzu4dv wAQHlBEjECd9J
X-Received: by 2002:a17:90b:2b50:b0:3b0:9a1b:b708 with SMTP id 98e67ed59e1d1-3b41c98245cmr31736113a91.62.1796018185515; Sun, 29 Nov 2026 21:56:25 -0800 (PST)
X-Received: from d20be28ee783.tail196be.ts.net (vldb.skku.ac.kr. [115.145.173.180]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cde6cea770asm17578233a12.3.2026.11.29.21.56.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 21:56:25 -0800 (PST)
X-Cc: Ido Schimmel <idosch@nvidia.com>, Xin Long <lucien.xin@gmail.com>, Willem de Bruijn <willemb@google.com>, Simon Horman <horms@kernel.org>, Dmitry Kozlov <xeb@mail.ru>, netdev@vger.kernel.org
X-In-Reply-To: <cover.1795755931.git.kyuwoncho18@gmail.com>
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