af_unix: Drop all SCM attributes for SOCKMAP.
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c63829182c37c2d6d0608976d15fa61ebebe9e6b · < 965dc93481d1b80d341bdd16c27b16fe197175ee| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
af_unix: Drop all SCM attributes for SOCKMAP.
SOCKMAP can hide inflight fd from AF_UNIX GC.
When a socket in SOCKMAP receives skb with inflight fd, sk_psock_verdict_data_ready() looks up the mapped socket and enqueue skb to its psock->ingress_skb.
Since neither the old nor the new GC can inspect the psock queue, the hidden skb leaks the inflight sockets. Note that this cannot be detected via kmemleak because inflight sockets are linked to a global list.
In addition, SOCKMAP redirect breaks the Tarjan-based GC's assumption that unix_edge.successor is always alive, which is no longer true once skb is redirected, resulting in use-after-free below. [0]
Moreover, SOCKMAP does not call scm_stat_del() properly, so unix_show_fdinfo() could report an incorrect fd count.
sk_msg_recvmsg() does not support any SCM attributes in the first place.
From the CVE record · Linux
The Linux kernel's AF_UNIX SOCKMAP handling can hide an in-flight file descriptor from garbage collection when a socket in SOCKMAP receives a message carrying one. Redirecting that message can cause a use-after-free; the input does not specify authentication requirements or user interaction.
Engineers running Linux kernels with AF_UNIX SOCKMAP support should check their kernel vendor's advisory for affected versions.