[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2a8efd6f-34d5-480f-8ca1-efef2959fffd@kernel.org>
Date: Thu, 13 Nov 2025 18:35:31 +0100
From: Matthieu Baerts <matttbe@...nel.org>
To: Eric Dumazet <edumazet@...gle.com>
Cc: Mat Martineau <martineau@...nel.org>,
Geliang Tang <geliang.tang@...ux.dev>, Florian Westphal <fw@...len.de>,
netdev@...r.kernel.org, eric.dumazet@...il.com,
syzbot+355158e7e301548a1424@...kaller.appspotmail.com,
"David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, MPTCP Linux <mptcp@...ts.linux.dev>
Subject: Re: [PATCH net] mptcp: fix race condition in mptcp_schedule_work()
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@...nel.org>
This patch can be applied to -net directly, ideally with:
Cc: stable@...r.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.
Powered by blists - more mailing lists