From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.155]) (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 993453C8C56 for ; Tue, 12 May 2026 16:58:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778605086; cv=none; b=lJVwHPWFisjba0Ab+Ns3i72W5kFlpYZwsN55yeYzLuIwfMBCOddiEParM2tRlnE67K1++JL3DD3v/fboXWfkdMP6QeVTh3lDZMeWtKfwGJK7CaNi/SL/tmivxML9iNAXRyQnH+OpoRy+g7eKYOanJ+9CtSOB6Gy/hfqbTf+ngSQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778605086; c=relaxed/simple; bh=LYO28w/vatzILRqMViTx9/quD1mD+r9tqUUt+p9iM6M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pQ/5sEDtIQVx231XZl3l1cUIqdIqgcXCPuUjt0hfFFWgSc6dSB1nHEN34CVHSiKKn4UHGphKCrYgmr+iJkgQVH57UXVexC5QJoqLltIFqIMIwJiXL+YzeoYJl6ei5y2TPtCca4LHWBMxT+6vqB/V3ZH0NxlacVKXgQKepQPPGDw= 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=LEixIodf; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=FOk3mRJd; arc=none smtp.client-ip=103.168.172.155 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="LEixIodf"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="FOk3mRJd" Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfhigh.phl.internal (Postfix) with ESMTP id A492814000A7; Tue, 12 May 2026 12:58:03 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Tue, 12 May 2026 12:58:03 -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=fm3; t=1778605083; x= 1778691483; bh=LHiQfTHyETI1dxH8h/QYy2J8CbZWqHqqCzMiGRcrZHo=; b=L EixIodfDNfMRUOSEHDq5YZU0k8WgNWfajTMTVqEuwWP2C6kU625FRjCKwzT6nEkj /W5F4Cw4xodhUerCYkOn5txj8EZI3CZZStpN603jGcF6AlF/J83re2A4jb7q0x4m uecxsdAjHZxVb1vcYSMhGGwnZ5DzXliMVJ8XT9dOn6VMN1ULOSiN1gSjNdauj1+O +56x5bii0I0iSTTWwIhaKvYr1JpzQZAUqtcfz8KODmDSnDGK/OYYoTyRpbPepXP1 aFSv9OpGbpDjpUZexPDsnFsAffg3eqdoEIMOC0Vz7qYfn5UvEQt5dh5AVyElCn/k eA7FtZcAZ31OYPPBEuuig== 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=fm3; t=1778605083; x=1778691483; bh=L HiQfTHyETI1dxH8h/QYy2J8CbZWqHqqCzMiGRcrZHo=; b=FOk3mRJdRtR4M7tP5 pYu6l2OmWwthJotluh+UcAXu8IYY4Mz8V+NcIWGjeZidJCeg9yXOkyjuMJ3hS/hj YIkoEwHzdTDUyquIe0JAH9nw+YWMx1KxoxnAmpF+2IncOIBapasD2fVsD32qoBIN 45WBOZh//3yO1FoJZ/YRwGgNj/qD730GSUv2LHjwSfLZbkTUx87AFZSgsh5UOekp AtL4NgjBlWoWfSGkc7iSTLwJ++gtLJuJ8Btpv0mhOi2G43tjhvi/BkyL3MO6Z7Zi +QN8Xw6jKn5OgcurQR9kkyvy1tnEHmnYikIwZmXg+6axMnpIVQYI2LmStnxucSRz WSnZA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdduvddvfeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheptehlihgtvgcu ofhikhhithihrghnshhkrgcuoegrlhhitggvrdhkvghrnhgvlhesfhgrshhtmhgrihhlrd himheqnecuggftrfgrthhtvghrnhepteffleejfedvhfehieejlefgkeeljeevueeggeev tefhgfeuhfduffegkedvtddtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheprghlihgtvgdrkhgvrhhnvghlsehfrghsthhmrghilhdrihhmpdhn sggprhgtphhtthhopedujedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepuggrnh hivghlsehiohhgvggrrhgsohigrdhnvghtpdhrtghpthhtohepuggrvhgvmhesuggrvhgv mhhlohhfthdrnhgvthdprhgtphhtthhopegvughumhgriigvthesghhoohhglhgvrdgtoh hmpdhrtghpthhtohepkhhusggrsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehprggs vghnihesrhgvughhrghtrdgtohhmpdhrtghpthhtoheplhhutghivghnrdigihhnsehgmh grihhlrdgtohhmpdhrtghpthhtohepfihilhhlvghmuggvsghruhhijhhnrdhkvghrnhgv lhesghhmrghilhdrtghomhdprhgtphhtthhopeifihhllhgvmhgssehgohhoghhlvgdrtg homhdprhgtphhtthhopegushgrhhgvrhhnsehkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i559e4809:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 May 2026 12:58:02 -0400 (EDT) From: Alice Mikityanska To: Daniel Borkmann , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xin Long , Willem de Bruijn , 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 v4 03/12] geneve: Fix off-by-one comparing with GRO_LEGACY_MAX_SIZE Date: Tue, 12 May 2026 18:56:39 +0200 Message-ID: <20260512165648.386518-4-alice.kernel@fastmail.im> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260512165648.386518-1-alice.kernel@fastmail.im> References: <20260512165648.386518-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 Reviewed-by: Willem de Bruijn --- 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 b36fad833724..aee05be69d1e 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.54.0