CVE-2023-53478: tracing/synthetic: Fix races on freeing last_cmd
In the Linux kernel, the following vulnerability has been resolved:
tracing/synthetic: Fix races on freeing last_cmd
Currently, the "last_cmd" variable can be accessed by multiple processes
asynchronously when multiple users manipulate synthetic_events node
at the same time, it could lead to use-after-free or double-free.
This patch add "lastcmd_mutex" to prevent "last_cmd" from being accessed
asynchronously.
================================================================
It's easy to reproduce in the KASAN environment by running the two
scripts below in different shells.
script 1:
while :
do
echo -n -e '\x88' > /sys/kernel/tracing/synthetic_events
done
script 2:
while :
do
echo -n -e '\xb0' > /sys/kernel/tracing/synthetic_events
done
================================================================
double-free scenario:
process A process B
------------------- ---------------
1.kstrdup last_cmd
2.free last_cmd
3.free last_cmd(double-free)
================================================================
use-after-free scenario:
process A process B
------------------- ---------------
1.kstrdup last_cmd
2.free last_cmd
3.tracing_log_err(use-after-free)
================================================================
Appendix 1. KASAN report double-free:
BUG: KASAN: double-free in kfree+0xdc/0x1d4
Free of addr ***** by task sh/4879
Call trace:
...
kfree+0xdc/0x1d4
create_or_delete_synth_event+0x60/0x1e8
trace_parse_run_command+0x2bc/0x4b8
synth_events_write+0x20/0x30
vfs_write+0x200/0x830
...
Allocated by task 4879:
...
kstrdup+0x5c/0x98
create_or_delete_synth_event+0x6c/0x1e8
trace_parse_run_command+0x2bc/0x4b8
synth_events_write+0x20/0x30
vfs_write+0x200/0x830
...
Freed by task 5464:
...
kfree+0xdc/0x1d4
create_or_delete_synth_event+0x60/0x1e8
trace_parse_run_command+0x2bc/0x4b8
synth_events_write+0x20/0x30
vfs_write+0x200/0x830
...
================================================================
Appendix 2. KASAN report use-after-free:
BUG: KASAN: use-after-free in strlen+0x5c/0x7c
Read of size 1 at addr ***** by task sh/5483
sh: CPU: 7 PID: 5483 Comm: sh
...
__asan_report_load1_noabort+0x34/0x44
strlen+0x5c/0x7c
tracing_log_err+0x60/0x444
create_or_delete_synth_event+0xc4/0x204
trace_parse_run_command+0x2bc/0x4b8
synth_events_write+0x20/0x30
vfs_write+0x200/0x830
...
Allocated by task 5483:
...
kstrdup+0x5c/0x98
create_or_delete_synth_event+0x80/0x204
trace_parse_run_command+0x2bc/0x4b8
synth_events_write+0x20/0x30
vfs_write+0x200/0x830
...
Freed by task 5480:
...
kfree+0xdc/0x1d4
create_or_delete_synth_event+0x74/0x204
trace_parse_run_command+0x2bc/0x4b8
synth_events_write+0x20/0x30
vfs_write+0x200/0x830
...
Security readout for executives and security teams
Plain-English summary
A Linux kernel race condition can corrupt memory when multiple local processes manipulate synthetic tracing events simultaneously. The resulting use-after-free or double-free may compromise confidentiality, integrity, and availability. Exploitation requires local access and permission to write the synthetic_events tracing interface, so exposure depends heavily on host permissions and kernel version.
Executive priority
Treat as a high-priority local kernel issue, especially on shared Linux hosts or systems exposing tracing controls to non-administrators. Patch through supported vendor channels after confirming affected packages. The supplied evidence does not justify an emergency response based on active exploitation, but memory corruption with high potential impact warrants timely remediation.
Technical view
Concurrent writes to /sys/kernel/tracing/synthetic_events can race while accessing and freeing the shared last_cmd value. This produces documented double-free and use-after-free conditions observed with KASAN. The kernel fix adds lastcmd_mutex serialization. CVSS 3.1 is 7.8, reflecting local, low-complexity exploitation requiring low privileges and no user interaction.
Likely exposure
Potentially exposed systems run an affected Linux kernel and permit a local process to write the synthetic_events tracing node. The supplied record associates the issue with Linux 5.18 and later version markers, but its version formatting is insufficient to determine every vulnerable distribution package. Confirm exposure against vendor kernel advisories and backported fixes.
Exploitation context
The supplied sources demonstrate reproducibility under KASAN and describe memory corruption scenarios. They do not establish reliable privilege escalation, remote exploitation, or exploitation in the wild. The CVE is not listed as KEV in the provided bundle.
Researcher notes
Primary evidence documents asynchronous access to last_cmd and both double-free and use-after-free outcomes. The mutex change directly addresses the race. Exact affected and fixed release boundaries are not unambiguously represented in the supplied version list, so distribution-specific backport verification remains necessary. No exploit reliability or real-world abuse evidence is provided.
Mitigation direction
Update to a vendor-supported kernel containing the linked lastcmd_mutex fix.
Check distribution security advisories for backports rather than relying only on upstream version numbers.
Restrict untrusted local access to the tracing synthetic_events interface where operationally feasible.
Prioritize multi-user systems where lower-privileged processes can access kernel tracing controls.
Validation and detection
Record the running kernel and distribution package versions on potentially exposed hosts.
Confirm the vendor package includes one of the referenced fixes or an equivalent backport.
Review permissions and access controls for /sys/kernel/tracing/synthetic_events.
Use approved defensive testing with kernel diagnostics; avoid reproducing memory corruption on production systems.
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-53478 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.
1CVSS vectors
3Timeline events
0ADP providers
4Source links
CVSS vector scores
1 official score
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.