cbcvebase.
CVE-2024-38613
published 2024-06-19

CVE-2024-38613: In the Linux kernel, the following vulnerability has been resolved: m68k: Fix spinlock race in kernel thread creation Context switching does take care to…

PriorityP417medium4.7CVSS 3.1
AVLACHPRLUINSUCNINAH
EPSS
0.18%
7.5th percentile
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

26 ranges· showing 25
VendorProductVersion rangeFixed in
debianlinux< linux 6.1.94-1 (bookworm)linux 6.1.94-1 (bookworm)
linuxlinux
linuxlinux>= 533e6903bea0440816a0f517b0845ccea4cc7917 < 2a8d1d95302c7d52c6ac8fa5cb4a6948ae0d3a142a8d1d95302c7d52c6ac8fa5cb4a6948ae0d3a14
linuxlinux>= 533e6903bea0440816a0f517b0845ccea4cc7917 < 5213cc01d0464c011fdc09f318705603ed3a746b5213cc01d0464c011fdc09f318705603ed3a746b
linuxlinux>= 533e6903bea0440816a0f517b0845ccea4cc7917 < 4eeffecc8e3cce25bb559502c2fd94a948bcde824eeffecc8e3cce25bb559502c2fd94a948bcde82
linuxlinux>= 533e6903bea0440816a0f517b0845ccea4cc7917 < 77b2b67a0f8bce260c53907e5749d61466d90c8777b2b67a0f8bce260c53907e5749d61466d90c87
linuxlinux>= 533e6903bea0440816a0f517b0845ccea4cc7917 < 0d9ae1253535f6e85a016e09c25ecbe6f7f59ef00d9ae1253535f6e85a016e09c25ecbe6f7f59ef0
linuxlinux>= 533e6903bea0440816a0f517b0845ccea4cc7917 < f3baf0f4f92af32943ebf27b960e0552c6c082fdf3baf0f4f92af32943ebf27b960e0552c6c082fd
linuxlinux>= 533e6903bea0440816a0f517b0845ccea4cc7917 < f1d4274a84c069be0f6098ab10c3443fc1f7134cf1d4274a84c069be0f6098ab10c3443fc1f7134c
linuxlinux>= 533e6903bea0440816a0f517b0845ccea4cc7917 < 95f00caf767b5968c2c51083957b38be4748a78a95f00caf767b5968c2c51083957b38be4748a78a
linuxlinux>= 533e6903bea0440816a0f517b0845ccea4cc7917 < da89ce46f02470ef08f0f580755d14d547da59edda89ce46f02470ef08f0f580755d14d547da59ed
linuxlinux_kernel>= 0 < 5.10.221-15.10.221-1
linuxlinux_kernel>= 0 < 6.1.94-16.1.94-1
linuxlinux_kernel>= 0 < 6.8.12-16.8.12-1
linuxlinux_kernel>= 0 < 6.8.12-16.8.12-1
linuxlinux_kernel>= 0 < 5.4.0-192.2125.4.0-192.212
linuxlinux_kernel>= 0 < 5.15.0-121.1315.15.0-121.131
linuxlinux_kernel>= 0 < 6.8.0-40.406.8.0-40.40
linuxlinux_kernel>= 3.7 < 4.19.3164.19.316
linuxlinux_kernel>= 4.20 < 5.4.2785.4.278
linuxlinux_kernel>= 5.11 < 5.15.1615.15.161
linuxlinux_kernel>= 5.16 < 6.1.936.1.93
linuxlinux_kernel>= 5.5 < 5.10.2195.10.219
linuxlinux_kernel>= 6.2 < 6.6.336.6.33
linuxlinux_kernel>= 6.7 < 6.8.126.8.12

CVSS provenance

nvdv3.14.7MEDIUMCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
osv7.8HIGH
vendor_ubuntu7.8HIGH
vendor_debian4.7MEDIUM
vendor_redhat4.7MEDIUM
Stop checking back — get the weekly exploitation signal.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.