CVE-2025-38012 (GCVE-0-2025-38012)
Vulnerability from cvelistv5
Published
2025-06-18 09:28
Modified
2026-08-05 11:58
Severity ?
VLAI Severity ?
EPSS score ?
Summary
In the Linux kernel, the following vulnerability has been resolved:
sched_ext: bpf_iter_scx_dsq_new() should always initialize iterator
BPF programs may call next() and destroy() on BPF iterators even after new()
returns an error value (e.g. bpf_for_each() macro ignores error returns from
new()). bpf_iter_scx_dsq_new() could leave the iterator in an uninitialized
state after an error return causing bpf_iter_scx_dsq_next() to dereference
garbage data. Make bpf_iter_scx_dsq_new() always clear $kit->dsq so that
next() and destroy() become noops.
References
Impacted products
{
"containers": {
"cna": {
"affected": [
{
"defaultStatus": "unaffected",
"product": "Linux",
"programFiles": [
"kernel/sched/ext.c"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"versions": [
{
"lessThan": "0102989af4c334d1d98b2a0fd4d61a5152e39b72",
"status": "affected",
"version": "650ba21b131ed1f8ee57826b2c6295a3be221132",
"versionType": "git"
},
{
"lessThan": "255dd31bfc4a67a19b1fc2cd130a50284dadfe3a",
"status": "affected",
"version": "650ba21b131ed1f8ee57826b2c6295a3be221132",
"versionType": "git"
},
{
"lessThan": "428dc9fc0873989d73918d4a9cc22745b7bbc799",
"status": "affected",
"version": "650ba21b131ed1f8ee57826b2c6295a3be221132",
"versionType": "git"
}
]
},
{
"defaultStatus": "affected",
"product": "Linux",
"programFiles": [
"kernel/sched/ext.c"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"versions": [
{
"status": "affected",
"version": "6.12"
},
{
"lessThan": "6.12",
"status": "unaffected",
"version": "0",
"versionType": "semver"
},
{
"lessThanOrEqual": "6.12.*",
"status": "unaffected",
"version": "6.12.30",
"versionType": "semver"
},
{
"lessThanOrEqual": "6.14.*",
"status": "unaffected",
"version": "6.14.8",
"versionType": "semver"
},
{
"lessThanOrEqual": "*",
"status": "unaffected",
"version": "6.15",
"versionType": "original_commit_for_fix"
}
]
}
],
"cpeApplicability": [
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "6.12.30",
"versionStartIncluding": "6.12",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "6.14.8",
"versionStartIncluding": "6.12",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "6.15",
"versionStartIncluding": "6.12",
"vulnerable": true
}
],
"negate": false,
"operator": "OR"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "In the Linux kernel, the following vulnerability has been resolved:\n\nsched_ext: bpf_iter_scx_dsq_new() should always initialize iterator\n\nBPF programs may call next() and destroy() on BPF iterators even after new()\nreturns an error value (e.g. bpf_for_each() macro ignores error returns from\nnew()). bpf_iter_scx_dsq_new() could leave the iterator in an uninitialized\nstate after an error return causing bpf_iter_scx_dsq_next() to dereference\ngarbage data. Make bpf_iter_scx_dsq_new() always clear $kit-\u003edsq so that\nnext() and destroy() become noops."
}
],
"metrics": [
{
"cvssV3_1": {
"baseScore": 7.8,
"baseSeverity": "HIGH",
"vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"version": "3.1"
},
"scenarios": [
{
"lang": "en",
"value": "AV:L - Exploitation requires loading and running a BPF program via the local `bpf()` syscall (BPF_PROG_LOAD + BPF_PROG_TEST_RUN, or a struct_ops/tracing attach). There is no remote or adjacent-network path to the sched_ext DSQ iterator kfuncs.\nAC:L - The trigger is fully deterministic \u2014 pass an invalid flag bit to `bpf_iter_scx_dsq_new()` and call `next()` \u2014 with no race, no timing window, and no dependence on ambient memory layout, since the attacker pre-seeds the iterator stack slots with values of their choosing. `CONFIG_SCHED_CLASS_EXT` is enabled in mainstream 6.12+ distro kernels.\nPR:L - Only CAP_BPF is needed: the iterator kfuncs are registered for `BPF_PROG_TYPE_SYSCALL`, which is not perfmon/net-admin gated, and `bpf_prog_test_run_syscall()` adds no capability check. `bpf_token_capable()` allows CAP_BPF to be delegated into an unprivileged user namespace via a bpffs BPF token, so an ordinary low-privileged container user can reach it.\nUI:N - The attacker\u0027s own BPF program triggers the flaw synchronously; no victim action, mount, or file open is involved.\nS:U - The corruption and its consequences are confined to the kernel\u0027s own security authority \u2014 a standard local privilege escalation with no VM, IOMMU, or hypervisor boundary crossed.\nC:H - `nldsq_next_task()` dereferences the attacker-supplied `kit-\u003edsq` pointer and then walks arbitrary `list_head` next/prev chains, yielding an arbitrary kernel-memory read primitive that can disclose credentials, keys, and KASLR state.\nI:H - The uninitialized `kit-\u003ecursor` drives `list_move()`/`list_del_init()` against attacker-chosen addresses, and `raw_spin_lock_irqsave(\u0026kit-\u003edsq-\u003elock)` performs a read-modify-write at an arbitrary address \u2014 a controlled kernel write primitive leading to full privilege escalation.\nA:H - Dereferencing garbage pointers under `raw_spin_lock_irqsave()` reliably produces a kernel oops or a hard lockup on a bogus spinlock, and any unprivileged-BPF-capable process can repeat it at will to panic the machine."
}
]
}
],
"providerMetadata": {
"dateUpdated": "2026-08-05T11:58:57.764Z",
"orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"shortName": "Linux"
},
"references": [
{
"url": "https://git.kernel.org/stable/c/0102989af4c334d1d98b2a0fd4d61a5152e39b72"
},
{
"url": "https://git.kernel.org/stable/c/255dd31bfc4a67a19b1fc2cd130a50284dadfe3a"
},
{
"url": "https://git.kernel.org/stable/c/428dc9fc0873989d73918d4a9cc22745b7bbc799"
}
],
"title": "sched_ext: bpf_iter_scx_dsq_new() should always initialize iterator",
"x_generator": {
"engine": "bippy-1.2.0"
}
}
},
"cveMetadata": {
"assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"assignerShortName": "Linux",
"cveId": "CVE-2025-38012",
"datePublished": "2025-06-18T09:28:22.057Z",
"dateReserved": "2025-04-16T04:51:23.977Z",
"dateUpdated": "2026-08-05T11:58:57.764Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2"
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.
Loading…
Loading…