cve.bz

CVE-2022-50219 linux linux kernel: Use After Free

7.8 highEPSS 0.2%Fix available

High (7.8) in linux linux kernel. EPSS 0.2% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.1

7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
0.2% (unchanged from 0.2% a week ago; 0.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 16th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-416 Use After Free
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2022-50219 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2022-50219?via=ask-ai-copy and https://cve.bz/cve/CVE-2022-50219?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2022-50219 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
Linux5.7 and later

Fixed in

ProductRelease lineFixed in
Linux5.105.10.138
Linux5.155.15.61
Linux5.185.18.18
Linux5.195.19.2
Linuxlater releases6.0

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13, 14linux6.0.2-1DEBIAN-CVE-2022-50219
Ubuntu16.04:LTSlinux-hwe-edgeno fix listedUBUNTU-CVE-2022-50219
Ubuntu18.04:LTSlinux-gcp, linux-hwe, linux-oem and 12 moreno fix listedUBUNTU-CVE-2022-50219
Ubuntu20.04:LTSlinux-aws-5.15, linux-riscv-5.155.15.0-1023.27~20.04.1UBUNTU-CVE-2022-50219
Ubuntu20.04:LTSlinux-azure-5.155.15.0-1023.29~20.04.1UBUNTU-CVE-2022-50219
Ubuntu20.04:LTSlinux-gcp-5.155.15.0-1022.29~20.04.1UBUNTU-CVE-2022-50219
Ubuntu20.04:LTSlinux-gke, linux-gkeop, linux-riscv and 26 moreno fix listedUBUNTU-CVE-2022-50219
Ubuntu20.04:LTSlinux-hwe-5.15, linux-lowlatency-hwe-5.155.15.0-53.59~20.04.1UBUNTU-CVE-2022-50219
Ubuntu20.04:LTSlinux-intel-iotg-5.155.15.0-1018.23~20.04.1UBUNTU-CVE-2022-50219
Ubuntu20.04:LTSlinux-oracle-5.155.15.0-1022.28~20.04.1UBUNTU-CVE-2022-50219
Ubuntu22.04:LTSlinux, linux-lowlatency5.15.0-53.59UBUNTU-CVE-2022-50219
Ubuntu22.04:LTSlinux-aws5.15.0-1023.27UBUNTU-CVE-2022-50219
Ubuntu22.04:LTSlinux-azure5.15.0-1023.29UBUNTU-CVE-2022-50219
13 more for Ubuntu in the JSON and on Ubuntu's page.
Red Hatenterprise_linux:8::baseosperf, kernel, bpftool and 30 more0:4.18.0-240.el8RHSA-2020:4431
Red Hatenterprise_linux:8::crbperf-debuginfo, kernel-debuginfo, bpftool-debuginfo and 7 more0:4.18.0-240.el8RHSA-2020:4431
Red Hatenterprise_linux:9::appstreamperf, rtla, kernel-doc and 22 more0:5.14.0-284.11.1.el9_2RHSA-2023:2458
Red Hatenterprise_linux:9::appstream, enterprise_linux:9::crbbpftool-debuginfo0:7.0.0-284.11.1.el9_2RHSA-2023:2458
Red Hatenterprise_linux:9::baseosbpftool, bpftool-debuginfo0:7.0.0-284.11.1.el9_2RHSA-2023:2458
Red Hatenterprise_linux:9::baseoskernel, kernel-64k, kernel-core and 40 more0:5.14.0-284.11.1.el9_2RHSA-2023:2458
Red Hatenterprise_linux:9::crbperf-debuginfo, kernel-debuginfo, kernel-64k-debuginfo and 10 more0:5.14.0-284.11.1.el9_2RHSA-2023:2458

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

A moderate-severity use-after-free flaw was found in the Linux kernel BPF (Berkeley Packet Filter) subsystem's compute_effective_progs(). When a cgroup BPF link is detached and a memory allocation inside update_effective_progs() fails, a pointer to the already freed bpf_cgroup_link is restored on the cgroup list; every subsequent call to update_effective_progs() then dereferences this deallocated pointer in prog_list_length(), triggering the use-after-free. A local attacker with the ability to attach and detach BPF links can exploit this flaw to crash the kernel, resulting in a denial of service. Red Hat Enterprise Linux 8 and 9 (kernel and kernel-rt) and Hosted OpenShift clusters (ARO 4 and OSD 4) are affected, and the fix is currently deferred for these streams; the residual risk while the fix is deferred is limited to a local user causing a system crash (denial of service) through this path. Red Hat Enterprise Linux 6, 7, and 10, and Red Hat In-Vehicle OS are not affected because the vulnerable code is not present in those products. Red Hat rates this flaw as Moderate (CVSS 3.1 score 5.5, AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H) because the flaw has availability impact only, leading to a kernel crash rather than loss of confidentiality or integrity; this is lower than the NIST/CVE.org score of 7.8 (High), which assumes complete confidentiality, integrity, and availability impact.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8kernel-0:4.18.0-240.el8Fixed 2020-11-04RHSA-2020:4431
Red Hat Enterprise Linux 9kernel-0:5.14.0-284.11.1.el9_2Fixed 2023-05-09RHSA-2023:2458
Red Hat Enterprise Linux 10kernelNot affected
Red Hat Enterprise Linux 6kernelNot affected
Red Hat Enterprise Linux 7kernelNot affected
Red Hat Enterprise Linux 7kernel-rtNot affected
Red Hat Enterprise Linux 8kernel-rtFix deferred
Red Hat Enterprise Linux 9kernel-rtFix deferred

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2022-50219.

References

Check your stackJSON