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.
[
{
"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"
}
]