Skip to content
Heist/ feed
Back to feed
UnratedFix available

libbpf: Prevent null-pointer dereference when prog to load has no BTF

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: libbpf: Prevent null-pointer dereference when prog to load has no BTF In bpf_objec_load_prog(), there's no guarantee that obj->btf is non-NULL when passing it to btf__fd(), and this function does not perform any check before dereferencing its argument (as bpf_object__btf_fd() used to do). As a consequence, we get segmentation fault errors in bpftool (for example) when trying to load programs that come without BTF information. v2: Keep btf__fd() in the fix instead of reverting to bpf_object__btf_fd().

Products
Kernel
Affected versions
Not specified
Fixed versions
6.8.12, 6.9.3
CVEs
CVE-2024-38574
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 01:00 UTC · Revision 1

Source evidence

libbpf: Prevent null-pointer dereference when prog to load has no BTF

core-osv · Original source

Published 19 Jun 2024, 13:35 UTC

In the Linux kernel, the following vulnerability has been resolved: libbpf: Prevent null-pointer dereference when prog to load has no BTF In bpf_objec_load_prog(), there's no guarantee that obj->btf is non-NULL when passing it to btf__fd(), and this function does not perform any check before dereferencing its argument (as bpf_object__btf_fd() used to do). As a consequence, we get segmentation fault errors in bpftool (for example) when trying to load programs that come without BTF information. v2: Keep btf__fd() in the fix instead of reverting to bpf_object__btf_fd().

osv:CVE-2024-38574

Kernel

Fixed versions: 6.8.12, 6.9.3

Complete source record
{
  "id": "55e722f3cc318fbb28aba77c89f08219d5e504e4f6b1d2854180d9b0f5ecac68",
  "url": "https://osv.dev/vulnerability/CVE-2024-38574",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "libbpf: Prevent null-pointer dereference when prog to load has no BTF",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: libbpf: Prevent null-pointer dereference when prog to load has no BTF In bpf_objec_load_prog(), there's no guarantee that obj->btf is non-NULL when passing it to btf__fd(), and this function does not perform any check before dereferencing its argument (as bpf_object__btf_fd() used to do). As a consequence, we get segmentation fault errors in bpftool (for example) when trying to load programs that come without BTF information. v2: Keep btf__fd() in the fix instead of reverting to bpf_object__btf_fd().",
    "evidence": "osv:CVE-2024-38574",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.8.12",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.9.3",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2024-38574",
      "aliases": [
        "CVE-2024-38574"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "df7c3f7d3a3ddab31ca8cfa9b86a8729ec43fd2e"
                },
                {
                  "fixed": "ef80b59acfa4dee4b5eaccb15572b69248831104"
                },
                {
                  "fixed": "1fd91360a75833b7110af9834ae26c977e1273e0"
                },
                {
                  "fixed": "9bf48fa19a4b1d186e08b20bf7e5de26a15644fb"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-38574.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.8.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-38574.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:41.535374492Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/1fd91360a75833b7110af9834ae26c977e1273e0",
        "https://git.kernel.org/stable/c/9bf48fa19a4b1d186e08b20bf7e5de26a15644fb",
        "https://git.kernel.org/stable/c/ef80b59acfa4dee4b5eaccb15572b69248831104",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/38xxx/CVE-2024-38574.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-38574",
        "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-38574.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-38574",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 508843,
  "published_at": "2024-06-19T13:35:39.015+00:00"
}