Skip to content
Noroxi
CVE-2025-38166· NVD / CVE Program· CNA Linux

bpf: fix ktls panic with sockmap

In the Linux kernel, the following vulnerability has been resolved: bpf: fix ktls panic with sockmap [ 2172.936997] ------------[ cut here ]------------ [ 2172.936999] kernel BUG at lib/iov_iter.c:629! ...... [ 2172.944996] PKRU: 55555554 [ 2172.945155] Call Trace: [ 2172.945299] <TASK> [ 2172.945428] ? die+0x36/0x90 [ 2172.945601] ? do_trap+0xdd/0x100 [ 2172.945795] ? iov_iter_revert+0x178/0x180 [ 2172.946031] ? iov_iter_revert+0x178/0x180 [ 2172.946267] ? do_error_trap+0x7d/0x110 [ 2172.946499] ? iov_iter_revert+0x178/0x180 [ 2172.946736] ? exc_invalid_op+0x50/0x70 [ 2172.946961] ? iov_iter_revert+0x178/0x180 [ 2172.947197] ? asm_exc_invalid_op+0x1a/0x20 [ 2172.947446] ? iov_iter_revert+0x178/0x180 [ 2172.947683] ? iov_iter_revert+0x5c/0x180 [ 2172.947913] tls_sw_sendmsg_locked.isra.0+0x794/0x840 [ 2172.948206] tls_sw_sendmsg+0x52/0x80 [ 2172.948420] ? inet_sendmsg+0x1f/0x70 [ 2172.948634] __sys_sendto+0x1cd/0x200 [ 2172.948848] ? find_held_lock+0x2b/0x80 [ 2172.949072] ? syscall_trace_enter+0x140/0x270 [ 2172.949330] ? __lock_release.isra.0+0x5e/0x170 [ 2172.949595] ? find_held_lock+0x2b/0x80 [ 2172.949817] ? syscall_trace_enter+0x140/0x270 [ 2172.950211] ? lockdep_hardirqs_on_prepare+0xda/0x190 [ 2172.950632] ? ktime_get_coarse_real_ts64+0xc2/0xd0 [ 2172.951036] __x64_sys_sendto+0x24/0x30 [ 2172.951382] do_syscall_64+0x90/0x170 ...... After calling bpf_exec_tx_verdict(), the size of msg_pl->sg may increase, e.g., when the BPF program executes bpf_msg_push_data(). If the BPF program sets cork_bytes and sg.size is smaller than cork_bytes, it will return -ENOSPC and attempt to roll back to the non-zero copy logic. However, during rollback, msg->msg_iter is reset, but since msg_pl->sg.size has been increased, subsequent executions will exceed the actual size of msg_iter. ''' iov_iter_revert(&msg->msg_iter, msg_pl->sg.size - orig_size); ''' The changes in this commit are based on the following considerations: 1. When cork_bytes is set, rolling back to non-zero copy logic is pointless and can directly go to zero-copy logic. 2. We can not calculate the correct number of bytes to revert msg_iter. Assume the original data is "abcdefgh" (8 bytes), and after 3 pushes by the BPF program, it becomes 11-byte data: "abc?de?fgh?". Then, we set cork_bytes to 6, which means the first 6 bytes have been processed, and the remaining 5 bytes "?fgh?" will be cached until the length meets the cork_bytes requirement. However, some data in "?fgh?" is not within 'sg->msg_iter' (but in msg_pl instead), especially the data "?" we pushed. So it doesn't seem as simple as just reverting through an offset of msg_iter. 3. For non-TLS sockets in tcp_bpf_sendmsg, when a "cork" situation occurs, the user-space send() doesn't return an error, and the returned length is the same as the input length parameter, even if some data is cached. Additionally, I saw that the current non-zero-copy logic for handling corking is written as: ''' line 1177 else if (ret != -EAGAIN) { if (ret == -ENOSPC) ret = 0; goto send_end; ''' So it's ok to just return 'copied' without error when a "cork" situation occurs.

MediumCVSS 5.5 · v3.1—No exploit Fix available
Published
Jul 3, 2025
Updated
Aug 5, 2026
EPSS
0.2% · 9th percentile
CWE
—
Follow this CVE

Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.

Report tools

JSON

Action score

22

Monitor

Low priority for now.

CVSS
22 / 40 · 5.5 / 10
CISA KEV
0 / 30 · Not listed
EPSS
0 / 30 · 0.2%

CNA vs NVD score

