Skip to content
Heist/ feed
Back to feed
UnratedFix available

m68k: Fix spinlock race in kernel thread creation

Type: advisorySources: OSV

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 ker

Products
Kernel
Affected versions
Not specified
Fixed versions
4.19.316, 5.10.219, 5.15.161, 5.4.278, 6.1.93, 6.6.33, 6.8.12, 6.9.3
CVEs
CVE-2024-38613
Confirmed fixed CVEs
Not specified
Updated in this feed
7 Nov 2026, 04:45 UTC · Revision 1

Source evidence

m68k: Fix spinlock race in kernel thread creation

core-osv · Original source

Published 19 Jun 2024, 13:56 UTC

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 ker

osv:CVE-2024-38613

Kernel

Fixed versions: 4.19.316, 5.4.278, 5.10.219, 5.15.161, 6.1.93, 6.6.33, 6.8.12, 6.9.3

Complete source record
{
  "id": "938a2049ffd96fb2ef556b7a6b954c781db356566c23c0eeb9d56e6b6ef38d92",
  "url": "https://osv.dev/vulnerability/CVE-2024-38613",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "m68k: Fix spinlock race in kernel thread creation",
    "summary": "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 ker",
    "evidence": "osv:CVE-2024-38613",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "4.19.316",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.4.278",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.10.219",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.15.161",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.1.93",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.6.33",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.8.12",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.9.3",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2024-38613",
      "aliases": [
        "CVE-2024-38613"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "533e6903bea0440816a0f517b0845ccea4cc7917"
                },
                {
                  "fixed": "2a8d1d95302c7d52c6ac8fa5cb4a6948ae0d3a14"
                },
                {
                  "fixed": "5213cc01d0464c011fdc09f318705603ed3a746b"
                },
                {
                  "fixed": "4eeffecc8e3cce25bb559502c2fd94a948bcde82"
                },
                {
                  "fixed": "77b2b67a0f8bce260c53907e5749d61466d90c87"
                },
                {
                  "fixed": "0d9ae1253535f6e85a016e09c25ecbe6f7f59ef0"
                },
                {
                  "fixed": "f3baf0f4f92af32943ebf27b960e0552c6c082fd"
                },
                {
                  "fixed": "f1d4274a84c069be0f6098ab10c3443fc1f7134c"
                },
                {
                  "fixed": "95f00caf767b5968c2c51083957b38be4748a78a"
                },
                {
                  "fixed": "da89ce46f02470ef08f0f580755d14d547da59ed"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-38613.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "3.7.0"
                },
                {
                  "fixed": "4.19.316"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.20.0"
                },
                {
                  "fixed": "5.4.278"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.5.0"
                },
                {
                  "fixed": "5.10.219"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.11.0"
                },
                {
                  "fixed": "5.15.161"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "6.1.93"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.6.33"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.7.0"
                },
                {
                  "fixed": "6.8.12"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.9.0"
                },
                {
                  "fixed": "6.9.3"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-38613.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:49.805396867Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/0d9ae1253535f6e85a016e09c25ecbe6f7f59ef0",
        "https://git.kernel.org/stable/c/2a8d1d95302c7d52c6ac8fa5cb4a6948ae0d3a14",
        "https://git.kernel.org/stable/c/4eeffecc8e3cce25bb559502c2fd94a948bcde82",
        "https://git.kernel.org/stable/c/5213cc01d0464c011fdc09f318705603ed3a746b",
        "https://git.kernel.org/stable/c/77b2b67a0f8bce260c53907e5749d61466d90c87",
        "https://git.kernel.org/stable/c/95f00caf767b5968c2c51083957b38be4748a78a",
        "https://git.kernel.org/stable/c/da89ce46f02470ef08f0f580755d14d547da59ed",
        "https://git.kernel.org/stable/c/f1d4274a84c069be0f6098ab10c3443fc1f7134c",
        "https://git.kernel.org/stable/c/f3baf0f4f92af32943ebf27b960e0552c6c082fd",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/38xxx/CVE-2024-38613.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-38613",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/38xxx/CVE-2024-38613.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-38613",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 518240,
  "published_at": "2024-06-19T13:56:14.083+00:00"
}