Article View: linux.kernel.netdev
Article #18984[PATCH nf] ipv4: fix conntrack defrag forwarding after ip_frag_reinit()
From: Jiayuan Chen
Date: Thu, 19 Nov 2026 06:17
Date: Thu, 19 Nov 2026 06:17
36 lines
9442 bytes
9442 bytes
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")
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
---
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 ef7fd61284a3..0688be8142c4 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.43.0
Technical Details
Message-ID:
<20261119061751.222641-1-jiayuan.chen@linux.dev>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366763-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366763-linux-kernel-netdev=dewy.ru From: jiayuan.chen@linux.dev (Jiayuan Chen) Newsgroups: linux.kernel.netdev Subject: [PATCH nf] ipv4: fix conntrack defrag forwarding after ip_frag_reinit() Date: Thu, 19 Nov 2026 14:17:50 +0800 Organization: Usenet Network Message-ID: <20261119061751.222641-1-jiayuan.chen@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2804824"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:khb04DupNv+PU8C7i3RoBPqRwdg= sha256:nIsrBBRlXwZToNecNfMCw93z0jJQYD5XI4/wO/Nt29c= sha1:Mdai74I0ufflL/OTk9e/zuKGjvc= sha256:oIK/UB6DyTYBedC5m27vN7R2MTlVptYPHxMLRN/RBT8= 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 0C2E5115512; Thu, 19 Nov 2026 09:18:27 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.05 X-Spam-Status: No, score=-2.05 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, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HK_RANDOM_FROM=1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=linux.dev 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 gcadsjl3x5_A; Thu, 19 Nov 2026 09:18:23 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-366763-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 5325F115510; Thu, 19 Nov 2026 09:18:14 +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 0FE991092AD; Thu, 19 Nov 2026 06:18:13 +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=1795069093; b=hQBru9NQ5eb7z5LsDGpzixOSmWVqPk1aWxSqk26ClZ5G4I0YQE+wK18F0MDA939yJ17X 7jC1oZ2dP3sRN06Mmdyc4qtqs6k9u25BmnAiWCj0DCthnX7O3UYEBrsn7cJfp8gMeteEj QAhuDNEZ1u6vAJOnn2LvvpdH1wu6WBG2pVL/tRJYBoT4PNdOAWUJ+Myv2VHghNtx01lRK T4eZbg2eVccwGqif+aRzQNwYuRoJxPrje+uWITsmYMYpWfcSHqSIA+NlsyQ35VJRUtSkV 0jNPm2FXWjhjyLhqeuCsO8W8pVFF27TScl72swx1XXE3eXAd8mH9y2uai2sG0hWin+Q== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795069093; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc: Subject:Date:Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Transfer-Encoding; bh=cQhLGX092VFRl67tQ9qHxUslSGV7iUjL213pV0nCfHE=; b=LptYbJKvPfiWOx/xNtArom5jOvY0HbXiwVBQLzK0ylxvXflk49+HSzDBSz2So1XpAEnd eh2tmW6Bw2SuOr/WIOOohfH0Q7nZC00pMPLYdRyohsCGbt0OybduiRmvqeJMrafuky/CK vEU4T1ZXQScfIB+dc1nBdDPKtH1Kz7ozIJR+faz1BrAA3rjUrCjv+Ap4DR/BhkgQcPVI9 2+DPuUpOe9AvPd1/Il5Ddw0r0dNl8Xtteca4cHiXm9D+LS06dMmHkV+aWYL8a0nOE4y9h CyVEutXT5tX4tz7dTtGgJWnV84CDbQC5DNOPku+0Dz66qkCeT12i5IvSCn8JgyfnE9g== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=KsA+2kaG; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; 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 DC7D5606A331; Thu, 19 Nov 2026 06:18:12 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=KsA+2kaG X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.230 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795069087; b=K24R93J4G3ObockoxxbUxPwxqTF57hZsLutrfVfVcwNivZM4/ojVMwDHYGD+3jMIMP5t 5vbAIT6Ct99XNXvcXS9lgrGygsVzd2tIVsxSpnVE89aKFmtfBMAjAWYeolgEyh4neqC78 X3O0Pm666mZT9NSoGMnNHm+Mq1d5zYCyx1VXZQ66c/hurX6T5g/g1KMueg5g7FXrH4LIR G6WlPC2hKebicdzUQ3MkYR2A9c0ufzfVeEzFcN4X4SJ2OwvGQtgmnbqVyp9PeqvSW9oFM 7mY+NwbnLj6xc3TLTSSP4UIeRNlZMjLVqujevgF9D22fYncKK66SwGIDBcO5ybb2lHw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795069087; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc:Subject:Date:Message-ID: X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=cQhLGX092VFRl67tQ9qHxUslSGV7iUjL213pV0nCfHE=; b=FQnGeRlravUxgNwM53U0vXbb23jUfNW2yMiKe9gN7JQ3/H1pyzhN/n8C+NlL4cgdcOWs A4t4jkBgMNHmTmQyagf/sXcEqMQraBGdOqN/ZsfwTlxa3UtYKKzjPxqXzlK6VOf9TXbKX zOLwZWXyovNHxIF3eYnj01zrmmuF5IJflTem30LgRlTmTDvgoAoZHWBL4cwDXDzfbqcLB fiR8RFEdLYLv0WSvy+pjGX6veRUqPPykEvyg5hjrbDYlVe0GYEcnUwNjoi3Tadh/TYbMj KVgGWvZpCofS0RiumA32CHpkIX4q6j1hCNp77ZYFc2o5PubZitVoawfQhJcYsqsSJ2g== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=KsA+2kaG; arc=none smtp.remote-ip=95.215.58.230 X-Received: from mta1.migadu.com (out-230.mta1.migadu.com [95.215.58.230]) (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 46E8B606A320 for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 06:18:05 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 46E8B606A320 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=5fumGNfa6wdHoTGYmvcSwtkIJ8obNdvtuOJVAx6Kbfo=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795069084; v=1; x=1795673884; b=KsA+2kaGnmjc8/gwaDd3KNDW3zkpehDxqXE8HVpoIj0wuHFBIDVQLZvWSCAaTyVOJjzj7u4C Xg9ftH3vjcj407fPdkGVr0M43cdvnzKQROtFIya5h2Sj+R4Y5bUGmVoyRJf8wIYhjEG8TNLCeLm DH3lc0BMfroQ/BB2kyY4wBVI= X-Envelope-To: netdev@vger.kernel.org X-Received: by smtp.migadu.com with ESMTPS id 75e9ea414a091c0e; Thu, 19 Nov 2026 06:18:04 +0000 X-Mizu-Trace-ID: 75e9ea414a091c0e X-Migadu-Flow: FLOW_OUT X-Cc: Jiayuan Chen <jiayuan.chen@linux.dev>, David Ahern <dsahern@kernel.org>, Ido Schimmel <idosch@nvidia.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, Patrick McHardy <kaber@trash.net>, Hannes Frederic Sowa <hannes@stressinduktion.org>, netdev@vger.kernel.org X-Mailer: git-send-email 2.43.0 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