NVD
5.5
CNA · Linux
7.8
2.3 point gap

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.

Noroxi analysis

No Noroxi analysis for this record yet

We don't hand-write analysis for the hundreds of thousands of vulnerabilities in the database; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.

We use this product, ask for help

Affected systems

VendorProduct
linuxlinux kernel
debiandebian linux

Affected versions

NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.

  • debian debian linux11.0
  • linux linux kernel4.20 and later · before 6.1.142
  • linux linux kernel6.2 and later · before 6.6.94
  • linux linux kernel6.7 and later · before 6.12.34
  • linux linux kernel6.13 and later · before 6.15.3

Versions reported by the vendor

Affected version ranges reported by the assigning authority (Linux). Independent of NVD's CPE analysis and usually ahead of it.

  • Linux Linux

    • 4.20affected
    • d3b18ad31f93d0b6bae105c679018a1ba7daa9ca and later · before 328cac3f9f8ae394748485e769a527518a9137c8affected · git
    • d3b18ad31f93d0b6bae105c679018a1ba7daa9ca and later · before 2e36a81d388ec9c3f78b6223f7eda2088cd40adbaffected · git
    • d3b18ad31f93d0b6bae105c679018a1ba7daa9ca and later · before 57fbbe29e86042bbaa31c1a30d2afa16c427e3f7affected · git
    • d3b18ad31f93d0b6bae105c679018a1ba7daa9ca and later · before 603943f022a7fe5cc83ca7005faf34798fb7853faffected · git
    • d3b18ad31f93d0b6bae105c679018a1ba7daa9ca and later · before 54a3ecaeeeae8176da8badbd7d72af1017032c39affected · git
    • before 4.20not affected · semver
    • 6.1.142 and later · up to and including 6.1.*not affected · semver
    • 6.6.94 and later · up to and including 6.6.*not affected · semver
    • 6.12.34 and later · up to and including 6.12.*not affected · semver

Package-level exposure

OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.

EcosystemPackageAffected rangeFix
AlmaLinux:10kernelbefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-64kbefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-64k-corebefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-64k-debugbefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-64k-debug-corebefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-64k-debug-develbefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-64k-debug-devel-matchedbefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-64k-debug-modulesbefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-64k-debug-modules-corebefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-64k-debug-modules-extrabefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-64k-develbefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-64k-devel-matchedbefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-64k-modulesbefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-64k-modules-corebefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-64k-modules-extrabefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-abi-stablelistsbefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-corebefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-cross-headersbefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-debugbefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-debug-corebefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-debug-develbefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-debug-devel-matchedbefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-debug-modulesbefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2
AlmaLinux:10kernel-debug-modules-corebefore 6.12.0-211.7.1.el10_26.12.0-211.7.1.el10_2

+96

Other highest-scoring records for the same primary product.

  • CVE-2022-0847A flaw was found in the way the "flags" member of the new pipe buffer structure was lacking proper initialization in copy_page_to_iter_pipe KEV
    89Now
  • CVE-2021-22555Heap Out-Of-Bounds Write in Netfilter IP6T_SO_SET_REPLACEKEV
    85Now
  • CVE-2016-5195Race condition in mm/gup.c in the Linux kernel 2.x through 4.x before 4.8.3 allows local users to gain privileges by leveraging incorrect haKEV
    83Now
  • CVE-2019-13272In the Linux kernel before 5.1.17, ptrace_link in kernel/ptrace.c mishandles the recording of the credentials of a process that wants to creKEV
    77This week
  • CVE-2013-6282The (1) get_user and (2) put_user API functions in the Linux kernel before 3.5.5 on the v6k and v7 ARM platforms do not validate certain addKEV
    77This week
  • CVE-2013-2094The perf_swevent_init function in kernel/events/core.c in the Linux kernel before 3.8.9 uses an incorrect integer data type, which allows loKEV
    77This week

Remediation

Which version to upgrade to

Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.

