VDB

CVE-2025-38591

CVE-2025-38591 PUBLISHED

bpf: Reject narrower access to pointer ctx fields

Reported by linux · Published August 19, 2025

In the Linux kernel, the following vulnerability has been resolved: bpf: Reject narrower access to pointer ctx fields The following BPF program, simplified from a syzkaller repro, causes a kernel warning: r0 = *(u8 *)(r1 + 169); exit; With pointer field sk being at offset 168 in __sk_buff. This access is detected as a narrower read in bpf_skb_is_valid_access because it doesn't match offsetof(struct __sk_buff, sk). It is therefore allowed and later proceeds to bpf_convert_ctx_access. Note that for the "is_narrower_load" case in the convert_ctx_accesses(), the insn->off is aligned, so the cnt may not be 0 because it matches the offsetof(struct __sk_buff, sk) in the bpf_convert_ctx_access. However, the target_size stays 0 and the verifier errors with a kernel warning: verifier bug: error during ctx access conversion(1) This patch fixes that to return a proper "invalid bpf_context access off=X size=Y" error on the load instruction. The same issue affects multiple other fields in context structures that allow narrow access. Some other non-affected fields (for sk_msg, sk_lookup, and sockopt) were also changed to use bpf_ctx_range_ptr for consistency. Note this syzkaller crash was reported in the "Closes" link below, which used to be about a different bug, fixed in commit fce7bd8e385a ("bpf/verifier: Handle BPF_LOAD_ACQ instructions in insn_def_regno()"). Because syzbot somehow confused the two bugs, the new crash and repro didn't get reported to the mailing list.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
kernel-develAmazon Linux1:6.1.163-186.299.amzn2023
kernel6.12Amazon Linux1:6.12.68-92.122.amzn2023
bpftoolAmazon Linux1:6.1.163-186.299.amzn2023
kernel-modules-extraAmazon Linux1:6.1.163-186.299.amzn2023
perf6.12Amazon Linux1:6.12.68-92.122.amzn2023

Affected products

VendorProductVersions
LinuxLinuxf96da09473b52c09125cc9bf7d7d4576ae8229e0, f96da09473b52c09125cc9bf7d7d4576ae8229e0, f96da09473b52c09125cc9bf7d7d4576ae8229e0
LinuxLinux4.13, 0, 5.10.249
SiemensSIPLUS S7-1500 CPU 1518-4 PN/DP MFP3.1.6, 3.1.7
amazon:2023kernel-devel0
amazon:2023kernel6.120
amazon:2023bpftool0
amazon:2023kernel-modules-extra0
amazon:2023perf6.120
linuxlinux_kernel4.13, 4.13, 4.13
chainguardlinux-qemu-6.120
amazon:2023kernel6.12-libbpf0
SiemensSIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0)3.1.6, 3.1.7
amazon:2023kernel-libbpf-devel0
amazon:2023kernel0
amazon:2023perf0
SiemensSIPLUS S7-1500 CPU 1518-4 PN/DP MFP (6AG1518-4AX00-4AC0)3.1.7, 3.1.6
SiemensSIMATIC S7-1500 CPU 1518F-4 PN/DP MFP3.1.6, 3.1.7
amazon:2023kernel6.12-devel0
amazon:2023kernel6.12-tools-devel0
chainguardlinux-vmware-6.120

…and 25 more

Timeline

  • Aug 19, 2025 CVE Published
  • Aug 20, 2025 EPSS Score (30 in total, the first dated here)
  • Aug 20, 2025 Coalition ESS Score (7 in total, the first dated here)
  • Oct 12, 2025 PoC Published (9 in total, the first dated here)
  • Dec 15, 2025 Security Advisory (193 in total, the first dated here)
  • Apr 29, 2026 Distribution Patch (168 in total, the first dated here)

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2025-38591
vulnetix vdb fixes CVE-2025-38591

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2025-38591/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›