🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26228

[PATCH v4 0/2] netfilter: Fix stale outer UDP checksum on VXLAN encapsulated packets

#26228
From: lvjunyu
Date: Thu, 03 Dec 2026 09:05
47 lines
10814 bytes
VXLAN and other UDP tunnels can carry locally generated packets whose
outer UDP header holds a complete checksum in the LCO (Local Checksum
Offload) state: the skb is CHECKSUM_PARTIAL and non-GSO, but csum_start
points at the inner transport header rather than at the outer udphdr.
When NAT rewrites the outer header of such a packet, the incremental
checksum helpers either update a value the NIC later recomputes from a
stale seed, or skip the update entirely, so the peer receives packets
with a bad outer checksum and drops them.

This series fixes both NAT paths such a VXLAN flow can take:

Patch 1 fixes the classic conntrack NAT path (__udp_manip_pkt()).
Patch 2 fixes the flowtable software fastpath, which a flow enters
once its conntrack entry is offloaded, and which would otherwise keep
corrupting the outer checksum of every packet after offload even with
patch 1 applied.

Testing (netns + veth + vxlan + iptables MASQUERADE --random-fully):
without the fix, the first TCP connection through the tunnel always
paid a ~1s SYN retransmit because the SYN-ACK was dropped for a bad
outer UDP checksum; with this series applied the first SYN succeeds
and no bad outer checksum is observed.

---
Changes in v4:
- Patch 2 is new: it extends the same LCO fixup to the flowtable
  fastpath (nf_flow_nat_ip_udp(), nf_flow_nat_ipv6_udp() and
  nf_flow_nat_port_udp()).
- Patch 1 is unchanged compared to v3.

v3: https://lore.kernel.org/netfilter-devel/20261008054228.752274-1-lvjunyu@cmss.chinamobile.com/
v2: https://lore.kernel.org/netfilter-devel/20260921130312.686493-1-lvjunyu@cmss.chinamobile.com/
v1: https://lore.kernel.org/netfilter-devel/20260920074543.525572-1-lvjunyu@cmss.chinamobile.com/

lvjunyu (2):
  netfilter: nf_nat: Fix stale outer UDP checksum on VXLAN encapsulated
    packets
  netfilter: nf_flow_table: Fix stale outer UDP checksum in the fastpath

 net/netfilter/nf_flow_table_core.c | 16 ++++++++++++++
 net/netfilter/nf_flow_table_ip.c   | 34 ++++++++++++++++++++++++++++++
 net/netfilter/nf_nat_proto.c       | 30 ++++++++++++++++++++++++++
 3 files changed, 80 insertions(+)

