Article View: linux.kernel.netdev
Article #9960Re: [PATCH net v4] seg6: validate state in netfilter continuations
From: Andrea Mayer
Date: Mon, 02 Nov 2026 19:19
Date: Mon, 02 Nov 2026 19:19
57 lines
11983 bytes
11983 bytes
On Sat, 31 Oct 2026 11:26:44 +0800
Ren Wei <weir@nebusec.ai> wrote:
> From: Zixuan Chai <petalzu987@gmail.com>
>
> Netfilter hooks can replace or drop skb_dst() before SRv6 continuation
> callbacks resume. Validate the current destination and lwtstate in each
> hook continuation, dropping packets with missing or incompatible state
> while preserving direct no-hook paths.
>
> Fixes: 7a3f5b0de364 ("netfilter: add netfilter hooks to SRv6 data plane")
> Cc: stable@vger.kernel.org
> Reported-by: Vega <vega@nebusec.ai>
> Reported-by: Sashiko <sashiko-bot@kernel.org>
> Closes: https://sashiko.dev/#/patchset/20260720204430.1886091-1-xmei5@asu.edu
> Signed-off-by: Zixuan Chai <petalzu987@gmail.com>
> Signed-off-by: Ren Wei <weir@nebusec.ai>
> Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Hi,
The commit message still does not say how the crash is triggered, what
it causes, and how the fix was tested. The patch is tagged for stable,
and this information helps whoever picks it up there. The Sashiko
review of this version also asks for the trigger and the impact [1].
> [snip]
> +static struct lwtunnel_state *seg6_lwt_state_from_skb(struct sk_buff *skb)
> +{
> + struct dst_entry *dst;
> +
> + if (unlikely(!skb_valid_dst(skb)))
> + return NULL;
> +
> + dst = skb_dst(skb);
> + if (unlikely(!dst->lwtstate ||
> + dst->lwtstate->type != LWTUNNEL_ENCAP_SEG6))
> + return NULL;
> +
> + return dst->lwtstate;
> +}
Right now, the callers do not use the returned pointer. They only
check whether the dst still carries an lwtstate of the expected type.
As I mentioned on the v3, I think the two helpers should return bool,
for example seg6_skb_has_lwtstate()/seg6_local_skb_has_lwtstate().
Is there a reason to keep the pointer?
> [snip]
[1] https://netdev-ai.bots.linux.dev/sashiko/#/patchset/c9ec4da483c6c17dda703bcd6fc425ef2b53e320.1793207060.git.petalzu987%40gmail.com
Thanks,
Andrea
Technical Details
Message-ID:
<20261102201950.3cc03ae412787a8bbacedae0@uniroma2.it>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355018-linux-kernel-netdev=dewy.ruReferences:
<c9ec4da483c6c17dda703bcd6fc425ef2b53e320.1793207060.git.petalzu987@gmail.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-355018-linux-kernel-netdev=dewy.ru
From: andrea.mayer@uniroma2.it (Andrea Mayer)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v4] seg6: validate state in netfilter continuations
Date: Mon, 2 Nov 2026 20:19:50 +0100
Organization: Usenet Network
Message-ID: <20261102201950.3cc03ae412787a8bbacedae0@uniroma2.it>
References: <c9ec4da483c6c17dda703bcd6fc425ef2b53e320.1793207060.git.petalzu987@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="3041838"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:v0EsvEIkBmzyNEiWb7GoN22Pyc4= sha256:CG21E6mXFxAmkyM0Usx58U/8UOtgLAfATjjk5yg7diI=
sha1:t+U0xDWnVKkH3ztU5RgMe4TjF28= sha256:yfzzPxu7K4qJRbworiCR86q3lIgGuo6UYwFMUXpKSwI=
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 3C3E11126A7; Tue, 3 Nov 2026 01:08:37 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -4.774
X-Spam-Status: No, score=-4.774 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, NICE_REPLY_A=-1.724, 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=neutral
reason="invalid (unsupported algorithm ed25519-sha256)"
header.d=uniroma2.it header.b=t3AzeywR; dkim=pass (2048-bit key)
header.d=uniroma2.it header.b=bfCBnQcD
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 13p2ywxKd6Ct;
Tue, 3 Nov 2026 01:08:29 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-355018-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=uniroma2.it
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
by mail.dewy.ru (Postfix) with ESMTPS id 1F02711267F; Tue, 3 Nov 2026 01:08:15 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sin.lore.kernel.org (Postfix) with ESMTP id 0CCA53B038; Mon, 2 Nov 2026 19:20:58 +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=1793647257;
b=n3Y0KbhtDZ4FlYptVGoQJh0h8Spv87NqCelqZAiyAlOnX5vB0F+GdUInBXST11Ed7fjG
wNltEp+A/kX6NIY4ZYWUG1rk8PdLfSx7ko9KnRSHTNmqsiOot0VZoqXlU2da4R93HLIwL
ZriKNWOMyYWQC0I54kot2sh36O5/tatnZ5TXWDLZoWjyL9uRqaDnoAVpvsYKmK71R40ex
77c87I8DVJX5Pq1/qk/ScQ6Ufzh95zq3N2XN+Pl6kV+p00SqrLBk98PcmG5HgGSN4n7bT
LMQqBrZw/NXT7LdiPzOn1VScIwakugE4LRTo2N3cgLdc8zpjvS24XF8YTWuI62cP8Kg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793647257;
h=X-Original-To:Received:DMARC-Filter:Received:Received:DKIM-Signature:
DKIM-Signature:Date:From:To:Cc:Subject:Message-Id:In-Reply-To:
References:X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:
List-Subscribe:List-Unsubscribe:List-Owner:Precedence:Mime-Version:
Content-Type:Content-Transfer-Encoding:X-Virus-Scanned:
X-Virus-Status;
bh=gJOGge4aaLulSjcadcuAVrGsVwMeKac0qCTO8+iW3MU=;
b=y7tqCkepuzzDgCtKvpkg/F/CnMJoP20QWHh4KWKWJAb90uELHFweHd9a5QY9U/mUgGS5
dd7NXvu1OdPuMOIMWTBMMyAvtW/ihvbwx4JvrDKQLQWw6E4WWoHTw7eKqX59rQXgap9Qz
/LJU1dOYWOQk+WYKP0BxAcv8YpVaqEGVxzDoCAPIF0/ZSBsxdE4cihd5FLP7u27sfrLcu
NvwtEOEvBcOhy/Y9WCOA2VQXKYmxcFXjO6iJXjk9uRRiPJPWoEwGRY3bekecld9pwlolr
WNMvR9x+CT/e/Mpa5l3MJ4gkHXUJ7PCKdibKmOZcAB3cXpaBifEkP/XDh12LGoSDUwA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=uniroma2.it header.i=@uniroma2.it header.a=ed25519-sha256 header.s=ed201904 header.b=t3AzeywR;
dkim=pass header.d=uniroma2.it header.i=@uniroma2.it header.a=rsa-sha256 header.s=rsa201904 header.b=bfCBnQcD;
dmarc=pass header.from=uniroma2.it;
spf=pass smtp.mailfrom=uniroma2.it;
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 1F803606A324;
Mon, 2 Nov 2026 19:20:57 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass header.d=uniroma2.it header.i=@uniroma2.it header.a=ed25519-sha256 header.s=ed201904 header.b=t3AzeywR;
dkim=pass (2048-bit key, unprotected) header.d=uniroma2.it header.i=@uniroma2.it header.a=rsa-sha256 header.s=rsa201904 header.b=bfCBnQcD
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=160.80.4.36
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1793647255;
b=SO2GCLaxOMpjvDCzEfp2tKvnOn6bF/zohE+n/TjWrPubaDJOIM0aH0T6SmDGTJbjE6pz
xEB/S0RkcC1rnmMy5fy/QeXn8oTFsZir0LiDn3Jh3w+yrvcYCV96tWz1resgSJwav0wDm
dIbz/+Y3dg9EAf0H2gPhuBEaJNTmY+mzoU3x1uf904rRFqDaXymdgbKXlk/NhYYc90zas
Jes+vVEunoJJkydQEBvsDdzMz8N9TmqsjzjEqoUtLUh5PYz1qS1lWkdpnf+GwJyuTHAiU
ayAAI3uQk2R6DKuYHWsuwduwyw78w2+FpGfzCfjc1FhhgqWZUu034INpZYHvkKv5/xw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793647255;
h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature:Date:
From:To:Cc:Subject:Message-Id:In-Reply-To:References:X-Mailer:
Mime-Version:Content-Type:Content-Transfer-Encoding:X-Virus-Scanned:
X-Virus-Status;
bh=gJOGge4aaLulSjcadcuAVrGsVwMeKac0qCTO8+iW3MU=;
b=JSOXaXDPUHsPUbpfpvOe3tRBKq/INdCq21SWw0dpxYV3AxSQTv8LWT8DOUNZZrB33xGM
WQgcJ12kWuZYcZpIgITmQ2VQnkumHoDDKvYA/sClr/0h9lNvS1yCAgOiyl+O83yl4COg9
gQXDxFSIi8cG2WN/ESBdhDFzYhs7qq2hN7BNOw6B0seY9wOcvVg5srBebVwMcAkov3CCV
fcdOEcM6Eg1WefUOWe78QMmsXKrt2ojEUbiJDoWMqqT/UAAJq2nviBYZ2nXBF5+d6riRc
8/sm3Dy0hwoqVvMsakJhZ3cc/d0aBv8caRi7gu61OUCv7TUZn12uH0bWMQxXkUf1s3A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=uniroma2.it;
spf=pass smtp.mailfrom=uniroma2.it;
dkim=pass header.d=uniroma2.it header.i=@uniroma2.it header.a=ed25519-sha256 header.s=ed201904 header.b=t3AzeywR;
dkim=pass header.d=uniroma2.it header.i=@uniroma2.it header.a=rsa-sha256 header.s=rsa201904 header.b=bfCBnQcD;
arc=none smtp.remote-ip=160.80.4.36
X-Received: from smtp.uniroma2.it (smtp-2015.uniroma2.it [160.80.4.36])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 74030606A327
for <netdev@vger.kernel.org>; Mon, 2 Nov 2026 19:20:51 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 74030606A327
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniroma2.it
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=uniroma2.it
X-Received: from smtpauth-2019-1.uniroma2.it (smtpauth.uniroma2.it [160.80.5.46])
by smtp-2015.uniroma2.it (8.14.4/8.14.4/Debian-8) with ESMTP id 6A2JJuou028168;
Mon, 2 Nov 2026 20:20:01 +0100
X-Received: from lubuntu-18.04 (unknown [160.80.103.126])
by smtpauth-2019-1.uniroma2.it (Postfix) with ESMTPSA id 649AF1228D6;
Mon, 2 Nov 2026 20:19:51 +0100 (CET)
X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=uniroma2.it;
s=ed201904; t=1793647192; h=from:from:sender:reply-to:subject:subject:date:date:
message-id:message-id:to:to:cc:cc:mime-version:mime-version:
content-type:content-type:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references;
bh=gJOGge4aaLulSjcadcuAVrGsVwMeKac0qCTO8+iW3MU=;
b=t3AzeywR5+y1kZoChyiEMEiMLbPxc7pQKh2pCCItFQzVAvK26AdhKjTRTus/s9RZ5MHSNm
9R+AMxJfOPYoCvDw==
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniroma2.it; s=rsa201904;
t=1793647192; h=from:from:sender:reply-to:subject:subject:date:date:
message-id:message-id:to:to:cc:cc:mime-version:mime-version:
content-type:content-type:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references;
bh=gJOGge4aaLulSjcadcuAVrGsVwMeKac0qCTO8+iW3MU=;
b=bfCBnQcDFzuSOU0m97IRajxRBkV5sE+faOiT0T+aicA0y13aI+C9La47KgS3Le3sEjk8R6
NXud74m/7XwQlvN3vj8WplRO4ctL8DAUVVwPG8DY4N21b6bXsSxzKV5+2sRS6Etmtg23aU
mwlwEQdr4FG5SaNhAq2kJrxxR1CHJuow3s7eb+ZEHKnoIw9GyTEdlyrDfMw50WG3AOcM+y
W+smPJvFQ+VbMYvHvBVjZxitecQSwkmnZzUFgq9oWerQmJZ40Kd/1ziY5JJpenpc+Ea9+2
8o66d/Q6XfdOiMNby4U8yX67lAUD+qD5lzduiaXOt+4vAkIW93PEEXZOPYpEFA==
X-Cc: pabeni@redhat.com, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, horms@kernel.org, pablo@netfilter.org,
contact@proelbtn.com, vega@nebusec.ai, sashiko-bot@kernel.org,
petalzu987@gmail.com, liuhangbin@kylinos.cn,
Stefano Salsano
<stefano.salsano@uniroma2.it>,
Hangbin Liu <hangbin.liu@linux.dev>, netdev@vger.kernel.org,
andrea.mayer@uniroma2.it
X-In-Reply-To: <c9ec4da483c6c17dda703bcd6fc425ef2b53e320.1793207060.git.petalzu987@gmail.com>
X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu)
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-Virus-Scanned: clamav-milter 0.100.0 at smtp-2015
X-Virus-Status: Clean