CVE-2023-52879: tracing: Have trace_event_file have ref counters
In the Linux kernel, the following vulnerability has been resolved:
tracing: Have trace_event_file have ref counters
The following can crash the kernel:
# cd /sys/kernel/tracing
# echo 'p:sched schedule' > kprobe_events
# exec 5>>events/kprobes/sched/enable
# > kprobe_events
# exec 5>&-
The above commands:
1. Change directory to the tracefs directory
2. Create a kprobe event (doesn't matter what one)
3. Open bash file descriptor 5 on the enable file of the kprobe event
4. Delete the kprobe event (removes the files too)
5. Close the bash file descriptor 5
The above causes a crash!
BUG: kernel NULL pointer dereference, address: 0000000000000028
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 0 P4D 0
Oops: 0000 [#1] PREEMPT SMP PTI
CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
RIP: 0010:tracing_release_file_tr+0xc/0x50
What happens here is that the kprobe event creates a trace_event_file
"file" descriptor that represents the file in tracefs to the event. It
maintains state of the event (is it enabled for the given instance?).
Opening the "enable" file gets a reference to the event "file" descriptor
via the open file descriptor. When the kprobe event is deleted, the file is
also deleted from the tracefs system which also frees the event "file"
descriptor.
But as the tracefs file is still opened by user space, it will not be
totally removed until the final dput() is called on it. But this is not
true with the event "file" descriptor that is already freed. If the user
does a write to or simply closes the file descriptor it will reference the
event "file" descriptor that was just freed, causing a use-after-free bug.
To solve this, add a ref count to the event "file" descriptor as well as a
new flag called "FREED". The "file" will not be freed until the last
reference is released. But the FREE flag will be set when the event is
removed to prevent any more modifications to that event from happening,
even if there's still a reference to the event "file" descriptor.
Security readout for executives and security teams
Plain-English summary
A local user may trigger a Linux kernel memory-lifecycle flaw in tracing by keeping an event file open while deleting its kprobe event. The demonstrated outcome is a kernel crash, threatening system availability. The CVSS assessment also indicates possible confidentiality and integrity impact, but the supplied evidence does not demonstrate those outcomes.
Executive priority
Treat as a high-priority local denial-of-service risk, especially on shared Linux hosts and availability-sensitive systems. Patch through normal emergency or accelerated kernel maintenance after vendor applicability confirmation. Escalate faster where untrusted users can reach tracing interfaces. There is no supplied evidence of active exploitation.
Technical view
The trace_event_file object could be freed when its kprobe event was removed while tracefs still retained an open file reference. Closing or writing through that reference then accessed freed memory. The upstream correction adds reference counting and a FREED flag, delaying release and blocking changes after event removal.
Likely exposure
Exposure is limited to Linux systems running an affected kernel where a local user can access the relevant tracefs tracing and kprobe interfaces. The supplied version data marks several kernel releases as affected, but its version structure is ambiguous; confirm applicability through the operating-system vendor.
Exploitation context
The CVSS vector is local, low-complexity, low-privilege, requires no user interaction, and scores 7.8. The source demonstrates a reproducible kernel crash. It does not establish remote exploitation, privilege escalation, data compromise, public weaponization, or active exploitation. The supplied KEV indicator is false.
Researcher notes
The demonstrated sequence creates a kprobe event, retains its enable file, removes the event, then releases the stale reference. The flaw is described as a use-after-free causing a NULL-pointer kernel fault. Assess downstream backports by fix presence, not upstream version numbers alone. The supplied affected-version records require vendor interpretation.
Mitigation direction
Apply a vendor-supported kernel update that incorporates the referenced trace_event_file reference-counting correction.
Check distribution security guidance to map the CVE accurately to packaged kernel versions.
Until patched, restrict untrusted local access to tracing and kprobe event-management interfaces.
Prioritize exposed multi-user hosts and systems where a kernel crash would disrupt critical services.
Validation and detection
Record the running kernel and distribution package versions on potentially exposed Linux systems.
Compare package versions with current distribution advisories and the referenced upstream stable commits.
Verify whether tracefs and kprobe event-management interfaces are enabled and accessible to untrusted local users.
Confirm the updated kernel is running after remediation; installation alone may leave the previous kernel active.
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-2023-52879 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.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.