CVE-2022-50219CWE-416

CVE-2022-50219

High · published June 18, 2025

CVSS v3.1
7.8
EPSS
0%
Percentile
13.5
In the wild
Unconfirmed
What it is

In the Linux kernel, the following vulnerability has been resolved:

bpf: Fix KASAN use-after-free Read in compute_effective_progs

Syzbot found a Use After Free bug in compute_effective_progs().

The reproducer creates a number of BPF links, and causes a fault

injected alloc to fail, while calling bpf_link_detach on them.

Link detach triggers the link to be freed by bpf_link_free(),

which calls __cgroup_bpf_detach() and update_effective_progs().

If the memory allocation in this function fails, the function restores

the pointer to the bpf_cgroup_link on the cgroup list, but the memory

gets freed just after it returns. After this, every subsequent call to

update_effective_progs() causes this already deallocated pointer to be

dereferenced in prog_list_length(), and triggers KASAN UAF error.

To fix this issue don't preserve the pointer to the prog or link in the

list, but remove it and replace it with a dummy prog without shrinking

the table. The subsequent call to __cgroup_bpf_detach() or

__cgroup_bpf_detach() will correct it.

The record
Technical detail
CVSS v3.1
7.8 · HIGH
Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.00234 · 13.5th percentile
Weakness
CWE-416 · Use After Free
Published
2025-06-18T15:15Z
Affected products (4)
ProductVersionsFixed in
linux/linux_kernel≥ 5.7, < 5.10.1385.10.138
linux/linux_kernel≥ 5.11, < 5.15.615.15.61
linux/linux_kernel≥ 5.16, < 5.18.185.18.18
linux/linux_kernel≥ 5.19, < 5.19.25.19.2
References (5)
EPSS history
Timeline
  • 18 JUN 11:03Z
    bpf: Fix KASAN use-after-free Read in compute_effective_progs
    cvelistv5