All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-net 0/2] mptcp: prevent add_addr timer rearm during teardown
@ 2026-05-26 10:36 Li Xiasong
  2026-05-26 10:36 ` [PATCH mptcp-net 1/2] net: add sk_shutdown_timer_sync() helper Li Xiasong
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Li Xiasong @ 2026-05-26 10:36 UTC (permalink / raw)
  To: mptcp; +Cc: lixiasong1

From: Li Xiasong <lixiasong1@huawei.com>

This series fixes a potential use-after-free in MPTCP ADD_ADDR timer
teardown.

The ADD_ADDR retransmission timer callback may re-arm itself on the
sock_owned_by_user() path. During final teardown, this can race with
timer cancellation and leave a timer pending after the entry is removed
and freed.

Using sk_stop_timer_sync() is not sufficient for this case because it
waits for a running callback but does not permanently disable the timer.

This series does two things:

  1. Add sk_shutdown_timer_sync() to socket timer helpers.
     It wraps timer_shutdown_sync() and preserves sk reference accounting
     semantics by dropping a socket reference when a pending timer is
     removed.

  2. Switch MPTCP ADD_ADDR final teardown paths to
     sk_shutdown_timer_sync(), so the timer cannot be re-armed once
     teardown starts.

Reported scenario:
  Link: https://github.com/multipath-tcp/mptcp_net-next/issues/623

Li Xiasong (2):
  net: add sk_shutdown_timer_sync() helper
  mptcp: use sk_shutdown_timer_sync() for add_addr timer teardown

 include/net/sock.h | 5 +++++
 net/core/sock.c    | 7 +++++++
 net/mptcp/pm.c     | 4 ++--
 3 files changed, 14 insertions(+), 2 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-06-11  6:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-26 10:36 [PATCH mptcp-net 0/2] mptcp: prevent add_addr timer rearm during teardown Li Xiasong
2026-05-26 10:36 ` [PATCH mptcp-net 1/2] net: add sk_shutdown_timer_sync() helper Li Xiasong
2026-05-26 10:36 ` [PATCH mptcp-net 2/2] mptcp: use sk_shutdown_timer_sync() for add_addr timer teardown Li Xiasong
2026-05-27  4:44   ` Matthieu Baerts
2026-05-28 12:33     ` Li Xiasong
2026-05-27  5:16 ` [PATCH mptcp-net 0/2] mptcp: prevent add_addr timer rearm during teardown MPTCP CI
2026-06-04  7:19 ` [PATCH mptcp-net] " Kalpan Jani
2026-06-05  7:31   ` Li Xiasong
2026-06-11  6:59 ` Kalpan Jani

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.