bpf: Fix issue in verifying allow_ptr_leaks
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/
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 6.1.53, 6.4.16, 6.5.3
- CVEs
- CVE-2023-54181
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 17:25 UTC · Revision 1
Source evidence
bpf: Fix issue in verifying allow_ptr_leaks
core-osv · Original sourcePublished 30 Dec 2025, 12:08 UTC
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/
osv:CVE-2023-54181
Kernel
Fixed versions: 6.1.53, 6.4.16, 6.5.3
Complete source record
{
"id": "dd6f43840b4a02b9198d7fab329c124d6cc18762a9e4360b28d9f804375c31b5",
"url": "https://osv.dev/vulnerability/CVE-2023-54181",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "bpf: Fix issue in verifying allow_ptr_leaks",
"summary": "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/",
"evidence": "osv:CVE-2023-54181",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "6.1.53",
"evidence": "/affected/1/ranges"
},
{
"value": "6.4.16",
"evidence": "/affected/1/ranges"
},
{
"value": "6.5.3",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "CVE-2023-54181",
"aliases": [
"CVE-2023-54181"
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "2c78ee898d8f10ae6fb2fa23a3fbaec96b1b7366"
},
{
"fixed": "c96c67991aac6401b4c6996093bccb704bb2ea4b"
},
{
"fixed": "5927f0172d2809d8fc09c1ba667280b0387e9f73"
},
{
"fixed": "acfdc8b77016c8e648aadc283177546c88083dd3"
},
{
"fixed": "d75e30dddf73449bc2d10bb8e2f1a2c446bc67a2"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-54181.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.8.0"
},
{
"fixed": "6.1.53"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.2.0"
},
{
"fixed": "6.4.16"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.5.0"
},
{
"fixed": "6.5.3"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-54181.json"
}
}
],
"modified": "2026-10-28T02:30:30.801795837Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/5927f0172d2809d8fc09c1ba667280b0387e9f73",
"https://git.kernel.org/stable/c/acfdc8b77016c8e648aadc283177546c88083dd3",
"https://git.kernel.org/stable/c/c96c67991aac6401b4c6996093bccb704bb2ea4b",
"https://git.kernel.org/stable/c/d75e30dddf73449bc2d10bb8e2f1a2c446bc67a2",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/54xxx/CVE-2023-54181.json",
"https://nvd.nist.gov/vuln/detail/CVE-2023-54181",
"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/2023/54xxx/CVE-2023-54181.json"
}
},
"related_cves": [
{
"value": "CVE-2023-54181",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 497820,
"published_at": "2025-12-30T12:08:52.376+00:00"
}