From: Andrea Mayer <andrea.mayer@uniroma2.it>
To: Zhiling Zou <zhilinz@nebusec.ai>
Cc: Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, horms@kernel.org, david.lebrun@uclouvain.be,
vega@nebusec.ai, zhilinz@nebusec.ai,
Andrea Mayer <andrea.mayer@uniroma2.it>
Subject: Re: [PATCH net v2 1/1] seg6: reset IP6CB after IPv6 decapsulation
Date: Mon, 24 Aug 2026 16:53:14 +0200 [thread overview]
Message-ID: <20260824165314.67079bfe835db90806b1acf6@uniroma2.it> (raw)
In-Reply-To: <83541e78b0eb0d5adc169a318a51e3055f6bf820.1787388261.git.zhilinz@nebusec.ai>
On Sat, 22 Aug 2026 16:49:27 +0800
Zhiling.Zou.zhilinz@nebusec.ai wrote:
> From: Zhiling Zou <zhilinz@nebusec.ai>
>
> decap_and_validate() pulls the outer SRv6 headers and makes the inner
> packet the skb network header. The IPv6 control block still contains
> values collected while parsing the outer packet, including nhoff and
> extension-header flags.
>
> End.DX6 and End.DT6 route the inner IPv6 packet directly to the IPv6
> input path. An unprivileged user can reach End.DT6 from a user and net
> namespace by installing a local SID and injecting an outer packet with
> Hop-by-Hop and Destination Options headers followed by an SRH and a
> minimal inner IPv6 packet.
>
> The outer extension headers leave a large nhoff in IP6CB. After
> decapsulation, ip6_protocol_deliver_rcu() uses that stale offset on the
> inner packet and reads beyond the skb head. KASAN reports:
>
> BUG: KASAN: slab-out-of-bounds in ip6_protocol_deliver_rcu
> ip6_protocol_deliver_rcu+0x1118/0x1450
> ip6_input_finish+0x11b/0x240
> seg6_local_input_core+0xed/0x2e0
> lwtunnel_input+0x1e9/0x4e0
> ipv6_rthdr_rcv+0x525f/0x6c50
> ip6_protocol_deliver_rcu+0xcb7/0x1450
>
> Before clearing IP6CB for an inner IPv6 packet, save its incoming
> interface index and L3 slave state. Restore both after the clear and set
> nhoff to the inner IPv6 base-header nexthdr field.
>
> Use IP6CB(skb)->iif rather than skb->skb_iif because VRF processing can
> replace skb_iif with the L3 master while IP6CB keeps the receiving
> interface. Preserve IP6SKB_L3SLAVE for the same reason.
>
> Fixes: d7a669dd2f8b ("ipv6: sr: add helper functions for seg6local")
> Cc: stable@vger.kernel.org
> Reported-by: Vega <vega@nebusec.ai>
> Signed-off-by: Zhiling Zou <zhilinz@nebusec.ai>
> ---
> changes in v2:
> - Preserve the ingress index from IP6CB instead of using skb->skb_iif.
> - Preserve IP6SKB_L3SLAVE across the IPv6 control-block reset.
> - Place the IPv6 reset next to the merged IPv4 reset.
> - Add reachability and the relevant KASAN call chain to the commit log.
> - v1 Link: https://lore.kernel.org/all/6a236dcc43d141a9105e8ee1b84bcccc628d83b0.1786894895.git.zhilinz@nebusec.ai/
>
In the mail I received, the From header is Zhiling.Zou.zhilinz@nebusec.ai,
which is not the address you sign with.
From what I see, patchwork records it without the angle brackets too.
The patch looks good to me.
Reviewed-by: Andrea Mayer <andrea.mayer@uniroma2.it>
next prev parent reply other threads:[~2026-08-24 14:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-22 8:49 [PATCH net v2 0/1] seg6: reset IP6CB after IPv6 decapsulation Zhiling
2026-08-22 8:49 ` [PATCH net v2 1/1] " Zhiling
2026-08-24 14:53 ` Andrea Mayer [this message]
2026-08-24 16:10 ` Andrea Mayer
2026-08-26 8:40 ` [PATCH net v2 0/1] " patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260824165314.67079bfe835db90806b1acf6@uniroma2.it \
--to=andrea.mayer@uniroma2.it \
--cc=davem@davemloft.net \
--cc=david.lebrun@uclouvain.be \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vega@nebusec.ai \
--cc=zhilinz@nebusec.ai \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox