🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #10644

[PATCH nf-next] netfilter: flowtable: tunnel device poisons h_source of fast-path frames

#10644
From: Marek Majkowski
Date: Tue, 03 Nov 2026 21:34
71 lines
14575 bytes
When a flow enters an IP tunnel, the forward path discovered by
dev_fill_forward_path() starts with a DEV_PATH_TUN entry for the tunnel
device, followed by whatever carries the outer packet.
nft_dev_path_info() handles DEV_PATH_TUN in the same switch case as the
Ethernet-like path types and copies path->dev->dev_addr into
info->h_source if it is still unset. For a tunnel device dev_addr is not
an Ethernet address: ip6_tunnel stores the 16-byte local IPv6 there and
ip_tunnel the 4-byte local IPv4. The tunnel entry is the first one on
the path, so its "address" wins and poisons h_source: every fast-path
frame is transmitted with the first bytes of the tunnel local IP address
as the Ethernet source MAC.

Seen on a DS-Lite setup, LAN -> ip6tnl (IPv4 inside IPv6) -> PPPoE ->
802.1Q VLAN -> Ethernet, with conntrack flows offloaded through an
nftables flowtable ('flow add @ft'). The first packets of a flow, still
on the slow path, and the fast-path packets of the same flow differ only
in the Ethernet source address:

  slow path:  d8:58:d7:00:2e:bd > 80:ac:ac:39:ef:c2, 802.1Q vlan 35,
              PPPoE [ses 0x454] IP6 2a01:110f:4328:c400::1 >
              2a01:1000:0:1::2216 next-header IPIP, 192.0.0.2.40010 >
              1.1.1.1.53
  fast path:  2a:01:11:0f:43:28 > 80:ac:ac:39:ef:c2, same frame otherwise

As you can see 2a:01:11:0f:43:28 is the start of 2a01:110f:4328:c400::1,
the tunnel local address. The PPPoE endpoint binds the session to the
subscriber MAC and silently drops the frames, the effect is that every
TCP/UDP flow dies the moment it is offloaded, while ICMP, which is never
offloaded, keeps working. Received traffic is unaffected.

Do not let DEV_PATH_TUN poison h_source: skip the assignment for it. The
real link-layer device appears later on the same path and provides the
correct address; for a path with no Ethernet device the address stays
zero as before.

Fixes: ab427db17885 ("netfilter: flowtable: Add IPIP rx sw acceleration")
Signed-off-by: Marek Majkowski <marek@lysk.ai>
---
Found while testing this series on a Turris Omnia (Debian, armhf) behind
a DS-Lite ISP: with the series applied, IPv4 flows through the ip6tnl
were offloaded but no fast-path frame ever got past the PPPoE
concentrator. The problem is in the existing DEV_PATH_TUN handling, so
it applies to net-next with or without this series; with the fix the
series works here (tested: UDP flows with a fixed source port, TCP, bulk
downloads through the tunnel). Without the series the same wrong MAC
should affect ipip and ip6ip6 tunnels in front of PPPoE.

 net/netfilter/nf_flow_table_path.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nf_flow_table_path.c b/net/netfilter/nf_flow_table_path.c
index 841f09943..4ca6e09c7 100644
--- a/net/netfilter/nf_flow_table_path.c
+++ b/net/netfilter/nf_flow_table_path.c
@@ -121,7 +121,12 @@ static int nft_dev_path_info(struct net_device_path_stack *stack,
 		case DEV_PATH_PPPOE:
 		case DEV_PATH_TUN:
 			info->dev = path->dev;
-			if (is_zero_ether_addr(info->h_source))
+			/* A tunnel device has no Ethernet address: its dev_addr
+			 * is the tunnel local IP address. Take h_source from the
+			 * real link-layer device further down the path.
+			 */
+			if (path->type != DEV_PATH_TUN &&
+			    is_zero_ether_addr(info->h_source))
 				memcpy(info->h_source, path->dev->dev_addr, ETH_ALEN);
 
 			if (path->type == DEV_PATH_ETHERNET ||
-- 
2.39.5
Technical Details
Message-ID: <20261103213430.2850-1-marek@lysk.ai>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355984-linux-kernel-netdev=dewy.ru
References: <20261101-flowtable-sw-accel-ip6ip-sit-v2-0-c6c282cab5cb@oss.qualcomm.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355984-linux-kernel-netdev=dewy.ru
From: marek@lysk.ai (Marek Majkowski)
Newsgroups: linux.kernel.netdev
Subject: [PATCH nf-next] netfilter: flowtable: tunnel device poisons h_source of fast-path frames
Date: Tue,  3 Nov 2026 21:34:29 +0000
Organization: Usenet Network
Message-ID: <20261103213430.2850-1-marek@lysk.ai>
References: <20261101-flowtable-sw-accel-ip6ip-sit-v2-0-c6c282cab5cb@oss.qualcomm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3266020"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:JTH36YktmX5lJcSKnkQBENc/jIc= sha256:OlTtu+1nF5m/c3MVHlvOjQ+gqp5BHCiEesbqBua20jE=
	sha1:6qrGhwl3ARH+jaujGpS1U+8HXeQ= sha256:1uRxwHeeuxQqABigg1xPbXGfR8p3weV7BkkprqWOSIQ=
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 1E6B3112A1B; Wed,  4 Nov 2026 00:35:32 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 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,
	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=pass (2048-bit key)
	header.d=lysk.ai
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 fPU4BTjEs-_Q;
	Wed,  4 Nov 2026 00:35:29 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-355984-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=lysk.ai
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id B03D2112032; Wed,  4 Nov 2026 00:35:20 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 83D5527EF0; Tue,  3 Nov 2026 21:35:12 +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=1793741709;
	b=UohSZP9D6cz9tEahb6Kzzf+SHrNISkyIP3hW6e/oRMAJaocDCk/qTQY0qT1ufQNRwXSw
	 qeWpKlZXRePDg/2ndD0/51o23p2sbjw8BGOnDzKdEVCPIdg+0Tiod5tdmHzMTa3wgeETB
	 goPDEA75KbXxEK1VA9+/pPI/Izyu11QLmEEtQ6TGP60P/QjSK/gFfV7uZe/XxVJ4MHwQ7
	 KI1qcMwKcPVUmKR5c+r2RCKvfee1tP8DBI+AfxbEWvurWz2Nbsh3GCjQcIV9Syf0aOS35
	 KjmO93YC8at4Ec7aofaXr4thaqhsUXqNBIdgiqQavUI6OpECcbWPyOhUltI3sQBz30w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793741709;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received: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=2/Oq2yxr5c36O2jrWUkxKvnaxXC/ugdrj8Dp7ILTXKU=;
	b=N6hUt5QxarGPRvnxxOx4jPryzUIbET1klguD8tHqTKt8oiGeEzIdC6dPGFdC5GMgLmnO
	 5QM6e/1U8dzQGRcod8hqGV3vHeO0jFHKUudTfYlbZGjXzJek5WSNRBJYlIOJ10EwSgaan
	 JOOk4sSRprLEFtOkwERft+GDkogJvrDFisEQM++3cB4Duv8clj/DVpS1d4rI3aRZpvbJ2
	 psweQIhac+r3tQDdTIAwBgiZoLLQaPMUsq3ZSp0dnT1+9sI7uFtfnNB06Ud1IjkePZwMC
	 554MWQaH2W6KmWt7iHezDDJO5HT56vQ/sFRKqa2gX2q98mR0EK0f8s/m3X3ofLMsNpA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=lysk.ai header.i=@lysk.ai header.a=rsa-sha256 header.s=google header.b=SujUWrcy;
	dmarc=none header.from=lysk.ai;
	spf=pass smtp.mailfrom=lysk.ai;
	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 36645606A324;
	Tue,  3 Nov 2026 21:35:09 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=lysk.ai header.i=@lysk.ai header.a=rsa-sha256 header.s=google header.b=SujUWrcy
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.43
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793741708;
	b=UTJoiRTTSRO76gna7rpbWrn1IO1joJOVg0Vs89rf7+ZWB6fkz3J/i8UY1+0yvsNXBori
	 uKBY4DMwB61wt2kkn+eIo/+NGEuk8HpockBu7gYZiGcFR+OR5E3Ed4+atTj0wo4kRULJy
	 R1Mt7ADu0dHu0GLIkYPPfc1Wj0Ihz4GcrFwTFPTHZDHpojJdYQFakkLkOC9DhCx6nKpM+
	 x8djritXfkNr0d+H9T5/wPLngZM7LyUdsjVli5EREw/HrOc+osPuWK4rEC8EkqNLqgKTT
	 eOaR3rQW18PAwxqHZYlNvIJxEgyirrDH+zMAq+oQgKUXf65qogr07jiga9W8To87cGA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793741708;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
	 From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
	 MIME-Version:Content-Transfer-Encoding;
	bh=2/Oq2yxr5c36O2jrWUkxKvnaxXC/ugdrj8Dp7ILTXKU=;
	b=NealTsJXgbRfV7x29A86Fip4WSftoc5wKDsvka3BMzMX5CSEeViJWC8MHk/rC6oMqJ5+
	 1XNGpeXU1YwnaRzThtVMRTthvpcsbiQGeLBNWpP+334CvlzIU7UTNTms9eU+hCneC10+c
	 1XDdHJz83SFNOMdBrgRI8zBiluX3FRVnd99qgdCLiuP45BxWzE7uKoG4NinrHuby4uS8/
	 +U5ZAc1l41920+Mq/SmyI8g/g5TlPSBBARMjK/Dc67VNywKS2ZfuSdo2CJwDpUP/681ED
	 xhdySR5Y+GukEhBdIxYjvQstcHDmxNZolUUh8ggQD9WlbDb5Y0JyCSAn3hjEUetbqIg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=lysk.ai;
	spf=pass smtp.mailfrom=lysk.ai;
	dkim=pass header.d=lysk.ai header.i=@lysk.ai header.a=rsa-sha256 header.s=google header.b=SujUWrcy;
	arc=none smtp.remote-ip=209.85.218.43
X-Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43])
	(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 DA0BF606A31B
	for <netdev@vger.kernel.org>; Tue,  3 Nov 2026 21:35:07 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DA0BF606A31B
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lysk.ai
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lysk.ai
X-Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-c445c95d553so8339866b.1
        for <netdev@vger.kernel.org>; Tue, 03 Nov 2026 13:35:07 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=lysk.ai; s=google; t=1793741706; x=1794346506; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=2/Oq2yxr5c36O2jrWUkxKvnaxXC/ugdrj8Dp7ILTXKU=;
        b=SujUWrcyDIB78G9Ozq452zDuE/vNNQ0L+EvDHuP97QxnmqaVgqUJxaftfA5bXLdw9V
         jen9UVfmbKSuCXux5S10rKPyWAHWlB3F7cAKcN+WfkyDHzjUdaVHdDNfu34lkljpTr4B
         A8LWur6Q4HbENP4vMYSsW00CI0LprtvhzTnQfMFHu8AO1WVbbTG6625aebOepiggqBvR
         0OT5wublgFG6JLbRrciz+bJwM9/OwpHAn9RIiFIc6utz5ai0IK/dx99fKlvXbNpB4HQm
         4Fj+nK9awyGJMhLQttYxO19my2qLxj7gmXhxJRZfZ5AFsBmtIE7V7xUHCjDhz/ElvPMo
         wMkw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1793741706; x=1794346506;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=2/Oq2yxr5c36O2jrWUkxKvnaxXC/ugdrj8Dp7ILTXKU=;
        b=q722nbfDMZuBU/JkqHscIQuyjt/2jaTZhIV5JAzBe/bsXbV/B2nvD2gTGYA0F773ie
         zXi8I/WgM84yb40bjWOlTEQZCXoBnS/ONwfQ65KBP0owJC4Hu0JAN+1RxoFPcSzaU9sE
         9lreEG3sVgGDdBrccoJEoiIWRpA6O30t+y/ilQY2IWFo1SH9ksnpLm4We3W53iz7+dNJ
         fPcycg7tsoZLgJ2KyFhT1MEJb6OmmO03feZe+M/RsIb6xVQKbN5/3PdrjicnDspqv/9v
         K8UbVTLtLBTsBZQT00vWLIh80m1c+ri771c5M74tZYTELLtrPE7zz8fCUCVdueamap/K
         L8Sg==
X-Forwarded-Encrypted: i=1; AKwUvBzDH4dYpNnepFV/CzZ7okoEUQj4Rs/DXLazs1sUha1R0BuCgHTi41f2LQdQE6/6VMr+deFa51Q=@vger.kernel.org
X-Gm-Message-State: APuU4Z9uzfUPYQkBC6z4QCNcaBjxZtmT0IZYyr0SvPeV7uMLUGtvWekc
	Fqcg0h8OY5XiUlZapyr9Z4phG70Zv1cvzv8mHt5MpxHW9JWz90INzS48pT94Z/i0tHko
X-Gm-Gg: AYBFou3KAs5IE+Yi/z+8fZSC24nM8KF5a+2DBHXbOxA/8VbSEDVLeKYwquKX3pt0BAP
	gBI1AXLG6YL1kEsPETh503nPap3WqZZKJ1YZyk+SluZWW162e7wzRAnI4zLJicBO2a17wOZgt61
	rgQO5nFfiUn+v62S1bgMXobgrtZuZ1tWWTG6HWUB+8ksmfsQ54puAce+SztTcX3wB4AqUyZgMW1
	yawc7v2Ya+o9d2fLvH7zsUfjnAMrNJcjV97DNCDR/VQZOlfy77b3KNul1AIf/HGsKemNrlIxkrU
	e0kvV1YIyBFnHciCZrp0J+096KuwisbU1g6weknUy9i92c/aJPXHnxMunRHzbZGoQk74DL+ISeg
	9Z/Yq6zsVF1aFrXWu5oCZCKrZbZFUCSGN6MGTZY4SxhQpNR59GFQ0P+wsbmMcDXDdYzQEIrZWMM
	yjBvdfG7Rac2CZK/6SaouxhGyhYxdpRxgVTEdemUY4hUjWUl0/CjBSM1If72ZlX2FMi+/Nz6+zl
	RuFopidQ2WOQx+OhcxWcCsQhZnbf79ALNrNkIjPVFOTWSSt3S9UqqA2HXH/KJAuisq6bMovLtLs
	qfBq8ZroxIrIJYrbbnYLlQ1ke2LtdzOV85bk1gsh/HkrLhXzDwma/GmEabknlDDiPjigQxKV9+2
	srqsiT28rFsZziUroeOAi3yzVz7XB+Q7dq644fMjV/ibc67dkNxBRMRv2/LTZ0Dwnd2OoVpwXcA
	z4I9R/nV2jpfthrgS+2yfeSofn1zTKeDP8GaFx8r7mx2daZmWX1KDUMrpSFnbwZcM2uTuxiH3AH
	NCvwuxVDVyhU+D0YiXMaNc7mnaAPjGRX4lbJg==
X-Received: by 2002:a17:907:724a:b0:c46:645f:cee1 with SMTP id a640c23a62f3a-c4ca7ae41ebmr1308021766b.42.1793741706083;
        Tue, 03 Nov 2026 13:35:06 -0800 (PST)
X-Received: from turris.internal.popcount.org (2a01-110f-4328-c400-0000-0000-0000-0001.aa.ipv6.supernova.orange.pl. [2a01:110f:4328:c400::1])
        by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c4d0e46a465sm2548766b.58.2026.11.03.13.35.05
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 03 Nov 2026 13:35:05 -0800 (PST)
X-Cc: Marek Majkowski <marek@lysk.ai>,
	netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org,
	netdev@vger.kernel.org,
	Phil Sutter <phil@nwl.cc>
X-Mailer: git-send-email 2.47.3
X-In-Reply-To: <20261101-flowtable-sw-accel-ip6ip-sit-v2-0-c6c282cab5cb@oss.qualcomm.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