From: Fernando Fernandez Mancera <fmancera@suse.de>
To: Ren Wei <weir@nebusec.ai>,
netdev@vger.kernel.org, bpf@vger.kernel.org, edumazet@kernel.org
Cc: dsahern@kernel.org, idosch@nvidia.com, davem@davemloft.net,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
joe@wand.net.nz, ast@kernel.org, kafai@fb.com, vega@nebusec.ai,
petalzu987@gmail.com
Subject: Re: [PATCH net v2 1/1] ipv6: defrag: orphan skb before queuing
Date: Fri, 2 Oct 2026 12:41:24 +0200 [thread overview]
Message-ID: <816f2ae9-e436-4b0b-ad1e-5f6067f69d70@suse.de> (raw)
In-Reply-To: <5c396b7011168cd98b9812df4d6bbd00a96048e7.1790850176.git.petalzu987@gmail.com>
On 10/2/26 11:25 AM, Ren Wei wrote:
> From: Zixuan Chai <petalzu987@gmail.com>
>
> IPv4 and nf_conntrack fragment queues orphan skbs before returning
> -EINPROGRESS, but ip6_frag_queue() leaves the socket association intact.
>
> A socket installed by bpf_sk_assign() may use SOCK_RCU_FREE and be released
> while its fragment remains queued. The skb destructor can then dereference
> a stale socket pointer.
>
> Orphan the skb before returning -EINPROGRESS so the queued fragment no
> longer retains the socket association.
>
> Fixes: cf7fbe660f2d ("bpf: Add socket assign support")
> Cc: stable@vger.kernel.org
> Reported-by: Vega <vega@nebusec.ai>
> Assisted-by: LLM
> Signed-off-by: Zixuan Chai <petalzu987@gmail.com>
> Signed-off-by: Ren Wei <weir@nebusec.ai>
> ---
> net/ipv6/reassembly.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
> index 05c51f669754..a7964125c764 100644
> --- a/net/ipv6/reassembly.c
> +++ b/net/ipv6/reassembly.c
> @@ -232,6 +232,7 @@ static int ip6_frag_queue(struct net *net,
> }
>
> skb_dst_drop(skb);
> + skb_orphan(skb);
> return -EINPROGRESS;
>
> insert_error:
Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
Thanks,
Fernando.
prev parent reply other threads:[~2026-10-02 10:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 9:24 [PATCH net v2 0/1] ipv6: defrag: orphan skb before queuing Ren Wei
2026-10-02 9:25 ` [PATCH net v2 1/1] " Ren Wei
2026-10-02 10:39 ` Eric Dumazet
2026-10-02 10:41 ` Fernando Fernandez Mancera [this message]
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=816f2ae9-e436-4b0b-ad1e-5f6067f69d70@suse.de \
--to=fmancera@suse.de \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=joe@wand.net.nz \
--cc=kafai@fb.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petalzu987@gmail.com \
--cc=vega@nebusec.ai \
--cc=weir@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