From: Jakub Kicinski <kuba@kernel.org>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
linux-sctp@vger.kernel.org, davem@davemloft.net,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Subject: Re: [PATCH net] sctp: fix addr_wq_timer race in sctp_free_addr_wq()
Date: Tue, 21 Jul 2026 14:02:27 -0700 [thread overview]
Message-ID: <20260721140227.538ce6b3@kernel.org> (raw)
In-Reply-To: <5dc95f295bdb5c3f60e880dd9aa5112dc5c071cc.1783707823.git.lucien.xin@gmail.com>
On Fri, 10 Jul 2026 14:23:43 -0400 Xin Long wrote:
> sctp_free_addr_wq() previously removed addr_wq_timer using timer_delete()
> while holding addr_wq_lock. However, timer_delete() does not guarantee that
> a currently running timer handler has completed.
>
> This allows a race with sctp_addr_wq_timeout_handler(), where the handler
> may still run after addr_waitq has been freed, acquire addr_wq_lock, and
> access freed memory, leading to a use-after-free.
>
> Fix this by calling timer_shutdown_sync() before taking addr_wq_lock. This
> guarantees that any in-flight timer handler has finished and prevents the
> timer from being re-armed during teardown, making subsequent cleanup safe.
This version did not apply when it was posted (IDK if it applies now)
Please rebase and repost if it's still needed?
--
pw-bot: cr
next prev parent reply other threads:[~2026-07-21 21:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-10 18:23 [PATCH net] sctp: fix addr_wq_timer race in sctp_free_addr_wq() Xin Long
2026-07-21 21:02 ` Jakub Kicinski [this message]
2026-07-21 22:12 ` Xin Long
-- strict thread matches above, loose matches on Subject: below --
2026-06-29 18:31 Xin Long
2026-07-01 0:10 ` 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=20260721140227.538ce6b3@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@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 \
/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.