CVE-2023-53478
published high CVSS 3.1 · 7.8tracing/synthetic: Fix races on freeing last_cmd
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux27c888da9867725784bad3d6455d6e53b425fa2b to < 9fe183f659a2704255e5d84f6ae308c234a113ec · 27c888da9867725784bad3d6455d6e53b425fa2b to < 8826d9e7bd51e7656f78baa4472e8e2f5e7069f0 · 27c888da9867725784bad3d6455d6e53b425fa2b to < 4ccf11c4e8a8e051499d53a12f502196c97a758e · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux5.18 (affected) · 0 to < 5.18 (unaffected · semver) · 6.1.24 through 6.1.* (unaffected · semver) · 6.2.11 through 6.2.* (unaffected · semver) · 6.3 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
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 ...
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The bug is triggered only by write() to the tracefs node /sys/kernel/tracing/synthetic_events (or dynamic_events), which requires local access to the machine's filesystem. There is no network-facing consumer of this code path. AC:L - Although it is a race, the attacker owns both sides — simply running two concurrent writers of malformed commands, exactly as the reporter's two-shell reproducer does, and the commit states it reproduces easily. Object size and contents of the raced allocation are fully attacker-chosen, so no condition lies outside the attacker's control. PR:L - No capability check exists in the path; access is gated only by DAC on the tracefs file, and tracefs's gid= mount option is explicitly provided so a non-root tracing group (Android/ChromeOS/developer-group deployments) can write these nodes. An unprivileged member of that group can trigger the race with plain writes. UI:N - The attacker performs the entire attack with its own write() calls; no victim action, mount, or file-open by another user is needed. S:U - The corruption occurs in kernel slab memory and its impact stays within the same kernel security authority, with no crossing of a hypervisor, IOMMU, or sandbox boundary. C:H - The use-after-free reads freed heap memory via strlen()/snprintf() in tracing_log_err() and copies it into err->cmd, which userspace can then read back from tracing/error_log — a direct kernel heap infoleak. Combined with the double-free's ability to overlap allocations, arbitrary kernel memory disclosure is achievable. I:H - The double-free frees an attacker-sized, attacker-filled kmalloc object twice, corrupting the SLUB freelist and letting two live allocations alias the same memory — a well-known route to arbitrary kernel write and control-flow hijack. A:H - The double-free and use-after-free readily produce slab corruption, KASAN BUG reports, and kernel panics, and the race can be re-triggered in a tight loop to reliably crash the system.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 27c888da9867725784bad3d6455d6e53b425fa2b to < 9fe183f659a2704255e5d84f6ae308c234a113ec (affected · git)27c888da9867725784bad3d6455d6e53b425fa2b to < 8826d9e7bd51e7656f78baa4472e8e2f5e7069f0 (affected · git)27c888da9867725784bad3d6455d6e53b425fa2b to < 4ccf11c4e8a8e051499d53a12f502196c97a758e (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 5.18 (affected)0 to < 5.18 (unaffected · semver)6.1.24 through 6.1.* (unaffected · semver)6.2.11 through 6.2.* (unaffected · semver)6.3 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
3Provider assertions
1Linux · cna
tracing/synthetic: Fix races on freeing last_cmd
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 125b962de4b13c3c9cf7f35a31d3cf7e8c58f55079939577ac377ae377937c63
- Ingested
- 23 Sep 2026, 08:14:56 UTC
- Source record
- Official CVE record