CVE-2024-58237 (GCVE-0-2024-58237)
Vulnerability from cvelistv5
Published
2025-05-05 14:53
Modified
2025-05-09 08:06
Severity ?
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.
Impacted products
Vendor Product Version
Linux Linux Version: 51c39bb1d5d105a02e29aa7960f0a395086e6342
Version: 51c39bb1d5d105a02e29aa7960f0a395086e6342
Version: 51c39bb1d5d105a02e29aa7960f0a395086e6342
Create a notification for this product.
   Linux Linux Version: 5.6
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."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-05-09T08:06:10.185Z",
        "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": "2025-05-09T08:06:10.185Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-58237\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-05-05T15:15:54.010\",\"lastModified\":\"2025-05-09T08:15:19.030\",\"vulnStatus\":\"Awaiting Analysis\",\"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.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/1a4607ffba35bf2a630aab299e34dd3f6e658d70\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/1c2244437f9ad3dd91215f920401a14f2542dbfc\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/f1692ee23dcaaddc24ba407b269707ee5df1301f\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…