CVE-2024-43891: tracing: Have format file honor EVENT_FILE_FL_FREED
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.
Security readout for executives and security teams
Plain-English summary
CVE-2024-43891 is a Linux kernel tracing bug where a dynamically removed tracing event could still be accessed through its format file. The public source describes a real use-after-free detected with KASAN. No CVSS score or public active exploitation evidence is provided.
Executive priority
Prioritize routine-to-expedited kernel patching for systems that expose tracing facilities or support untrusted local users. Business urgency is lower than a known-exploited remote flaw, but kernel memory safety bugs warrant timely remediation.
Technical view
The issue is in Linux kernel tracing/eventfs. The format file used i_private to point directly at the call entry, bypassing trace_event_file metadata and the EVENT_FILE_FL_FREED check. During dynamic user_events creation and deletion, this could access freed event data. Stable fixes add event_file_file() checks before first use.
Likely exposure
Exposure appears most relevant to Linux systems running affected kernel versions with tracing/eventfs and user_events available. The source does not establish remote exposure, privilege requirements, or distribution-specific package impact. Validate against your kernel vendor’s backports and the referenced stable commits.
Exploitation context
The source describes a race reproduced through kernel selftests and repeated reads of a tracing format file, with KASAN confirming use-after-free. KEV is false in the bundle, and no cited source states active exploitation in the wild.
Researcher notes
Evidence is limited to the CVE description and linked stable commits. The root flaw is missing freed-state validation for format-file access to trace_event_file-related data. Avoid assuming impact beyond local kernel memory corruption without additional vendor analysis.
Mitigation direction
Apply Linux kernel or distribution updates containing the referenced stable tracing fixes.
Check vendor advisories for backported patches matching your deployed kernel packages.
Restrict access to tracing/debug filesystems to trusted administrators while updates are pending.
Treat tracing interfaces as sensitive on shared or multi-user Linux hosts.
Validation and detection
Inventory deployed Linux kernel versions and compare with vendor fixed versions.
Confirm patched kernels include the referenced tracing/eventfs fixes or equivalent backports.
Check whether tracefs, eventfs, and user_events are enabled on affected hosts.
Review kernel logs for KASAN or use-after-free reports involving tracing/eventfs.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2024-43891 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.