CVE-2024-38613

m68k: Fix spinlock race in kernel thread creation

No CVSS score yet EPSS 0.18%

Published 19 Jun 2024 Updated 11 May 2026 CNA: Linux

Check your servers for CVE-2024-38613

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-38613 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

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

Exploitation

EPSS 0.18%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 7.82% of all scored CVEs. Scores of 1 Dec 2026.

The assessment of CISA (SSVC, 10 Sep 2024):

Exploitation
none: CISA did not find evidence of exploitation or a public proof of concept
Automatable
no: each attack takes manual steps
Technical impact
partial: limited control or limited data

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from 533e6903bea0440816a0f517b0845ccea4cc7917, before 2a8d1d95302c7d52c6ac8fa5cb4a6948ae0d3a14
affected from 533e6903bea0440816a0f517b0845ccea4cc7917, before 5213cc01d0464c011fdc09f318705603ed3a746b
affected from 533e6903bea0440816a0f517b0845ccea4cc7917, before 4eeffecc8e3cce25bb559502c2fd94a948bcde82
affected from 533e6903bea0440816a0f517b0845ccea4cc7917, before 77b2b67a0f8bce260c53907e5749d61466d90c87
affected from 533e6903bea0440816a0f517b0845ccea4cc7917, before 0d9ae1253535f6e85a016e09c25ecbe6f7f59ef0
affected from 533e6903bea0440816a0f517b0845ccea4cc7917, before f3baf0f4f92af32943ebf27b960e0552c6c082fd
affected from 533e6903bea0440816a0f517b0845ccea4cc7917, before f1d4274a84c069be0f6098ab10c3443fc1f7134c
affected from 533e6903bea0440816a0f517b0845ccea4cc7917, before 95f00caf767b5968c2c51083957b38be4748a78a
affected from 533e6903bea0440816a0f517b0845ccea4cc7917, before da89ce46f02470ef08f0f580755d14d547da59ed
Other versions: unaffected
Linux
affected 3.7
unaffected before 3.7
unaffected from 4.19.316 up to and including 4.19.*
unaffected from 5.4.278 up to and including 5.4.*
unaffected from 5.10.219 up to and including 5.10.*
unaffected from 5.15.161 up to and including 5.15.*
unaffected from 6.1.93 up to and including 6.1.*
unaffected from 6.6.33 up to and including 6.6.*
unaffected from 6.8.12 up to and including 6.8.*
unaffected from 6.9.3 up to and including 6.9.*
unaffected 6.10 and later
Other versions: affected

Is my server affected?

This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:

uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2024-38613 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2024-38613

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2024-38613
trivy image --scanners vuln IMAGE | grep CVE-2024-38613

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2024-38613 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.