CVE-2024-42151

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-42151
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-42151.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-42151
Downstream
Published
2024-07-30T07:46:43Z
Modified
2025-10-17T09:18:22.133920Z
Summary
bpf: mark bpf_dummy_struct_ops.test_1 parameter as nullable
Details

In the Linux kernel, the following vulnerability has been resolved:

bpf: mark bpfdummystructops.test1 parameter as nullable

Test case dummystops/dummyinitretvalue passes NULL as the first parameter of the test1() function. Mark this parameter as nullable to make verifier aware of such possibility. Otherwise, NULL check in the test_1() code:

  SEC("struct_ops/test_1")
  int BPF_PROG(test_1, struct bpf_dummy_ops_state *state)
  {
        if (!state)
                return ...;

        ... access state ...
  }

Might be removed by verifier, thus triggering NULL pointer dereference under certain conditions.

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
2cd3e3772e41377f32d6eea643e0590774e9187c
Fixed
7f79097b0de97a486b137b750d7dd7b20b519d23
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
2cd3e3772e41377f32d6eea643e0590774e9187c
Fixed
1479eaff1f16983d8fda7c5a08a586c21891087d

Affected versions

v6.*

v6.7
v6.7-rc4
v6.7-rc5
v6.7-rc6
v6.7-rc7
v6.7-rc8
v6.8
v6.8-rc1
v6.8-rc2
v6.8-rc3
v6.8-rc4
v6.8-rc5
v6.8-rc6
v6.8-rc7
v6.9
v6.9-rc1
v6.9-rc2
v6.9-rc3
v6.9-rc4
v6.9-rc5
v6.9-rc6
v6.9-rc7
v6.9.1
v6.9.2
v6.9.3
v6.9.4
v6.9.5
v6.9.6
v6.9.7
v6.9.8

Database specific

vanir_signatures

[
    {
        "deprecated": false,
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1479eaff1f16983d8fda7c5a08a586c21891087d",
        "digest": {
            "line_hashes": [
                "231343599704148036501506129372454447099",
                "335660091885675914242058876653092530300",
                "213080299431790465083770648792387917379",
                "310156553827552868110639109265003482144",
                "77327420847813350561483950105142045288",
                "76871529806122848336704665242366475468",
                "12202821473798406800682129759181583450",
                "250213874736480337929026231773636122513"
            ],
            "threshold": 0.9
        },
        "signature_type": "Line",
        "id": "CVE-2024-42151-21dacc08",
        "target": {
            "file": "net/bpf/bpf_dummy_struct_ops.c"
        },
        "signature_version": "v1"
    },
    {
        "deprecated": false,
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7f79097b0de97a486b137b750d7dd7b20b519d23",
        "digest": {
            "line_hashes": [
                "231343599704148036501506129372454447099",
                "335660091885675914242058876653092530300",
                "213080299431790465083770648792387917379",
                "310156553827552868110639109265003482144",
                "77327420847813350561483950105142045288",
                "76871529806122848336704665242366475468",
                "12202821473798406800682129759181583450",
                "250213874736480337929026231773636122513"
            ],
            "threshold": 0.9
        },
        "signature_type": "Line",
        "id": "CVE-2024-42151-4cb7fe65",
        "target": {
            "file": "net/bpf/bpf_dummy_struct_ops.c"
        },
        "signature_version": "v1"
    }
]

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.8.0
Fixed
6.9.9