Product / packageFixed versionSource
Linux Linux2e36a81d388ec9c3f78b6223f7eda2088cd40adbVendor (CNA)
Linux Linux328cac3f9f8ae394748485e769a527518a9137c8Vendor (CNA)
Linux Linux54a3ecaeeeae8176da8badbd7d72af1017032c39Vendor (CNA)
Linux Linux57fbbe29e86042bbaa31c1a30d2afa16c427e3f7Vendor (CNA)
Linux Linux603943f022a7fe5cc83ca7005faf34798fb7853fVendor (CNA)
azl3 kernel 6.6.92.2-2 on Azure Linux 3.06.6.96.1-1 · CBL-Mariner ReleasesMicrosoft (MSRC)
azl3 kernel 6.6.96.1-1 on Azure Linux 3.06.6.96.1-1 · CBL-Mariner ReleasesMicrosoft (MSRC)
cbl2 kernel 5.15.202.1-1 on CBL-Mariner 2.0Release NotesMicrosoft (MSRC)
almalinux:kernel6.12.0-211.7.1.el10_2 · AlmaLinux:10Package registry (OSV)
almalinux:kernel-64k6.12.0-211.7.1.el10_2 · AlmaLinux:10Package registry (OSV)
almalinux:kernel-64k-core6.12.0-211.7.1.el10_2 · AlmaLinux:10Package registry (OSV)
almalinux:kernel-64k-debug6.12.0-211.7.1.el10_2 · AlmaLinux:10Package registry (OSV)
almalinux:kernel-64k-debug-core6.12.0-211.7.1.el10_2 · AlmaLinux:10Package registry (OSV)
almalinux:kernel-64k-debug-devel6.12.0-211.7.1.el10_2 · AlmaLinux:10Package registry (OSV)
almalinux:kernel-64k-debug-devel-matched6.12.0-211.7.1.el10_2 · AlmaLinux:10Package registry (OSV)
almalinux:kernel-64k-debug-modules6.12.0-211.7.1.el10_2 · AlmaLinux:10Package registry (OSV)
almalinux:kernel-64k-debug-modules-core6.12.0-211.7.1.el10_2 · AlmaLinux:10Package registry (OSV)
almalinux:kernel-64k-debug-modules-extra6.12.0-211.7.1.el10_2 · AlmaLinux:10Package registry (OSV)
almalinux:kernel-64k-devel6.12.0-211.7.1.el10_2 · AlmaLinux:10Package registry (OSV)
almalinux:kernel-64k-devel-matched6.12.0-211.7.1.el10_2 · AlmaLinux:10Package registry (OSV)
debian:linux6.1.147-1 · Debian:12Package registry (OSV)
red hat:kernel-64k-debug-debuginfo0:6.12.0-211.7.1.el10_2 · Red Hat:enterprise_linux:10.2Package registry (OSV)
red hat:kernel-64k-debug-devel0:6.12.0-211.7.1.el10_2 · Red Hat:enterprise_linux:10.2Package registry (OSV)
red hat:kernel-64k-debug-devel-matched0:6.12.0-211.7.1.el10_2 · Red Hat:enterprise_linux:10.2Package registry (OSV)
red hat:kernel-64k-debuginfo0:6.12.0-211.7.1.el10_2 · Red Hat:enterprise_linux:10.2Package registry (OSV)
red hat:kernel-64k-devel0:6.12.0-211.7.1.el10_2 · Red Hat:enterprise_linux:10.2Package registry (OSV)
red hat:kernel-64k-devel-matched0:6.12.0-211.7.1.el10_2 · Red Hat:enterprise_linux:10.2Package registry (OSV)
red hat:kernel-debug-debuginfo0:6.12.0-211.7.1.el10_2 · Red Hat:enterprise_linux:10.2Package registry (OSV)
red hat:kernel-debug-devel0:6.12.0-211.7.1.el10_2 · Red Hat:enterprise_linux:10.2Package registry (OSV)
red hat:kernel-debug-devel-matched0:6.12.0-211.7.1.el10_2 · Red Hat:enterprise_linux:10.2Package registry (OSV)

+3

Exploit status

No known public exploit

No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.

Research context

For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.

Timeline

From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.

No dated events beyond publication.

EPSS, last 120 days

FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).

Patch and commit links

Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.

No commit or PR link among the references.

Finders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.

No credits in the CNA record.

Variant candidates

Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.

No nightly-computed relations.

Chain candidates

An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.

—

Bug bounty scope

No known public program.

Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).

Technical details

Attack conditions

  • Someone with local access to the system can trigger it.
  • A low-privileged account is enough.
  • No user action is required.
  • No special conditions are required; it is repeatable.

If successful

Confidentiality
none
Integrity
none
Availability
high · the service can be disrupted
Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality impact
None
Integrity impact
None
Availability impact
High

Weakness class (CWE)

—

CVSS vector

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

nvd-primary

Attack context

MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.

MITRE has no CAPEC/ATT&CK mapping for this CWE.

Change log

  1. Fix✗ → ✓

For records you follow, these changes also arrive as notifications. →

References

All records