net: implement lockless setsockopt(SO_PEEK_OFF)
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 |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: implement lockless setsockopt(SO_PEEK_OFF)
syzbot reported a lockdep violation [1] involving af_unix support of SO_PEEK_OFF.
Since SO_PEEK_OFF is inherently not thread safe (it uses a per-socket sk_peek_off field), there is really no point to enforce a pointless thread safety in the kernel.
After this patch :
- setsockopt(SO_PEEK_OFF) no longer acquires the socket lock.
- skb_consume_udp() no longer has to acquire the socket lock.
- af_unix no longer needs a special version of sk_set_peek_off(), because it does not lock u->iolock anymore.
From the CVE record · Linux
The Linux kernel has a circular locking dependency involving AF_UNIX sockets and setsockopt(SO_PEEK_OFF). A local caller using the affected socket operations may trigger a deadlock; the input does not specify whether authentication is required or whether another user's interaction is needed.
Engineers running Linux kernels, including the reported 6.8.0-rc4 syzkaller build, should check whether their kernel includes the fix.