The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Xin Long <lucien.xin@gmail.com>
Cc: Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>,
	linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
	marcelo.leitner@gmail.com, davem@davemloft.net,
	edumazet@google.com, pabeni@redhat.com, horms@kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>,
	Ao Wang <wangao@seu.edu.cn>, Xuewei Feng <fengxw06@126.com>,
	Qi Li <qli01@tsinghua.edu.cn>, Ke Xu <xuke@tsinghua.edu.cn>,
	yyxroy22@gmail.com
Subject: Re: [PATCH net v3] sctp: fix use-after-free of cached ASCONF chunk
Date: Mon, 10 Aug 2026 16:41:58 -0700	[thread overview]
Message-ID: <20260810164158.2c6821b3@kernel.org> (raw)
In-Reply-To: <CADvbK_cv+Wkb5r-8_sGnKsuA5tfErvLoiPZYVN=yXALbWfBOGw@mail.gmail.com>

On Mon, 10 Aug 2026 09:09:15 -0400 Xin Long wrote:
> On Sun, Aug 9, 2026 at 12:38 AM Yuxiang Yang
> <yangyx22@mails.tsinghua.edu.cn> wrote:
> >
> > addip_last_asconf caches the outstanding outbound ASCONF chunk. The normal
> > ASCONF-ACK completion path releases the chunk and clears the pointer.
> >
> > However, sctp_asconf_queue_teardown() releases the cached chunk without
> > clearing addip_last_asconf. During peer restart handling,
> > sctp_sf_do_dupcook_a() queues SCTP_CMD_PURGE_ASCONF_QUEUE, which invokes
> > sctp_asconf_queue_teardown() while the association remains alive and leaves
> > the pointer dangling.
> >
> > A delayed authenticated ASCONF-ACK can then reach sctp_sf_do_asconf_ack(),
> > which accesses the stale chunk and passes it to sctp_process_asconf_ack(),
> > causing a use-after-free and a second release.
> >
> > Clearing the pointer exposes a race with T4 expiry. Peer restart handling
> > queues the timer stop before the purge, but SCTP_CMD_TIMER_STOP uses
> > timer_delete(), which does not wait for a callback already running on
> > another CPU. Such a callback can reach sctp_sf_t4_timer_expire() after
> > the purge and dereference NULL.
> >
> > Clear addip_last_asconf after releasing the cached chunk, and make
> > sctp_sf_t4_timer_expire() consume a stale T4 expiry if no outstanding
> > ASCONF remains.
> 
> Acked-by: Xin Long <lucien.xin@gmail.com>

Hi! I think *shiko has a different suggestion which it thinks covers
more cases. Does it make sense?

https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260809043806.2768302-1-yangyx22@mails.tsinghua.edu.cn

      reply	other threads:[~2026-08-10 23:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-09  4:38 [PATCH net v3] sctp: fix use-after-free of cached ASCONF chunk Yuxiang Yang
2026-08-10 13:09 ` Xin Long
2026-08-10 23:41   ` Jakub Kicinski [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=20260810164158.2c6821b3@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fengxw06@126.com \
    --cc=horms@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=qli01@tsinghua.edu.cn \
    --cc=stable@vger.kernel.org \
    --cc=wangao@seu.edu.cn \
    --cc=xuke@tsinghua.edu.cn \
    --cc=yangyx22@mails.tsinghua.edu.cn \
    --cc=yyxroy22@gmail.com \
    --cc=zhaoyz24@mails.tsinghua.edu.cn \
    /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