# CVE-2023-53478: tracing/synthetic: Fix races on freeing last\_cmd

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.17% (percentile 3, 2026-11-28)
- **CWE:** CWE-362
- **Published:** 2025-10-01T11:42:47.185Z
- **Modified:** 2026-08-05T09:14:16.799Z

## Who should check

- Anyone running Linux \>= 27c888da9867725784bad3d6455d6e53b425fa2b, \< 9fe183f659a2704255e5d84f6ae308c234a113ec; \>= 27c888da9867725784bad3d6455d6e53b425fa2b, \< 8826d9e7bd51e7656f78baa4472e8e2f5e7069f0; \>= 27c888da9867725784bad3d6455d6e53b425fa2b, \< 4ccf11c4e8a8e051499d53a12f502196c97a758e
- Anyone running Linux 5.18

## 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
        ...

## Affected and fixed versions

- Linux: \>= 27c888da9867725784bad3d6455d6e53b425fa2b, \< 9fe183f659a2704255e5d84f6ae308c234a113ec; \>= 27c888da9867725784bad3d6455d6e53b425fa2b, \< 8826d9e7bd51e7656f78baa4472e8e2f5e7069f0; \>= 27c888da9867725784bad3d6455d6e53b425fa2b, \< 4ccf11c4e8a8e051499d53a12f502196c97a758e (cvelist)
- Linux: 5.18 (cvelist)

## Mitigation

- Upgrade Linux to 4ccf11c4e8a8e051499d53a12f502196c97a758e or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-53478. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-53478.md
Affected: Linux >= 27c888da9867725784bad3d6455d6e53b425fa2b, < 9fe183f659a2704255e5d84f6ae308c234a113ec; >= 27c888da9867725784bad3d6455d6e53b425fa2b, < 8826d9e7bd51e7656f78baa4472e8e2f5e7069f0; >= 27c888da9867725784bad3d6455d6e53b425fa2b, < 4ccf11c4e8a8e051499d53a12f502196c97a758e; Linux 5.18
Fixed in: Linux 9fe183f659a2704255e5d84f6ae308c234a113ec, Linux 8826d9e7bd51e7656f78baa4472e8e2f5e7069f0, Linux 4ccf11c4e8a8e051499d53a12f502196c97a758e

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-53478 being exploited?

There is no confirmed exploitation: CVE-2023-53478 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.17% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2023-53478?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2023-53478?

Linux \>= 27c888da9867725784bad3d6455d6e53b425fa2b, \< 9fe183f659a2704255e5d84f6ae308c234a113ec; \>= 27c888da9867725784bad3d6455d6e53b425fa2b, \< 8826d9e7bd51e7656f78baa4472e8e2f5e7069f0; \>= 27c888da9867725784bad3d6455d6e53b425fa2b, \< 4ccf11c4e8a8e051499d53a12f502196c97a758e; Linux 5.18.

### Is there a fix for CVE-2023-53478?

Yes. Fixed in Linux 9fe183f659a2704255e5d84f6ae308c234a113ec, Linux 8826d9e7bd51e7656f78baa4472e8e2f5e7069f0, Linux 4ccf11c4e8a8e051499d53a12f502196c97a758e. Upgrade Linux to 4ccf11c4e8a8e051499d53a12f502196c97a758e or later.

### How do I check if I'm affected by CVE-2023-53478?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/9fe183f659a2704255e5d84f6ae308c234a113ec>
- patch: <https://git.kernel.org/stable/c/8826d9e7bd51e7656f78baa4472e8e2f5e7069f0>
- patch: <https://git.kernel.org/stable/c/4ccf11c4e8a8e051499d53a12f502196c97a758e>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-53478>

HTML: <https://flawdb.com/CVE-2023-53478> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-53478>
