bpf: Disallow bpf_{g,s}etsockopt() in cgroup UNIX getname hooks
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:
bpf: Disallow bpf_{g,s}etsockopt() in cgroup UNIX getname hooks
_bpf_setsockopt() and _bpf_getsockopt() call sock_owned_by_me() for full sockets, so these helpers expect the socket lock to be held.
BPF_CGROUP_UNIX_GETPEERNAME and BPF_CGROUP_UNIX_GETSOCKNAME run BPF programs without acquiring the socket lock. A program attached to either hook can therefore trigger the sock_owned_by_me() warning by calling bpf_setsockopt() or bpf_getsockopt().
Disallow bpf_setsockopt() and bpf_getsockopt() for CGROUP_UNIX_GETPEERNAME and CGROUP_UNIX_GETSOCKNAME.
From the CVE record · Linux
The Linux kernel allows BPF programs in cgroup UNIX getpeername and getsockname hooks to call socket-option helpers without holding the socket lock. An attached program can trigger a kernel warning by calling bpf_setsockopt() or bpf_getsockopt(). The input does not specify attacker access requirements or user interaction.
Engineers running the Linux kernel with BPF programs attached to these hooks should check their systems; affected versions are not specified.