CVE-2025-38366
published high CVSS 3.1 · 7.8LoongArch: KVM: Check validity of "num_cpu" from user space
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux1ad7efa552fd5cf4e8c49fea863c5c6a5dcf9f00 to < a3293b4078ee93174f70f36d3ab7618554ce6ab6 · 1ad7efa552fd5cf4e8c49fea863c5c6a5dcf9f00 to < cc8d5b209e09d3b52bca1ffe00045876842d96ae · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux6.13 (affected) · 0 to < 6.13 (unaffected · semver) · 6.15.5 through 6.15.* (unaffected · semver) · 6.16 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: LoongArch: KVM: Check validity of "num_cpu" from user space The maximum supported cpu number is EIOINTC_ROUTE_MAX_VCPUS about irqchip EIOINTC, here add validation about cpu number to avoid array pointer overflow.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The vulnerability is reached only through ioctls on a local KVM device file descriptor (`/dev/kvm` → `KVM_CREATE_VM` → `KVM_CREATE_DEVICE` → `KVM_SET/GET_DEVICE_ATTR`); there is no network or remote path into `kvm_eiointc_regs_access()`. AC:L - A single ioctl with `attr->attr = (cpuid << 16) | 0x400` deterministically produces the out-of-bounds access — no race, no timing dependency, and the attacker fully chooses the ±1 MiB displacement and the written value. KVM is enabled by default in `loongson64_defconfig`. PR:L - The attacker needs only the ability to open `/dev/kvm` and create a VM — routinely granted to unprivileged local users and cloud/desktop VM users — and neither `kvm_ioctl_create_device()` nor `kvm_device_ioctl_attr()` performs any capability check. UI:N - The attacker drives the entire sequence from its own process with plain ioctls; no host operator, guest owner, or other user has to take any action. S:U - Both the vulnerable and the impacted component are the host kernel, reached by host userspace through its normal syscall interface — a classic local privilege escalation within one security authority, not a guest-to-host hypervisor escape (the guest MMIO paths index `coreisr` by the bounded `vcpu->vcpu_id`). C:H - `KVM_GET_DEVICE_ATTR` performs `copy_to_user(data, p, 4)` from an attacker-chosen 4-byte-aligned address up to 1 MiB either side of the ~74 KB `loongarch_eiointc` allocation, giving a repeatable, sweepable read of adjacent kernel memory — effectively arbitrary kernel-heap disclosure including pointers and secrets. I:H - `KVM_SET_DEVICE_ATTR` performs `copy_from_user(p, data, 4)` to the same attacker-chosen out-of-bounds address, yielding a controlled 4-byte write anywhere in a 2 MiB window around a page-allocator-backed object — a memory-corruption primitive directly leverageable for control-flow hijack and full privilege escalation. A:H - The same out-of-bounds write can clobber arbitrary neighboring kernel structures, and the unvalidated `num_cpu`/`cpuid` accesses reliably corrupt or fault kernel memory, producing an oops or panic that takes down the host and every VM on it.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 1ad7efa552fd5cf4e8c49fea863c5c6a5dcf9f00 to < a3293b4078ee93174f70f36d3ab7618554ce6ab6 (affected · git)1ad7efa552fd5cf4e8c49fea863c5c6a5dcf9f00 to < cc8d5b209e09d3b52bca1ffe00045876842d96ae (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 6.13 (affected)0 to < 6.13 (unaffected · semver)6.15.5 through 6.15.* (unaffected · semver)6.16 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
2Provider assertions
1Linux · cna
LoongArch: KVM: Check validity of "num_cpu" from user space
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- e97af6cab24e90e68747849e190a1225e51b03f3bdb87dc55acecc575b4d0104
- Ingested
- 23 Sep 2026, 08:46:47 UTC
- Source record
- Official CVE record