af_unix: Clear stale u->oob_skb.
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
af_unix: Clear stale u->oob_skb.
syzkaller started to report deadlock of unix_gc_lock after commit 4090fa373f0e ("af_unix: Replace garbage collection algorithm."), but it just uncovers the bug that has been there since commit 314001f0bf92 ("af_unix: Add OOB support").
The repro basically does the following.
from socket import * from array import array
c1, c2 = socketpair(AF_UNIX, SOCK_STREAM) c1.sendmsg([b'a'], [(SOL_SOCKET, SCM_RIGHTS, array("i", [c2.fileno()]))], MSG_OOB) c2.recv(1) # blocked as no normal data in recv queue
c2.close() # done async and unblock recv() c1.close() # done async and trigger GC
A socket sends its file descriptor to itself as OOB data and tries to receive normal data, but finally recv() fails due to async close().
From the CVE record · Linux
The Linux kernel’s AF_UNIX socket handling can leave a stale out-of-band (OOB) packet reference after a receive operation. A local process can trigger a garbage-collection lock deadlock by sending a socket’s file descriptor to itself as OOB data, attempting a normal receive, and closing the sockets asynchronously. The input does not specify authentication requirements beyond the ability to perform those socket operations.
Engineers running Linux kernels with AF_UNIX OOB support should check their installations; affected versions are not specified.