# CVE-2024-38613: m68k: Fix spinlock race in kernel thread creation

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

- **Severity:** MEDIUM 4.7
- **CVSS:** 4.7 (v3.1, NVD) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; 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.22% (percentile 8, 2026-11-26)
- **CWE:** CWE-362
- **Published:** 2024-06-19T13:56:14.083Z
- **Modified:** 2026-06-17T07:40:43.123Z

## Who should check

- Anyone running Linux \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 2a8d1d95302c7d52c6ac8fa5cb4a6948ae0d3a14; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 5213cc01d0464c011fdc09f318705603ed3a746b; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 4eeffecc8e3cce25bb559502c2fd94a948bcde82; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 77b2b67a0f8bce260c53907e5749d61466d90c87; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 0d9ae1253535f6e85a016e09c25ecbe6f7f59ef0; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< f3baf0f4f92af32943ebf27b960e0552c6c082fd; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< f1d4274a84c069be0f6098ab10c3443fc1f7134c; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 95f00caf767b5968c2c51083957b38be4748a78a; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< da89ce46f02470ef08f0f580755d14d547da59ed
- Anyone running Linux 3.7

## Description

In the Linux kernel, the following vulnerability has been resolved:

m68k: Fix spinlock race in kernel thread creation

Context switching does take care to retain the correct lock owner across
the switch from 'prev' to 'next' tasks.  This does rely on interrupts
remaining disabled for the entire duration of the switch.

This condition is guaranteed for normal process creation and context
switching between already running processes, because both 'prev' and
'next' already have interrupts disabled in their saved copies of the
status register.

The situation is different for newly created kernel threads.  The status
register is set to PS\_S in copy\_thread(), which does leave the IPL at 0.
Upon restoring the 'next' thread's status register in switch\_to() aka
resume(), interrupts then become enabled prematurely.  resume() then
returns via ret\_from\_kernel\_thread() and schedule\_tail() where run queue
lock is released (see finish\_task\_switch() and finish\_lock\_switch()).

A timer interrupt calling scheduler\_tick() before the lock is released
in finish\_task\_switch() will find the lock already taken, with the
current task as lock owner.  This causes a spinlock recursion warning as
reported by Guenter Roeck.

As far as I can ascertain, this race has been opened in commit
533e6903bea0 ("m68k: split ret\_from\_fork(), simplify kernel\_thread()")
but I haven't done a detailed study of kernel history so it may well
predate that commit.

Interrupts cannot be disabled in the saved status register copy for
kernel threads (init will complain about interrupts disabled when
finally starting user space).  Disable interrupts temporarily when
switching the tasks' register sets in resume().

Note that a simple oriw 0x700,%sr after restoring sr is not enough here
- this leaves enough of a race for the 'spinlock recursion' warning to
still be observed.

Tested on ARAnyM and qemu (Quadra 800 emulation).

## Affected and fixed versions

- Linux: \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 2a8d1d95302c7d52c6ac8fa5cb4a6948ae0d3a14; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 5213cc01d0464c011fdc09f318705603ed3a746b; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 4eeffecc8e3cce25bb559502c2fd94a948bcde82; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 77b2b67a0f8bce260c53907e5749d61466d90c87; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 0d9ae1253535f6e85a016e09c25ecbe6f7f59ef0; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< f3baf0f4f92af32943ebf27b960e0552c6c082fd; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< f1d4274a84c069be0f6098ab10c3443fc1f7134c; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 95f00caf767b5968c2c51083957b38be4748a78a; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< da89ce46f02470ef08f0f580755d14d547da59ed (cvelist)
- Linux: 3.7 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2024-38613.md
Affected: Linux >= 533e6903bea0440816a0f517b0845ccea4cc7917, < 2a8d1d95302c7d52c6ac8fa5cb4a6948ae0d3a14; >= 533e6903bea0440816a0f517b0845ccea4cc7917, < 5213cc01d0464c011fdc09f318705603ed3a746b; >= 533e6903bea0440816a0f517b0845ccea4cc7917, < 4eeffecc8e3cce25bb559502c2fd94a948bcde82; >= 533e6903bea0440816a0f51…
Fixed in: Linux 2a8d1d95302c7d52c6ac8fa5cb4a6948ae0d3a14, Linux 5213cc01d0464c011fdc09f318705603ed3a746b, Linux 4eeffecc8e3cce25bb559502c2fd94a948bcde82, Linux 77b2b67a0f8bce260c53907e5749d61466d90c87, Linux 0d9ae1253535f6e85a016e09c25ecbe6f7f59ef0, Linux 95f00caf767b5968c2c51083957b38be4748a78a

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-2024-38613 being exploited?

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

### How serious is CVE-2024-38613?

Medium: CVSS 4.7 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2024-38613?

Linux \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 2a8d1d95302c7d52c6ac8fa5cb4a6948ae0d3a14; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 5213cc01d0464c011fdc09f318705603ed3a746b; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 4eeffecc8e3cce25bb559502c2fd94a948bcde82; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 77b2b67a0f8bce260c53907e5749d61466d90c87; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 0d9ae1253535f6e85a016e09c25ecbe6f7f59ef0; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< f3baf0f4f92af32943ebf27b960e0552c6c082fd; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< f1d4274a84c069be0f6098ab10c3443fc1f7134c; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< 95f00caf767b5968c2c51083957b38be4748a78a; \>= 533e6903bea0440816a0f517b0845ccea4cc7917, \< da89ce46f02470ef08f0f580755d14d547da59ed; Linux 3.7.

### Is there a fix for CVE-2024-38613?

Yes. Fixed in Linux 2a8d1d95302c7d52c6ac8fa5cb4a6948ae0d3a14, Linux 5213cc01d0464c011fdc09f318705603ed3a746b, Linux 4eeffecc8e3cce25bb559502c2fd94a948bcde82, Linux 77b2b67a0f8bce260c53907e5749d61466d90c87, Linux 0d9ae1253535f6e85a016e09c25ecbe6f7f59ef0, Linux 95f00caf767b5968c2c51083957b38be4748a78a. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2024-38613?

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/2a8d1d95302c7d52c6ac8fa5cb4a6948ae0d3a14>
- patch: <https://git.kernel.org/stable/c/5213cc01d0464c011fdc09f318705603ed3a746b>
- patch: <https://git.kernel.org/stable/c/4eeffecc8e3cce25bb559502c2fd94a948bcde82>
- patch: <https://git.kernel.org/stable/c/77b2b67a0f8bce260c53907e5749d61466d90c87>
- patch: <https://git.kernel.org/stable/c/0d9ae1253535f6e85a016e09c25ecbe6f7f59ef0>
- patch: <https://git.kernel.org/stable/c/f3baf0f4f92af32943ebf27b960e0552c6c082fd>
- patch: <https://git.kernel.org/stable/c/f1d4274a84c069be0f6098ab10c3443fc1f7134c>
- patch: <https://git.kernel.org/stable/c/95f00caf767b5968c2c51083957b38be4748a78a>
- patch: <https://git.kernel.org/stable/c/da89ce46f02470ef08f0f580755d14d547da59ed>

## 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-2024-38613>

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