bpf, sockmap: Fix af_unix iter deadlock
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2c860a43dd77f969bb959336a2f743d7103a8f63 · < 4d328dd695383224aa750ddee6b4ad40c0f8d205| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
bpf, sockmap: Fix af_unix iter deadlock
bpf_iter_unix_seq_show() may deadlock when lock_sock_fast() takes the fast path and the iter prog attempts to update a sockmap. Which ends up spinning at sock_map_update_elem()'s bh_lock_sock():
WARNING: possible recursive locking detected test_progs/1393 is trying to acquire lock: ffff88811ec25f58 (slock-AF_UNIX){+...}-{3:3}, at: sock_map_update_elem+0xdb/0x1f0
but task is already holding lock: ffff88811ec25f58 (slock-AF_UNIX){+...}-{3:3}, at: __lock_sock_fast+0x37/0xe0
other info that might help us debug this: Possible unsafe locking scenario:
CPU0 ---- lock(slock-AF_UNIX); lock(slock-AF_UNIX);
*** DEADLOCK ***
From the CVE record · Linux
The Linux kernel’s BPF AF_UNIX iterator can deadlock when socket locking takes the fast path and the iterator program tries to update a sockmap. The supplied information does not specify whether an attacker can trigger this remotely or locally, or whether authentication or user interaction is required.
Engineers running Linux kernels with BPF AF_UNIX iterator and sockmap functionality should check their kernel versions; affected versions were not provided.