# CVE-2023-54181: bpf: Fix issue in verifying allow_ptr_leaks

> A flaw in the Linux kernel BPF verifier incorrectly prohibits safe pointer comparisons, preventing legitimate network BPF programs from loading.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 30 Dec 2025
- **Updated:** 11 May 2026
- **Also known as:** BELL-CVE-2023-54181, DEBIAN-CVE-2023-54181, GHSA-6985-fmpm-h392, ROOT-OS-DEBIAN-11-CVE-2023-54181, ROOT-OS-UBUNTU-2204-CVE-2023-54181, UBUNTU-CVE-2023-54181

## What is CVE-2023-54181?

CVE-2023-54181 is a vulnerability in Linux, published on 30 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

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

bpf: Fix issue in verifying allow_ptr_leaks

After we converted the capabilities of our networking-bpf program from
cap_sys_admin to cap_net_admin+cap_bpf, our networking-bpf program
failed to start. Because it failed the bpf verifier, and the error log
is "R3 pointer comparison prohibited".

A simple reproducer as follows,

SEC("cls-ingress")
int ingress(struct __sk_buff *skb)
{
	struct iphdr *iph = (void *)(long)skb->data + sizeof(struct ethhdr);

	if ((long)(iph + 1) > (long)skb->data_end)
		return TC_ACT_STOLEN;
	return TC_ACT_OK;
}

Per discussion with Yonghong and Alexei [1], comparison of two packet
pointers is not a pointer leak. This patch fixes it.

Our local kernel is 6.1.y and we expect this fix to be backported to
6.1.y, so stable is CCed.

[1]. https://lore.kernel.org/bpf/CAADnVQ+Nmspr7Si+pxWn8zkE7hX-7s93ugwC+94aXSy4uQ9vBg@mail.gmail.com/

## Which versions are affected by CVE-2023-54181?


## How do I fix CVE-2023-54181?

Apply the vendor's patch.

## Is CVE-2023-54181 being exploited?

There is no known exploitation of CVE-2023-54181 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-54181 and fix it if it is affected.

What it is: CVE-2023-54181 is a vulnerability in Linux, published on 30 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-54181 in the wild and no public exploit code.

Affected product: Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-54181/ (Markdown: https://insights.sbomify.com/CVE-2023-54181/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-54181
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-54181
- OSV: https://osv.dev/vulnerability/CVE-2023-54181

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-54181/
Summaries are generated and may contain mistakes; the official description above is the record.
