mptcp: fix race condition in mptcp_schedule_work()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 3b1d6210a9577369103330b0d802b0bf74b65e7f · < 3fc7723ed01d1130d4bf7063c50e0af60ecccbb4| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
mptcp: fix race condition in mptcp_schedule_work()
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);
From the CVE record · Linux
A race in the Linux kernel’s mptcp_schedule_work() can cause a use-after-free when scheduled work completes before the socket reference count is increased. The input does not establish whether an attacker can trigger it, or whether network access, authentication, or user interaction is required.
Engineers running Linux kernels with MPTCP should check their versions; affected versions were not provided.