🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Andrea Mayer Mon, 02 Nov 2026 19:19
Re: [PATCH net v4] seg6: validate state in netfilter continuations
#9960
Author: Andrea Mayer
Date: Mon, 02 Nov 2026 19:19
57 lines
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads