af_unix: Don't return OOB skb in manage_oob().
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.11.26.12In the Linux kernel, the following vulnerability has been resolved:
af_unix: Don't return OOB skb in manage_oob().
syzbot reported use-after-free in unix_stream_recv_urg(). [0]
The scenario is
1. send(MSG_OOB) 2. recv(MSG_OOB) -> The consumed OOB remains in recv queue 3. send(MSG_OOB) 4. recv() -> manage_oob() returns the next skb of the consumed OOB -> This is also OOB, but unix_sk(sk)->oob_skb is not cleared 5. recv(MSG_OOB) -> unix_sk(sk)->oob_skb is used but already freed
The recent commit 8594d9b85c07 ("af_unix: Don't call skb_get() for OOB skb.") uncovered the issue.
If the OOB skb is consumed and the next skb is peeked in manage_oob(), we still need to check if the skb is OOB.
Let's do so by falling back to the following checks in manage_oob() and add the test case in selftest.
From the CVE record · Linux
The Linux kernel’s AF_UNIX out-of-band message handling has a use-after-free flaw. A local process can trigger it through a sequence of out-of-band sends and receives; the input does not establish whether additional privileges are needed.
Teams running Linux kernels should check their exposure; the affected version range is not specified.