MPTCP Linux Development
 help / color / mirror / Atom feed
* Re: [PATCH net] mptcp: fix race condition in mptcp_schedule_work()
       [not found] <20251113103924.3737425-1-edumazet@google.com>
@ 2025-11-13 17:35 ` Matthieu Baerts
  0 siblings, 0 replies; only message in thread
From: Matthieu Baerts @ 2025-11-13 17:35 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Mat Martineau, Geliang Tang, Florian Westphal, netdev,
	eric.dumazet, syzbot+355158e7e301548a1424, David S . Miller,
	Jakub Kicinski, Paolo Abeni, MPTCP Linux

Hi Eric,

(+cc MPTCP ML)

On 13/11/2025 11:39, Eric Dumazet wrote:
> syzbot reported use-after-free in mptcp_schedule_work() [1]
> 
> Issue here is that mptcp_schedule_work() schedules a work,
> then gets a refcount on sk->sk_refcnt if the work was scheduled.
> This refcount will be released by mptcp_worker().
> 
> [A] if (schedule_work(...)) {
> [B]     sock_hold(sk);
>         return true;
>     }
> 
> Problem is that mptcp_worker() can run immediately and complete before [B]
> 
> We need instead :
> 
>     sock_hold(sk);
>     if (schedule_work(...))
>         return true;
>     sock_put(sk);

Thank you for having released the syzbot issue with the fix! That's way
easier for us when the fix is provided with the bug report! :-D

The modifications look good to me:

Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>


This patch can be applied to -net directly, ideally with:

Cc: stable@vger.kernel.org

(Just for me to be able to track issues with the backports. If it cannot
be added, I can also track it "manually" if preferred.)

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-13 17:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20251113103924.3737425-1-edumazet@google.com>
2025-11-13 17:35 ` [PATCH net] mptcp: fix race condition in mptcp_schedule_work() Matthieu Baerts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox