CVE-2022-50855
Description
In the Linux kernel, the following vulnerability has been resolved:
bpf: prevent leak of lsm program after failed attach
In [0], we added the ability to bpf_prog_attach LSM programs to cgroups, but in our validation to make sure the prog is meant to be attached to BPF_LSM_CGROUP, we return too early if the check fails. This results in lack of decrementing prog's refcnt (through bpf_prog_put) leaving the LSM program alive past the point of the expected lifecycle. This fix allows for the decrement to take place.
[0] https://lore.kernel.org/all/20220628174314.1216643-4-sdf@google.com/
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A refcount leak in the Linux kernel's BPF subsystem allows LSM_CGROUP attach logic allows an LSM program to remain alive after a failed attach, potentially leading to resource exhaustion.
Vulnerability
Overview
CVE-2022-50855 is a reference-count leak vulnerability in the Linux kernel's BPF subsystem, specifically in the bpf_prog_attach function for LSM (Linux Security Module) programs. When attaching an LSM program to a cgroup, the kernel validates that the program is intended for BPF_LSM_CGROUP. If this validation fails, the function returns an error early without decrementing the program's reference count via bpf_prog_put. This leaves the LSM program alive beyond its intended lifecycle, causing a memory leak [1].
Exploitation
An attacker with the ability to trigger a failed LSM program attach to a cgroup can exploit this bug. The attack requires local access and the ability to create and attach BPF programs, which typically requires CAP_BPF or root privileges. No special network position is needed. The failure condition is easily triggered by attempting to attach an LSM program not marked for cgroup attachment [1].
Impact
Successful exploitation leads to a gradual exhaustion of kernel memory as leaked LSM programs accumulate. This can result in a denial-of-service (DoS) condition, potentially crashing the system. The vulnerability does not provide code execution or privilege escalation, but it can degrade system stability and availability.
Mitigation
The fix
The fix, committed to the Linux kernel stable tree, ensures that bpf_prog_put is called even when the validation check fails, properly releasing the program's reference. Users should apply the patch from the stable kernel repository [1]. No workaround is available; updating the kernel is the only mitigation.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
382b39df5ddb26a1504dd36cde89f3edffb86Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
3News mentions
0No linked articles in our index yet.