Skip to content
Heist/ feed
Back to feed
HighFix available

bpf: Fix a kernel verifier crash in stacksafe()

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: bpf: Fix a kernel verifier crash in stacksafe() Daniel Hodges reported a kernel verifier crash when playing with sched-ext. Further investigation shows that the crash is due to invalid memory access in stacksafe(). More specifically, it is the following code: if (exact != NOT_EXACT && old->stack[spi].slot_type[i % BPF_REG_SIZE] != cur->stack[spi].slot_type[i % BPF_REG_SIZE]) return false; The 'i' iterates old->allocated_stack. If cur->allocated_stack < old->allocated_stack the out-of-bound access will happen. To fix the issue add 'i >= cur->allocated_stack' check such that if the condition is true, stacksafe() should fail. Otherwise, cur->stack[spi].slot_type[i % BPF_REG_SIZE] memory access is legal.

Products
Kernel
Affected versions
Not specified
Fixed versions
6.10.7, 6.6.48
CVEs
CVE-2024-45020
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 17:04 UTC · Revision 1

Source evidence

bpf: Fix a kernel verifier crash in stacksafe()

core-osv · Original source

Published 11 Sept 2024, 15:13 UTC

In the Linux kernel, the following vulnerability has been resolved: bpf: Fix a kernel verifier crash in stacksafe() Daniel Hodges reported a kernel verifier crash when playing with sched-ext. Further investigation shows that the crash is due to invalid memory access in stacksafe(). More specifically, it is the following code: if (exact != NOT_EXACT && old->stack[spi].slot_type[i % BPF_REG_SIZE] != cur->stack[spi].slot_type[i % BPF_REG_SIZE]) return false; The 'i' iterates old->allocated_stack. If cur->allocated_stack < old->allocated_stack the out-of-bound access will happen. To fix the issue add 'i >= cur->allocated_stack' check such that if the condition is true, stacksafe() should fail. Otherwise, cur->stack[spi].slot_type[i % BPF_REG_SIZE] memory access is legal.

osv:CVE-2024-45020

Kernel

Fixed versions: 6.6.48, 6.10.7

Complete source record
{
  "id": "aefbf464f2dbd1aac843a4c758852c1ab4da5c6d48c3557bc0f5d3325a949bc7",
  "url": "https://osv.dev/vulnerability/CVE-2024-45020",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "bpf: Fix a kernel verifier crash in stacksafe()",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: bpf: Fix a kernel verifier crash in stacksafe() Daniel Hodges reported a kernel verifier crash when playing with sched-ext. Further investigation shows that the crash is due to invalid memory access in stacksafe(). More specifically, it is the following code: if (exact != NOT_EXACT && old->stack[spi].slot_type[i % BPF_REG_SIZE] != cur->stack[spi].slot_type[i % BPF_REG_SIZE]) return false; The 'i' iterates old->allocated_stack. If cur->allocated_stack < old->allocated_stack the out-of-bound access will happen. To fix the issue add 'i >= cur->allocated_stack' check such that if the condition is true, stacksafe() should fail. Otherwise, cur->stack[spi].slot_type[i % BPF_REG_SIZE] memory access is legal.",
    "evidence": "osv:CVE-2024-45020",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.6.48",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.10.7",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "CVE-2024-45020",
      "aliases": [
        "CVE-2024-45020"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "ab470fefce2837e66b771c60858118d50bb5bb10"
                },
                {
                  "fixed": "7cad3174cc79519bf5f6c4441780264416822c08"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "2793a8b015f7f1caadb9bce9c63dc659f7522676"
                },
                {
                  "fixed": "6e3987ac310c74bb4dd6a2fa8e46702fe505fb2b"
                },
                {
                  "fixed": "bed2eb964c70b780fb55925892a74f26cb590b25"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "6.6.15"
                },
                {
                  "fixed": "6.6.48"
                }
              ]
            }
          ],
          "versions": [
            "v6.6.47",
            "v6.6.46",
            "v6.6.45",
            "v6.6.44",
            "v6.6.43",
            "v6.6.42",
            "v6.6.41",
            "v6.6.40",
            "v6.6.39",
            "v6.6.38",
            "v6.6.37",
            "v6.6.36",
            "v6.6.35",
            "v6.6.34",
            "v6.6.33",
            "v6.6.32",
            "v6.6.31",
            "v6.6.30",
            "v6.6.29",
            "v6.6.28",
            "v6.6.27",
            "v6.6.26",
            "v6.6.25",
            "v6.6.24",
            "v6.6.23",
            "v6.6.22",
            "v6.6.21",
            "v6.6.20",
            "v6.6.19",
            "v6.6.18",
            "v6.6.17",
            "v6.6.16",
            "v6.6.15"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-45020.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "6.6.48"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.7.0"
                },
                {
                  "fixed": "6.10.7"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-45020.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:21.590496866Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/6e3987ac310c74bb4dd6a2fa8e46702fe505fb2b",
        "https://git.kernel.org/stable/c/7cad3174cc79519bf5f6c4441780264416822c08",
        "https://git.kernel.org/stable/c/bed2eb964c70b780fb55925892a74f26cb590b25",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/45xxx/CVE-2024-45020.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-45020",
        "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/45xxx/CVE-2024-45020.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-45020",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 487473,
  "published_at": "2024-09-11T15:13:54.591+00:00"
}