From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 8D4BF415F10; Tue, 21 Jul 2026 21:36:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784669777; cv=none; b=QGqysIegHPdwdU98/UYhNglFJAd7OoLu7u/6hgv6kOB8jhegmBZXUrWzx0tWlAY+6O0XfoaDUUXTFV9B/HOwxZXSXo5O3ZRIrnkk6Sv/KESxLrkrrZnOxtT4zMDOWQSZfRBzSlQZ66r6PHAro5DvVs3QiLqWb3DqEWxjHgZSn7g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784669777; c=relaxed/simple; bh=NKJVa6O5cgPS24jhGPgkbGXq3ttQTCNpYFP8kDbt7Pw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a8a0Zq8z4/rUwSO+alqJAxx5TBZd3oxcaTrBqdKnm5PydREol5axp3lqz6pREYy5ieqFgaP/yp7fAUY1v4xaMTw67osxhAxKIAiEwPLHqgTjngccx3xcNTNMSmiemg2zODc2GXi/YDCEEvobmI/2+d/J6dP2fzWRX/fGMJa9hFU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rO495bZF; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="rO495bZF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65D901F000E9; Tue, 21 Jul 2026 21:36:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784669774; bh=SsFDeurXadkWj/4m5ZErOMBstDi5FuBz/OY8QkU7fwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rO495bZFM0wCXpbOa8RVeUsNSYXY2N8ycAR2h9IaalNSokMrgK++7aSB5B4/Qk5zM oJPTdRldj0caT6sdkbemwysY/Tc9nEGa0rxB6OTi4au8933Lcv+QhTW8QyysRs133P gB9oT5C6q0+27UFVJbzIFo/mVliZom2lhhhyIqBk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Qihang , Eric Dumazet , "David S. Miller" , Sasha Levin Subject: [PATCH 6.1 0682/1067] gue: validate REMCSUM private option length Date: Tue, 21 Jul 2026 17:21:23 +0200 Message-ID: <20260721152439.854213564@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152424.521567757@linuxfoundation.org> References: <20260721152424.521567757@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Qihang [ Upstream commit d335dcc6f521571d57117b8deeebc940836e5450 ] GUE private flags can indicate that remote checksum offload metadata is present. The private flags field itself is accounted for by guehdr_flags_len(), but guehdr_priv_flags_len() currently returns 0 even when GUE_PFLAG_REMCSUM is set. This lets a packet with only the private flags field pass validate_gue_flags(), after which gue_remcsum() and gue_gro_remcsum() read the missing REMCSUM start/offset fields from the following bytes. Account for GUE_PLEN_REMCSUM when GUE_PFLAG_REMCSUM is present so that malformed packets are rejected during option validation. Fixes: c1aa8347e73e ("gue: Protocol constants for remote checksum offload") Signed-off-by: Qihang Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- include/net/gue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/gue.h b/include/net/gue.h index dfca298bec9ccd..caefd6da86939b 100644 --- a/include/net/gue.h +++ b/include/net/gue.h @@ -80,7 +80,7 @@ static inline size_t guehdr_flags_len(__be16 flags) static inline size_t guehdr_priv_flags_len(__be32 flags) { - return 0; + return (flags & GUE_PFLAG_REMCSUM) ? GUE_PLEN_REMCSUM : 0; } /* Validate standard and private flags. Returns non-zero (meaning invalid) -- 2.53.0