CVE-2024-58237 (GCVE-0-2024-58237)

Vulnerability from cvelistv5 – Published: 2025-05-05 14:53 – Updated: 2026-08-05 11:47
VLAI
Title
bpf: consider that tail calls invalidate packet pointers
Summary
In the Linux kernel, the following vulnerability has been resolved: bpf: consider that tail calls invalidate packet pointers Tail-called programs could execute any of the helpers that invalidate packet pointers. Hence, conservatively assume that each tail call invalidates packet pointers. Making the change in bpf_helper_changes_pkt_data() automatically makes use of check_cfg() logic that computes 'changes_pkt_data' effect for global sub-programs, such that the following program could be rejected: int tail_call(struct __sk_buff *sk) { bpf_tail_call_static(sk, &jmp_table, 0); return 0; } SEC("tc") int not_safe(struct __sk_buff *sk) { int *p = (void *)(long)sk->data; ... make p valid ... tail_call(sk); *p = 42; /* this is unsafe */ ... } The tc_bpf2bpf.c:subprog_tc() needs change: mark it as a function that can invalidate packet pointers. Otherwise, it can't be freplaced with tailcall_freplace.c:entry_freplace() that does a tail call.
Assigner
Impacted products
Vendor Product Version
Linux Linux Affected: 51c39bb1d5d105a02e29aa7960f0a395086e6342 , < f1692ee23dcaaddc24ba407b269707ee5df1301f (git)
Affected: 51c39bb1d5d105a02e29aa7960f0a395086e6342 , < 1c2244437f9ad3dd91215f920401a14f2542dbfc (git)
Affected: 51c39bb1d5d105a02e29aa7960f0a395086e6342 , < 1a4607ffba35bf2a630aab299e34dd3f6e658d70 (git)
Create a notification for this product.
Linux Linux Affected: 5.6
Unaffected: 0 , < 5.6 (semver)
Unaffected: 6.6.90 , ≤ 6.6.* (semver)
Unaffected: 6.12.9 , ≤ 6.12.* (semver)
Unaffected: 6.13 , ≤ * (original_commit_for_fix)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "net/core/filter.c",
            "tools/testing/selftests/bpf/progs/tc_bpf2bpf.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "f1692ee23dcaaddc24ba407b269707ee5df1301f",
              "status": "affected",
              "version": "51c39bb1d5d105a02e29aa7960f0a395086e6342",
              "versionType": "git"
            },
            {
              "lessThan": "1c2244437f9ad3dd91215f920401a14f2542dbfc",
              "status": "affected",
              "version": "51c39bb1d5d105a02e29aa7960f0a395086e6342",
              "versionType": "git"
            },
            {
              "lessThan": "1a4607ffba35bf2a630aab299e34dd3f6e658d70",
              "status": "affected",
              "version": "51c39bb1d5d105a02e29aa7960f0a395086e6342",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "net/core/filter.c",
            "tools/testing/selftests/bpf/progs/tc_bpf2bpf.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.6"
            },
            {
              "lessThan": "5.6",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.90",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.9",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.13",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.90",
                  "versionStartIncluding": "5.6",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.9",
                  "versionStartIncluding": "5.6",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.13",
                  "versionStartIncluding": "5.6",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: consider that tail calls invalidate packet pointers\n\nTail-called programs could execute any of the helpers that invalidate\npacket pointers. Hence, conservatively assume that each tail call\ninvalidates packet pointers.\n\nMaking the change in bpf_helper_changes_pkt_data() automatically makes\nuse of check_cfg() logic that computes \u0027changes_pkt_data\u0027 effect for\nglobal sub-programs, such that the following program could be\nrejected:\n\n    int tail_call(struct __sk_buff *sk)\n    {\n    \tbpf_tail_call_static(sk, \u0026jmp_table, 0);\n    \treturn 0;\n    }\n\n    SEC(\"tc\")\n    int not_safe(struct __sk_buff *sk)\n    {\n    \tint *p = (void *)(long)sk-\u003edata;\n    \t... make p valid ...\n    \ttail_call(sk);\n    \t*p = 42; /* this is unsafe */\n    \t...\n    }\n\nThe tc_bpf2bpf.c:subprog_tc() needs change: mark it as a function that\ncan invalidate packet pointers. Otherwise, it can\u0027t be freplaced with\ntailcall_freplace.c:entry_freplace() that does a tail call."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The vulnerability is a BPF verifier flaw triggered by loading a crafted eBPF program through the bpf() syscall; the resulting memory corruption occurs during local packet processing controlled by the attacker, requiring local access.\nAC:L - The attacker fully controls the malicious program, its subprogram/tail-call structure, and the heap grooming, so acceptance by the buggy verifier and the subsequent stale-pointer dereference are fully reliable with no attacker-uncontrolled conditions.\nPR:L - Reaching the flaw requires loading a packet-processing eBPF program (e.g., SCHED_CLS/tc) which needs the CAP_BPF/CAP_NET_ADMIN privilege over the BPF subsystem \u2014 a limited, delegatable privilege over the component rather than full root.\nUI:N - The attacker loads, attaches, and triggers the malicious program entirely on their own; no action by any other user is required.\nS:U - The verifier bypass corrupts kernel heap memory within the kernel\u0027s own security authority; there is no crossing into a different security scope such as a VM or IOMMU boundary.\nC:H - The stale packet pointer permits out-of-bounds reads of reallocated/adjacent kernel heap memory, allowing disclosure of sensitive kernel data.\nI:H - The verifier accepts a program that writes through a stale packet pointer (`*p = 42`), giving a controlled out-of-bounds write to kernel heap memory that can be leveraged into an arbitrary-write/control-flow-hijack primitive.\nA:H - Out-of-bounds reads/writes on reallocated kernel heap memory readily cause kernel memory corruption and panic/oops."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T11:47:47.022Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/f1692ee23dcaaddc24ba407b269707ee5df1301f"
        },
        {
          "url": "https://git.kernel.org/stable/c/1c2244437f9ad3dd91215f920401a14f2542dbfc"
        },
        {
          "url": "https://git.kernel.org/stable/c/1a4607ffba35bf2a630aab299e34dd3f6e658d70"
        }
      ],
      "title": "bpf: consider that tail calls invalidate packet pointers",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-58237",
    "datePublished": "2025-05-05T14:53:34.153Z",
    "dateReserved": "2025-04-16T07:19:43.804Z",
    "dateUpdated": "2026-08-05T11:47:47.022Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2024-58237",
      "date": "2026-08-05",
      "epss": "0.00171",
      "percentile": "0.06722"
    },
    "microsoft_vex": {
      "current_release_date": "2026-03-31T15:11:32.000Z",
      "cve": "CVE-2024-58237",
      "id": "msrc_CVE-2024-58237",
      "initial_release_date": "2025-05-02T00:00:00.000Z",
      "product_status:fixed": "2",
      "product_status:known_affected": "5",
      "source": "Microsoft CSAF VEX",
      "status": "final",
      "title": "bpf: consider that tail calls invalidate packet pointers",
      "url": "https://msrc.microsoft.com/csaf/vex/2025/msrc_cve-2024-58237.json",
      "version": "4"
    },
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-58237\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-05-05T15:15:54.010\",\"lastModified\":\"2026-06-17T08:14:41.787\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nbpf: consider that tail calls invalidate packet pointers\\n\\nTail-called programs could execute any of the helpers that invalidate\\npacket pointers. Hence, conservatively assume that each tail call\\ninvalidates packet pointers.\\n\\nMaking the change in bpf_helper_changes_pkt_data() automatically makes\\nuse of check_cfg() logic that computes \u0027changes_pkt_data\u0027 effect for\\nglobal sub-programs, such that the following program could be\\nrejected:\\n\\n    int tail_call(struct __sk_buff *sk)\\n    {\\n    \\tbpf_tail_call_static(sk, \u0026jmp_table, 0);\\n    \\treturn 0;\\n    }\\n\\n    SEC(\\\"tc\\\")\\n    int not_safe(struct __sk_buff *sk)\\n    {\\n    \\tint *p = (void *)(long)sk-\u003edata;\\n    \\t... make p valid ...\\n    \\ttail_call(sk);\\n    \\t*p = 42; /* this is unsafe */\\n    \\t...\\n    }\\n\\nThe tc_bpf2bpf.c:subprog_tc() needs change: mark it as a function that\\ncan invalidate packet pointers. Otherwise, it can\u0027t be freplaced with\\ntailcall_freplace.c:entry_freplace() that does a tail call.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: bpf: considerar que las llamadas de cola invalidan los punteros de paquete. Los programas con llamadas de cola podr\u00edan ejecutar cualquiera de los ayudantes que invalidan los punteros de paquete. Por lo tanto, se asume, de forma conservadora, que cada llamada de cola invalida los punteros de paquete. Al realizar el cambio en bpf_helper_changes_pkt_data(), se utiliza autom\u00e1ticamente la l\u00f3gica check_cfg(), que calcula el efecto de \u0027changes_pkt_data\u0027 para los subprogramas globales, de modo que el siguiente programa podr\u00eda ser rechazado: int tail_call(struct __sk_buff *sk) { bpf_tail_call_static(sk, \u0026amp;jmp_table, 0); return 0; } SEC(\\\"tc\\\") int not_safe(struct __sk_buff *sk) { int *p = (void *)(long)sk-\u0026gt;data; ... make p valid ... tail_call(sk); *p = 42; /* esto no es seguro */ ... } La funci\u00f3n tc_bpf2bpf.c:subprog_tc() debe modificarse: m\u00e1rquela como una funci\u00f3n que puede invalidar punteros de paquetes. De lo contrario, no se puede reemplazar con tailcall_freplace.c:entry_freplace(), que realiza una llamada de cola.\"}],\"affected\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"affectedData\":[{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"unaffected\",\"programFiles\":[\"net/core/filter.c\",\"tools/testing/selftests/bpf/progs/tc_bpf2bpf.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"51c39bb1d5d105a02e29aa7960f0a395086e6342\",\"lessThan\":\"f1692ee23dcaaddc24ba407b269707ee5df1301f\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"51c39bb1d5d105a02e29aa7960f0a395086e6342\",\"lessThan\":\"1c2244437f9ad3dd91215f920401a14f2542dbfc\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"51c39bb1d5d105a02e29aa7960f0a395086e6342\",\"lessThan\":\"1a4607ffba35bf2a630aab299e34dd3f6e658d70\",\"versionType\":\"git\",\"status\":\"affected\"}]},{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"affected\",\"programFiles\":[\"net/core/filter.c\",\"tools/testing/selftests/bpf/progs/tc_bpf2bpf.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"5.6\",\"status\":\"affected\"},{\"version\":\"0\",\"lessThan\":\"5.6\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.6.90\",\"lessThanOrEqual\":\"6.6.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.12.9\",\"lessThanOrEqual\":\"6.12.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.13\",\"lessThanOrEqual\":\"*\",\"versionType\":\"original_commit_for_fix\",\"status\":\"unaffected\"}]}]}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H\",\"baseScore\":5.5,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":3.6}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-476\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.6\",\"versionEndExcluding\":\"6.6.90\",\"matchCriteriaId\":\"639CB8B7-A013-410F-ACC9-35ADBDE2AC4C\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.7\",\"versionEndExcluding\":\"6.12.9\",\"matchCriteriaId\":\"1D13AF97-FFED-4B68-906D-CFE38D0B88DD\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.13:rc1:*:*:*:*:*:*\",\"matchCriteriaId\":\"62567B3C-6CEE-46D0-BC2E-B3717FBF7D13\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.13:rc2:*:*:*:*:*:*\",\"matchCriteriaId\":\"5A073481-106D-4B15-B4C7-FB0213B8E1D4\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/1a4607ffba35bf2a630aab299e34dd3f6e658d70\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/1c2244437f9ad3dd91215f920401a14f2542dbfc\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/f1692ee23dcaaddc24ba407b269707ee5df1301f\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}",
    "redhat_vex": {
      "aggregate_severity": "Moderate",
      "current_release_date": "2026-08-04T14:12:05+00:00",
      "cve": "CVE-2024-58237",
      "id": "CVE-2024-58237",
      "initial_release_date": "2024-01-01T00:00:00+00:00",
      "product_status:known_affected": "274",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: bpf: consider that tail calls invalidate packet pointers",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2024/cve-2024-58237.json",
      "version": "3"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…