From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a7-smtp.messagingengine.com (fout-a7-smtp.messagingengine.com [103.168.172.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C69013D891B for ; Fri, 10 Apr 2026 15:10:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.150 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775833814; cv=none; b=MKEvZwaqQHdpJ7JKJcCPxDW3TkdVDdxN7Cqd4b5e3iyKlYYXNoAyldwMyuiVAxAjV4BNGdYlf9uLiq77u3Ad2Jrwj6jMJotUEs22qZGgvhh+J1Ocx4cGR4qxoACdqbZFORyClI0EKBJAjNGSOFDK7GmGIhxcSHhWe395MX+Mm7c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775833814; c=relaxed/simple; bh=fOdAlp1RrPNuluiQs9TT4elPr4pYfdrgQVxGNxz3Kdo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FX0qEZ+XOD4x2vWQByJnyvcCVMrIp81UjyCdKbrBR0Cdj7La1KbZKzCmwbeIVYcoOAEffMcPkBTtt4MMCJq+z8g4tDTgp/OTrAuGABoQuaj5hoORT8d5ZWC4/vmq/UnIgqTGIGEFzf0RhuYE2xjl3hDGBb/yQ2BUku6Jtpx7QoE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.im; spf=pass smtp.mailfrom=fastmail.im; dkim=pass (2048-bit key) header.d=fastmail.im header.i=@fastmail.im header.b=RMVVgfsM; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=awZVjIEc; arc=none smtp.client-ip=103.168.172.150 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fastmail.im header.i=@fastmail.im header.b="RMVVgfsM"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="awZVjIEc" Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id 10AF4EC044B; Fri, 10 Apr 2026 11:10:12 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Fri, 10 Apr 2026 11:10:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.im; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1775833812; x= 1775920212; bh=t0+C0D99cR7NFTky4H4vOh2LkXdLwjqSTmuzo46D2a4=; b=R MVVgfsM6CdpqsKL1ohYQxBuWm98O/MaCQtbJcrwh5ANvYPH2HElayrdgNHK9qevm btO2BCMpGjn1FznAxFT2cxjzQ95Ut52Y/bV1IeeqJ3VqYI9VoyBuQlm1CE4bwNN8 5uL98XWLRI7cEMWDqSIIflBUYdG7i4DrZod7zAWAjWrGuqVrwqUaLE7Z781Noitr jMuXnNIReM4qIrccDPZq0Fn3tszbTV/uyQjDv7XkUuzpCW6hJsV7MiBKSzmaLGt3 V2gEukFDmZYKQ4WWupumPRmuKa3/1eaZzPVFdxDH23HjKXasf4hLhzTxfnonJ6gt BwmuLg0Wc2L9GP2d+7U7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1775833812; x=1775920212; bh=t 0+C0D99cR7NFTky4H4vOh2LkXdLwjqSTmuzo46D2a4=; b=awZVjIEcGOFcaTdCv TOELa5ba+sWXyMuXx7NF0HChhG6QVnyl7WRVUyIa8bzGM3h1VvY+509x+iFBa8qL e80Wd5p6QFfq6vqOAIKD4yqSnrd3sfS2tGrACImKpXPbJ8VL2BN8G7/LOkhcSO+G P36eDzDZGcvIHpTI/8fCiurM4u/HuTbRO8MMZV3y+g5zX+21cY9pM5I4449jGzDD d+8BR5picqJIPCjsKXQ7a4Hy/fwRwr1q0Y1lq+qnVk+IFulGvu5sJs6zp3X49qKS esF+MNkmMCr8OzgbgAjxcK5QLy3RJZu1I93asOtEUM6X76O2tOidButWcOmvhumd 6jYtA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddvleejfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetlhhitggvucfo ihhkihhthigrnhhskhgruceorghlihgtvgdrkhgvrhhnvghlsehfrghsthhmrghilhdrih hmqeenucggtffrrghtthgvrhhnpeetffeljeefvdfhheeijeelgfekleejveeugeegveet hffguefhudffgeekvddttdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrlhhitggvrdhkvghrnhgvlhesfhgrshhtmhgrihhlrdhimhdpnhgs pghrtghpthhtohepudeipdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegurghnih gvlhesihhoghgvrghrsghogidrnhgvthdprhgtphhtthhopegurghvvghmsegurghvvghm lhhofhhtrdhnvghtpdhrtghpthhtohepvgguuhhmrgiivghtsehgohhoghhlvgdrtghomh dprhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepphgrsggv nhhisehrvgguhhgrthdrtghomhdprhgtphhtthhopehluhgtihgvnhdrgihinhesghhmrg hilhdrtghomhdprhgtphhtthhopeifihhllhgvmhguvggsrhhuihhjnhdrkhgvrhhnvghl sehgmhgrihhlrdgtohhmpdhrtghpthhtohepughsrghhvghrnheskhgvrhhnvghlrdhorh hgpdhrtghpthhtoheprhgriihorhessghlrggtkhifrghllhdrohhrgh X-ME-Proxy: Feedback-ID: i559e4809:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Apr 2026 11:10:11 -0400 (EDT) From: Alice Mikityanska To: Daniel Borkmann , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xin Long , Willem de Bruijn , David Ahern , Nikolay Aleksandrov Cc: Shuah Khan , Stanislav Fomichev , Andrew Lunn , Simon Horman , Florian Westphal , netdev@vger.kernel.org, Alice Mikityanska Subject: [PATCH net-next v3 03/12] geneve: Fix off-by-one comparing with GRO_LEGACY_MAX_SIZE Date: Fri, 10 Apr 2026 18:09:34 +0300 Message-ID: <20260410150943.993350-4-alice.kernel@fastmail.im> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410150943.993350-1-alice.kernel@fastmail.im> References: <20260410150943.993350-1-alice.kernel@fastmail.im> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Alice Mikityanska GRO_LEGACY_MAX_SIZE = 65536; total_len being 65536 is too big to fit into a u16. As can be seen in skb_gro_receive, packets bigger or equal to gro_max_size (or GRO_LEGACY_MAX_SIZE) are dropped with -E2BIG. Apply the same boundary to geneve_post_decap_hint to avoid writing 65536 to a 16-bit iph->tot_len field with an overflow. Fixes: fd0dd796576e ("geneve: use GRO hint option in the RX path") Signed-off-by: Alice Mikityanska --- drivers/net/geneve.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index c6563367d382..84e8d6c69172 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -603,7 +603,7 @@ static int geneve_post_decap_hint(const struct sock *sk, struct sk_buff *skb, ipv6h = (void *)skb->data + gro_hint->nested_nh_offset; iph = (struct iphdr *)ipv6h; total_len = skb->len - gro_hint->nested_nh_offset; - if (total_len > GRO_LEGACY_MAX_SIZE) + if (total_len >= GRO_LEGACY_MAX_SIZE) return -E2BIG; /* -- 2.53.0