# CVE-2024-43837: bpf: Fix null pointer dereference in resolve\_prog\_type() for BPF\_PROG\_TYPE\_EXT

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.30% (percentile 16, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2024-08-17T09:21:53.763Z
- **Modified:** 2026-06-17T07:51:48.597Z

## Who should check

- Anyone running Linux \>= 4a9c7bbe2ed4d2b240674b1fb606c41d3940c412, \< fcac5feb06f31ee4c88bca9bf98d8bc3ca7d2615; \>= 4a9c7bbe2ed4d2b240674b1fb606c41d3940c412, \< 9d40fd516aeae6779e3c84c6b96700ca76285847; \>= 4a9c7bbe2ed4d2b240674b1fb606c41d3940c412, \< b29a880bb145e1f1c1df5ab88ed26b1495ff9f09; \>= 4a9c7bbe2ed4d2b240674b1fb606c41d3940c412, \< f7866c35873377313ff94398f17d425b28b71de1
- Anyone running Linux 5.18

## Description

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

bpf: Fix null pointer dereference in resolve\_prog\_type() for BPF\_PROG\_TYPE\_EXT

When loading a EXT program without specifying \`attr-\>attach\_prog\_fd\`,
the \`prog-\>aux-\>dst\_prog\` will be null. At this time, calling
resolve\_prog\_type() anywhere will result in a null pointer dereference.

Example stack trace:

\[    8.107863\] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000004
\[    8.108262\] Mem abort info:
\[    8.108384\]   ESR = 0x0000000096000004
\[    8.108547\]   EC = 0x25: DABT (current EL), IL = 32 bits
\[    8.108722\]   SET = 0, FnV = 0
\[    8.108827\]   EA = 0, S1PTW = 0
\[    8.108939\]   FSC = 0x04: level 0 translation fault
\[    8.109102\] Data abort info:
\[    8.109203\]   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
\[    8.109399\]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
\[    8.109614\]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
\[    8.109836\] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000101354000
\[    8.110011\] \[0000000000000004\] pgd=0000000000000000, p4d=0000000000000000
\[    8.112624\] Internal error: Oops: 0000000096000004 \[\#1\] PREEMPT SMP
\[    8.112783\] Modules linked in:
\[    8.113120\] CPU: 0 PID: 99 Comm: may\_access\_dire Not tainted 6.10.0-rc3-next-20240613-dirty \#1
\[    8.113230\] Hardware name: linux,dummy-virt (DT)
\[    8.113390\] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
\[    8.113429\] pc : may\_access\_direct\_pkt\_data+0x24/0xa0
\[    8.113746\] lr : add\_subprog\_and\_kfunc+0x634/0x8e8
\[    8.113798\] sp : ffff80008283b9f0
\[    8.113813\] x29: ffff80008283b9f0 x28: ffff800082795048 x27: 0000000000000001
\[    8.113881\] x26: ffff0000c0bb2600 x25: 0000000000000000 x24: 0000000000000000
\[    8.113897\] x23: ffff0000c1134000 x22: 000000000001864f x21: ffff0000c1138000
\[    8.113912\] x20: 0000000000000001 x19: ffff0000c12b8000 x18: ffffffffffffffff
\[    8.113929\] x17: 0000000000000000 x16: 0000000000000000 x15: 0720072007200720
\[    8.113944\] x14: 0720072007200720 x13: 0720072007200720 x12: 0720072007200720
\[    8.113958\] x11: 0720072007200720 x10: 0000000000f9fca4 x9 : ffff80008021f4e4
\[    8.113991\] x8 : 0101010101010101 x7 : 746f72705f6d656d x6 : 000000001e0e0f5f
\[    8.114006\] x5 : 000000000001864f x4 : ffff0000c12b8000 x3 : 000000000000001c
\[    8.114020\] x2 : 0000000000000002 x1 : 0000000000000000 x0 : 0000000000000000
\[    8.114126\] Call trace:
\[    8.114159\]  may\_access\_direct\_pkt\_data+0x24/0xa0
\[    8.114202\]  bpf\_check+0x3bc/0x28c0
\[    8.114214\]  bpf\_prog\_load+0x658/0xa58
\[    8.114227\]  \_\_sys\_bpf+0xc50/0x2250
\[    8.114240\]  \_\_arm64\_sys\_bpf+0x28/0x40
\[    8.114254\]  invoke\_syscall.constprop.0+0x54/0xf0
\[    8.114273\]  do\_el0\_svc+0x4c/0xd8
\[    8.114289\]  el0\_svc+0x3c/0x140
\[    8.114305\]  el0t\_64\_sync\_handler+0x134/0x150
\[    8.114331\]  el0t\_64\_sync+0x168/0x170
\[    8.114477\] Code: 7100707f 54000081 f9401c00 f9403800 (b9400403)
\[    8.118672\] ---\[ end trace 0000000000000000 \]---

One way to fix it is by forcing \`attach\_prog\_fd\` non-empty when
bpf\_prog\_load(). But this will lead to \`libbpf\_probe\_bpf\_prog\_type\`
API broken which use verifier log to probe prog type and will log
nothing if we reject invalid EXT prog before bpf\_check().

Another way is by adding null check in resolve\_prog\_type().

The issue was introduced by commit 4a9c7bbe2ed4 ("bpf: Resolve to
prog-\>aux-\>dst\_prog-\>type only for BPF\_PROG\_TYPE\_EXT") which wanted
to correct type resolution for BPF\_PROG\_TYPE\_TRACING programs. Before
that, the type resolution of BPF\_PROG\_TYPE\_EXT prog actually follows
the logic below:

  prog-\>aux-\>dst\_prog ? prog-\>aux-\>dst\_prog-\>type : prog-\>type;

It implies that when EXT program is not yet attached to \`dst\_prog\`,
the prog type should be EXT itself. This code worked fine in the past.
So just keep using it.

Fix this by returning \`prog-\>type\` for BPF\_PROG\_TYPE\_EXT if \`dst\_prog\`
is not present in resolve\_prog\_type().

## Affected and fixed versions

- Linux: \>= 4a9c7bbe2ed4d2b240674b1fb606c41d3940c412, \< fcac5feb06f31ee4c88bca9bf98d8bc3ca7d2615; \>= 4a9c7bbe2ed4d2b240674b1fb606c41d3940c412, \< 9d40fd516aeae6779e3c84c6b96700ca76285847; \>= 4a9c7bbe2ed4d2b240674b1fb606c41d3940c412, \< b29a880bb145e1f1c1df5ab88ed26b1495ff9f09; \>= 4a9c7bbe2ed4d2b240674b1fb606c41d3940c412, \< f7866c35873377313ff94398f17d425b28b71de1 (cvelist)
- Linux: 5.18 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-43837. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-43837.md
Affected: Linux >= 4a9c7bbe2ed4d2b240674b1fb606c41d3940c412, < fcac5feb06f31ee4c88bca9bf98d8bc3ca7d2615; >= 4a9c7bbe2ed4d2b240674b1fb606c41d3940c412, < 9d40fd516aeae6779e3c84c6b96700ca76285847; >= 4a9c7bbe2ed4d2b240674b1fb606c41d3940c412, < b29a880bb145e1f1c1df5ab88ed26b1495ff9f09; >= 4a9c7bbe2ed4d2b240674b1…
Fixed in: Linux 9d40fd516aeae6779e3c84c6b96700ca76285847

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-43837 being exploited?

There is no confirmed exploitation: CVE-2024-43837 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.30% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-43837?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-43837?

Linux \>= 4a9c7bbe2ed4d2b240674b1fb606c41d3940c412, \< fcac5feb06f31ee4c88bca9bf98d8bc3ca7d2615; \>= 4a9c7bbe2ed4d2b240674b1fb606c41d3940c412, \< 9d40fd516aeae6779e3c84c6b96700ca76285847; \>= 4a9c7bbe2ed4d2b240674b1fb606c41d3940c412, \< b29a880bb145e1f1c1df5ab88ed26b1495ff9f09; \>= 4a9c7bbe2ed4d2b240674b1fb606c41d3940c412, \< f7866c35873377313ff94398f17d425b28b71de1; Linux 5.18.

### Is there a fix for CVE-2024-43837?

Yes. Fixed in Linux 9d40fd516aeae6779e3c84c6b96700ca76285847. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2024-43837?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/fcac5feb06f31ee4c88bca9bf98d8bc3ca7d2615>
- patch: <https://git.kernel.org/stable/c/9d40fd516aeae6779e3c84c6b96700ca76285847>
- patch: <https://git.kernel.org/stable/c/b29a880bb145e1f1c1df5ab88ed26b1495ff9f09>
- patch: <https://git.kernel.org/stable/c/f7866c35873377313ff94398f17d425b28b71de1>
- other: <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-43837>

HTML: <https://flawdb.com/CVE-2024-43837> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-43837>
