cve.bz

CVE-2024-43891 linux linux kernel: Use After Free

4.7 mediumEPSS 0.2%Fix available

Medium (4.7) 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: tracing: Have format file honor EVENT_FILE_FL_FREED When eventfs was introduced, special care had to be done to coordinate the freeing of the file meta data with the files that are exposed to user space. The file meta data would have a ref count that is set when the file is created and would be decremented and freed after the last user that opened the file closed it. When the file meta data was to be freed, it would set a flag (EVENT_FILE_FL_FREED) to denote that the file is freed, and any new references made (like new opens or reads) would fail as it is marked freed. This allowed other meta data to be freed after this flag was set (under the event_mutex). All the files that were dynamically created in the events directory had a pointer to the file meta data and would call event_release() when the last reference to the user space file was closed. This would be the time that it is safe to free the file meta data. A shortcut was made for the "format" file. It's i_private would point to the "call" entry directly and not point to the file's meta data. This is because all format files are the same for the same "call", so it was thought there was no reason to differentiate them. The other files maintain state (like the "enable", "trigger", etc). But this meant if the file were to disappear, the "format" file would be unaware of it. This caused a race that could be trigger via the user_events test (that would create dynamic events and free them), and running a loop that would read the user_events format files: In one console run: # cd tools/testing/selftests/user_events # while true; do ./ftrace_test; done And in another console run: # cd /sys/kernel/tracing/ # while true; do cat events/user_events/__test_event/format; done 2>/dev/null With KASAN memory checking, it would trigger a use-after-free bug report (which was a real bug). This was because the format file was not checking the file's meta data flag "EVENT_FILE_FL_FREED", so it would access the event that the file meta data pointed to after the event was freed. After inspection, there are other locations that were found to not check the EVENT_FILE_FL_FREED flag when accessing the trace_event_file. Add a new helper function: event_file_file() that will make sure that the event_mutex is held, and will return NULL if the trace_event_file has the EVENT_FILE_FL_FREED flag set. Have the first reference of the struct file pointer use event_file_file() and check for NULL. Later uses can still use the event_file_data() helper function if the event_mutex is still held and was not released since the event_file_file() call.

Severity

CVSS 3.1

4.7 medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/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; 15th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2024-09-10. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
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-2024-43891 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2024-43891?via=ask-ai-copy and https://cve.bz/cve/CVE-2024-43891?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-2024-43891 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
Linuxfrom 6.6.33 before 6.6.49
Linux6.9 and later

Fixed in

ProductRelease lineFixed in
Linux6.66.6.49
Linux6.106.10.5
Linuxlater releases6.11

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian13, 14linux6.10.6-1DEBIAN-CVE-2024-43891
Ubuntu16.04:LTSlinux-hwe-edgeno fix listedUBUNTU-CVE-2024-43891
Ubuntu18.04:LTSlinux-gcp, linux-hwe, linux-oem and 11 moreno fix listedUBUNTU-CVE-2024-43891
Ubuntu20.04:LTSlinux-gke, linux-riscv, linux-raspi2 and 24 moreno fix listedUBUNTU-CVE-2024-43891
Ubuntu22.04:LTSlinux-aws-6.86.8.0-1020.22~22.04.1UBUNTU-CVE-2024-43891 USN-7154-1
Ubuntu22.04:LTSlinux-azure-6.86.8.0-1020.23~22.04.1UBUNTU-CVE-2024-43891 USN-7196-1
Ubuntu22.04:LTSlinux-gcp-6.8, linux-nvidia-6.86.8.0-1019.21~22.04.1UBUNTU-CVE-2024-43891 USN-7154-1 USN-7155-1
Ubuntu22.04:LTSlinux-hwe-6.86.8.0-50.51~22.04.1UBUNTU-CVE-2024-43891 USN-7154-2
Ubuntu22.04:LTSlinux-oracle-6.86.8.0-1017.18~22.04.1UBUNTU-CVE-2024-43891 USN-7154-1
Ubuntu22.04:LTSlinux-riscv, linux-aws-6.2, linux-aws-6.5 and 29 moreno fix listedUBUNTU-CVE-2024-43891
Ubuntu22.04:LTSlinux-riscv-6.8, linux-lowlatency-hwe-6.86.8.0-50.51.1~22.04.1UBUNTU-CVE-2024-43891 USN-7154-1
Ubuntu24.04:LTSlinux6.8.0-50.51UBUNTU-CVE-2024-43891 USN-7154-1
Ubuntu24.04:LTSlinux-aws6.8.0-1020.22UBUNTU-CVE-2024-43891 USN-7154-1
12 more for Ubuntu in the JSON and on Ubuntu's page.
Azure Linux3kernel6.6.51.1-1AZL-48692
Alpaquita25, streamlinux-lts6.12.41-r0BELL-CVE-2024-43891

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Alpaquita.

Red Hat

Red Hat rates this Low.

Red Hat's statement

A low impact use-after-free flaw was found in the Linux kernel tracing subsystem. The eventfs "format" file did not honor the EVENT_FILE_FL_FREED flag, so racing the removal of a dynamic trace event (for example, an event created via user_events) against concurrent reads of its format file could cause the kernel to access trace event metadata after it had been freed, resulting in a use-after-free. Exploitation requires local access with high privileges and the ability to register and remove dynamic trace events while repeatedly reading the event format files, and the consequence is limited to availability, such as a kernel crash; there is no direct impact on confidentiality or integrity. Red Hat Product Security therefore rates this flaw Low severity (CVSS 4.1, AV:L/AC:H/PR:H), which is significantly lower than the upstream CVE.org rating of 7.8, because successful exploitation requires high privileges and attack complexity and impacts availability only. The vulnerable code was introduced upstream in Linux kernel 6.9 (with a backport to 6.6.33), after the Red Hat Enterprise Linux 8 and 9 kernel baselines, so Red Hat Enterprise Linux kernel and kernel-rt and the Hosted OpenShift clusters are recorded as not affected; only the Fedora community kernel is affected, and a fix is being pursued through the Fedora kernel package updates.

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. For the affected Fedora kernel package, updating to a kernel build containing the upstream fix resolves the issue.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 6kernelOut of support scope
Red Hat Enterprise Linux 7kernelOut of support scope
Red Hat Enterprise Linux 7kernel-rtOut of support scope
Red Hat Enterprise Linux 8kernelNot affected
Red Hat Enterprise Linux 8kernel-rtNot affected
Red Hat Enterprise Linux 9kernelNot affected
Red Hat Enterprise Linux 9kernel-rtNot affected

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-2024-43891.

References

Check your stackJSON