-- 
2.43.0
Technical Details
Message-ID: <20261203090554.158077-1-lvjunyu@cmss.chinamobile.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer04.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376424-linux-kernel-netdev=dewy.ru
References: <20261008054228.752274-1-lvjunyu@cmss.chinamobile.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer04.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376424-linux-kernel-netdev=dewy.ru
From: lvjunyu@cmss.chinamobile.com (lvjunyu)
Newsgroups: linux.kernel.netdev
Subject: [PATCH v4 0/2] netfilter: Fix stale outer UDP checksum on VXLAN encapsulated packets
Date: Thu,  3 Dec 2026 17:05:51 +0800
Organization: Usenet Network
Message-ID: <20261203090554.158077-1-lvjunyu@cmss.chinamobile.com>
References: <20261008054228.752274-1-lvjunyu@cmss.chinamobile.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="2443779"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:zpV/9oGXj4eqmCpUXirzn2P+deU= sha256:TNtgsJqoCZNhMYW+ksFUIADa+2FpRWCZhApjYoRQGdg= sha1:TVMdszOtqqyRJYj5Za8vrUS4/BQ= sha256:oY/HmBbmVlFhmIZlS2Q/LzOyQMXol/EGXP9iCaumxMI=
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 5567B117890; Thu,  3 Dec 2026 12:06:55 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.751
X-Spam-Status: No, score=-2.751 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=fail (1024-bit key) reason="fail (body has been altered)" header.d=cmss.chinamobile.com
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 oXc0jkJFDPnf; Thu,  3 Dec 2026 12:06:49 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376424-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=cmss.chinamobile.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 6391411786F; Thu,  3 Dec 2026 12:06:38 +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 4187826A9E; Thu,  3 Dec 2026 09:06:37 +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=1796288796; b=nBqiqWs+EjYxawqWfnDYOwM4pIkhKRYcYEAN/5lpONYEN8Q33aASpygyxWEzMtK7suCr w2ErPAn6N4EIyJtd0cOHXkg2LkM8UCXT4S4frfdlozQaYDtjm8OnUqJgMeFP0ISEAfHrz rHnVpvBsaMrinOdPVVbWxiaRLRxFNdgYrqlp1+JwadEYvLQPbqVSzuhjrQNTaya3IdQ8d fiaZBbEnQmzvaMPy5H6SmxX7X+vNb/rkEuRAitqATd0CyCQ7zgaLu8aQvVKOltqJezdnW cWTswTrHaNDfg6CFo2WJURGNUdwKYsRmBeRr4+1Ohziunil1DL9pvOvtjO9zR1esQAw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796288796; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:X-RM-TagInfo: X-RM-SPAM-FLAG:Received:X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG: Received:X-RM-TRANSID:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=D/FcfoGEwhFqZvDs8yCjH8gLSphF+RkyqwM2boZH3Jc=; b=uYQqLOdfUWhdvRWUjRLvGThNZzqSAalkpKrszhIXBFeEZ6TZIKXGIn2I1YgdjITHIvlA fTyTEswPI9qWZ34KThryuyb1g1s9nvT06MLfFQttX64ZcPkNLccD59uK9KFuczI8WmQxP 0Jkhg9O3Rgv2e1PvzudQ9BWFsSj29JYdYtWnOZ8zlFxyxCAQyQFWA2wBfsKtR1hTBM6W3 m3+Gjw8c1Q1ixFnfWNtJ0NyCIOnMgA5fS290St0ryJmMePfS6p3N/p5h29n7qWyCKhxIf tj3XaTkblFYTYCK6nWG+mFc1DDdO4DXJujCc1kYcnZKVMA4IXdlPYexQoV0prP5wHUA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=Nr0IwmTx; dmarc=pass header.from=cmss.chinamobile.com; spf=pass smtp.mailfrom=cmss.chinamobile.com; 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 9F308606A336; Thu,  3 Dec 2026 09:06:36 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=Nr0IwmTx
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=111.22.67.137
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796288795; b=PWSc3uNAdOwMj1dwvWiC8JleQViKLABO9LSVIH8EcveALaMFNJJSqL+DG9cTt1Q7/EmG Oe93vxw3V1bm9sNPfAuzuOnw5EQscXTkuYJTRHOXHcBzYvqotFIz2209bQYC5I9+fDd/f 6eFcgTL9osGbK66h06138dKyw1SWLuF602AABIr15gi4WEa7OhfVjJX8SLUDJUeyQW6ud KzsDP6yQVNHRDnABgIkQ8IZMC607V94bjVa2iDpF/sG8bwjQRxzMs1NED38l4LPQEnYMR t1SCnqhIIj93K6mQBrujmskRC3ItrtAA4bWYsaHEmxs7OtmUSQvIyT8Y1LmcfF+5TPQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796288795; h=DMARC-Filter:DKIM-Signature:X-RM-TagInfo:X-RM-SPAM-FLAG:Received: X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG:Received:X-RM-TRANSID:From: To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=D/FcfoGEwhFqZvDs8yCjH8gLSphF+RkyqwM2boZH3Jc=; b=sE/KfPG6aywWN4ZK+4pr7Z5BImOpH2GB2Cb2BMTAuoViq9PODOus0KzCEZFMzMVWvRAP Z2Vq558y0j1Higlx97XHtUUAvEXW7RTZLX8yZ+kjAPncD2aYC1JAnVwjPDXWAcBkasAdG KBRbOnmUhykdrmkadwi/dV5y3FtXeB36X/+GqbO5KiLLvNhIROwHdTBgHuzx8YZaXDBxo 5aziMU0zLnLXeSzXC9uLf6Pdcn1SRIusaRHVf86LpM3l/CkSDLbSgwFD5tMYDuwW2Kxow 6pUFDgBY7vQXV7pXFFintQbQHLugXvV2RRugwqkbwIr5lA3PfMFGUGHsvo/xphQ5jOA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=cmss.chinamobile.com; spf=pass smtp.mailfrom=cmss.chinamobile.com; dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=Nr0IwmTx; arc=none smtp.remote-ip=111.22.67.137
X-Received: from cmccmta4.chinamobile.com (cmccmta4.chinamobile.com [111.22.67.137]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD59E606A322; Thu,  3 Dec 2026 09:06:32 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CD59E606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmss.chinamobile.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmss.chinamobile.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmss.chinamobile.com; s=default; l=0; h=from:subject:message-id:to:cc:mime-version; bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=; b=Nr0IwmTxJLAT/KGR8/udRBbS6JcNnoSMiXdGl5VgoqS/zakxhGxlJtJlXleZFBlhkrvcrzOyTYPCT rZbNbulTWvS597hpatM5dM5S3Dh37da2CYUvtADCYoerulOeb/yMcDrwjYRlT2nwtyYv0jH5HHQkgq e41WlHAFQPmXAbLk=
X-RM-TagInfo: emlType=0
X-RM-SPAM-FLAG: 00000000
X-Received: from spf.mail.chinamobile.com (unknown[10.188.0.87]) by rmmx-syy-dmz-app04-12004 (RichMail) with SMTP id 2ee46b113116455-3a272; Thu, 03 Dec 2026 17:06:30 +0800 (CST)
X-RM-TRANSID: 2ee46b113116455-3a272
X-RM-TagInfo: emlType=0
X-RM-SPAM-FLAG: 00000000
X-Received: from localhost.localdomain (unknown[223.108.79.102]) by rmsmtp-syy-appsvr01-12001 (RichMail) with SMTP id 2ee16b11310a2f6-6529a; Thu, 03 Dec 2026 17:06:30 +0800 (CST)
X-RM-TRANSID: 2ee16b11310a2f6-6529a
X-Cc: fw@strlen.de, phil@nwl.cc, netfilter-devel@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, lvjunyu <lvjunyu@cmss.chinamobile.com>
X-Mailer: git-send-email 2.43.0
X-In-Reply-To: <20261008054228.752274-1-lvjunyu@cmss.chinamobile.com>
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
X-Received-Bytes: 10413