From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382063; b=qjdHW6Kx0K3sVCvgt9xNx9hZJG9JthIvCms85azBarEZCTSY4cWJiYZ/kO7mXX0lcpis cZUqRbYhRagx0UHyfRQsPPpHE1vTJPPON4F0cipitCupK/oUZy0lxml24Y+81HGB+20+9 76LAmzv+a5Lkz6tiyNQtQwh5mAUrsln/tPcKXqyDez9rDB+cY6p65xfxpUwz+b5iI93+Q 4egfD2BciWjjf/lyCRdZgD8GTWZ5ImBbX7QB305f+G94tQSnEjCG1Vl2p+F9jz3fSbq3s VUSMR+0vk1aST+8ObBSQ6PHuYnXEwRxh0wNiN/LA70ZU/rdZhEZZ7bgPv5YpAeJrl1Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382063; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=F9lN8cQ1gu2a+quu2r/1HAb94/v95AT9+3Gbc3BFj1U=; b=WBQEFzcPcDF96kUZNkRYxa/MNVgjMfwLnGYgzWtFmLsUSFE0XEDOOLAJCRwmngBoMe0c TToFf1MgWQjSXNKWCUboKJSG8KHyrEfVKfvj4w/hcacQwyUUvNLUDo/EJMczowKBRkn45 V5Bieu5hnrBABWWK5lE3RRlZiHgI9SN/mpMeRgsuvXMTQ14LCl/6v0NS5HkcARc8ZsfDy e62Bb/9DqJ85c2CCViwHTx7Ybo3j7RHTAw8AX/VpHLVQi7ZK8IRIUdvqOMKl+e+7BUcUq 3Hpo+9DnXGjdpBVAVFp548tdJ9eVM9nulpaBic1K9BCkpsFYVKP83v4vPG2D97t468g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=DVp7qkcb; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4336B606A32D; Fri, 4 Dec 2026 11:01:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=DVp7qkcb Received: by smtp.kernel.org (Postfix) with ESMTPSA id B09EE1F000CE; Fri, 4 Dec 2026 11:01:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382063; bh=F9lN8cQ1gu2a+quu2r/1HAb94/v95AT9+3Gbc3BFj1U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DVp7qkcbY1r1IwQgWpgl4D1MA+pntbBrEdWb6MzI8Nw96l2i221Uy8+YqlXQLfzT3 W6ywNsZCO53RZpgBgmZDD6daETKHgveFKestH5YmmizgKDvdbmQo87c4MPTVzQxUw6 Wuixo1tHrInn5qeTUN247CbaYB2SmQoDXbfbM8ok= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Eric Dumazet , Jiayuan Chen , Willem de Bruijn , Sasha Levin Subject: [PATCH 6.18 292/703] ipv4: fix conntrack defrag forwarding after ip_frag_reinit() Date: Fri, 4 Dec 2026 19:03:11 +0900 Message-ID: <20261204100635.552580943@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiayuan Chen [ Upstream commit 3ab5aae0eb60079d17378af5aab0db84ba946e0e ] q.max_size and max_df_size are used by ip_frag_reasm() to set IPCB(skb)->frag_max_size and the DF bit of the reassembled packet. ip_frag_reinit() reuses the queue for a new datagram but does not reset them, so the new datagram inherits them from the old one. On a router with conntrack defrag, if the largest fragment of the old datagram had DF set and was larger than the egress MTU, a new datagram without DF gets DF set after reassembly and is rejected with ICMP_FRAG_NEEDED, even though all its fragments fit. Reset both fields. Fixes: 5f2d04f1f9b5 ("ipv4: fix path MTU discovery with connection tracking") Fixes: d6b915e29f4a ("ip_fragment: don't forward defragmented DF packet") Reviewed-by: Eric Dumazet Signed-off-by: Jiayuan Chen Link: https://patch.msgid.link/20261120094700.46500-1-jiayuan.chen@linux.dev Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin --- net/ipv4/ip_fragment.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index ef7fd61284a3f..0688be8142c4b 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c @@ -250,6 +250,8 @@ static int ip_frag_reinit(struct ipq *qp) qp->q.flags = 0; qp->q.len = 0; qp->q.meat = 0; + qp->q.max_size = 0; + qp->max_df_size = 0; qp->iif = 0; qp->ecn = 0; -- 2.53.0