All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	Christian Hopps <chopps@labn.net>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>, <netdev@vger.kernel.org>,
	<ipsec@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
	<syzbot+622de7e1f18a30fc404a@syzkaller.appspotmail.com>
Subject: Re: [PATCH ipsec] xfrm: iptfs: force a dst reference before queueing an skb
Date: Mon, 23 Nov 2026 12:23:35 +0100	[thread overview]
Message-ID: <awQiN-6b40NOCVFV@gauss4> (raw)
In-Reply-To: <20261115132611.427311-1-ngocthang2710.1999@gmail.com>

On Sun, Nov 15, 2026 at 08:26:11PM +0700, Nguyen Ngoc Thang wrote:
> iptfs_output_collect() is the dst->output hook and runs under the
> caller's RCU read lock. It queues the skb and sends it later from the
> iptfs hrtimer. The skb may still carry a noref dst, e.g. one set by
> __ip_queue_xmit() via skb_dst_set_noref(). Once the RCU section ends,
> nothing keeps that dst alive.
> 
> When the timer fires, xfrm_output_one() calls skb_dst_force() outside
> any RCU section:
> 
>   WARNING: include/net/dst.h:326 at xfrm_output_resume+0x41d9/0x64e0
>   Call Trace:
>    xfrm_output_one net/xfrm/xfrm_output.c:549 [inline]
>    xfrm_output_resume+0x41d9/0x64e0 net/xfrm/xfrm_output.c:597
>    iptfs_output_queued net/xfrm/xfrm_iptfs.c:2325 [inline]
>    iptfs_delay_timer+0x3803/0x4310 net/xfrm/xfrm_iptfs.c:2362
>    __run_hrtimer kernel/time/hrtimer.c [inline]
>    __hrtimer_run_queues+0x3bc/0xa10 kernel/time/hrtimer.c
>    hrtimer_run_softirq+0x1e3/0x2e0 kernel/time/hrtimer.c:2153
>    handle_softirqs+0x265/0x8d0 kernel/softirq.c:669
> 
> The warning also means the queued skb may point to a dst that has
> already been freed.
> 
> Take a reference with skb_dst_force() while still under RCU, as other
> deferred xmit paths do, and drop the skb if its dst is already gone.
> 
> Fixes: 0e4fbf013fa5 ("xfrm: iptfs: add user packet (tunnel ingress) handling")
> Reported-by: syzbot+622de7e1f18a30fc404a@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=622de7e1f18a30fc404a
> Signed-off-by: Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>

Applied, thanks a lot!

      reply	other threads:[~2026-11-23 11:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15 13:26 [PATCH ipsec] xfrm: iptfs: force a dst reference before queueing an skb Nguyen Ngoc Thang
2026-11-23 11:23 ` Steffen Klassert [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=awQiN-6b40NOCVFV@gauss4 \
    --to=steffen.klassert@secunet.com \
    --cc=chopps@labn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@kernel.org \
    --cc=ipsec@lists.linux.dev \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ngocthang2710.1999@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=syzbot+622de7e1f18a30fc404a@syzkaller.appspotmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.