# CVE-2025-39895: sched: Fix sched\_numa\_find\_nth\_cpu() if mask offline

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.22% (percentile 7, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2025-10-01T07:42:43.920Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= cd7f55359c90a4108e6528e326b8623fce1ad72a, \< f9b8d4dba8e78c1887fecd81ba0d8204d6ff05fc; \>= cd7f55359c90a4108e6528e326b8623fce1ad72a, \< b3ec50cc5eb5ca84256ca701d28b137a6036c412; \>= cd7f55359c90a4108e6528e326b8623fce1ad72a, \< b921c288cd8abef9af5b59e056a63cc2c263a9e3; \>= cd7f55359c90a4108e6528e326b8623fce1ad72a, \< 5ebf512f335053a42482ebff91e46c6dc156bf8c
- Anyone running Linux 6.3

## Description

In the Linux kernel, the following vulnerability has been resolved:

sched: Fix sched\_numa\_find\_nth\_cpu() if mask offline

sched\_numa\_find\_nth\_cpu() uses a bsearch to look for the 'closest'
CPU in sched\_domains\_numa\_masks and given cpus mask. However they
might not intersect if all CPUs in the cpus mask are offline. bsearch
will return NULL in that case, bail out instead of dereferencing a
bogus pointer.

The previous behaviour lead to this bug when using maxcpus=4 on an
rk3399 (LLLLbb) (i.e. booting with all big CPUs offline):

\[    1.422922\] Unable to handle kernel paging request at virtual address ffffff8000000000
\[    1.423635\] Mem abort info:
\[    1.423889\]   ESR = 0x0000000096000006
\[    1.424227\]   EC = 0x25: DABT (current EL), IL = 32 bits
\[    1.424715\]   SET = 0, FnV = 0
\[    1.424995\]   EA = 0, S1PTW = 0
\[    1.425279\]   FSC = 0x06: level 2 translation fault
\[    1.425735\] Data abort info:
\[    1.425998\]   ISV = 0, ISS = 0x00000006, ISS2 = 0x00000000
\[    1.426499\]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
\[    1.426952\]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
\[    1.427428\] swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000004a9f000
\[    1.428038\] \[ffffff8000000000\] pgd=18000000f7fff403, p4d=18000000f7fff403, pud=18000000f7fff403, pmd=0000000000000000
\[    1.429014\] Internal error: Oops: 0000000096000006 \[\#1\]  SMP
\[    1.429525\] Modules linked in:
\[    1.429813\] CPU: 3 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.17.0-rc4-dirty \#343 PREEMPT
\[    1.430559\] Hardware name: Pine64 RockPro64 v2.1 (DT)
\[    1.431012\] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
\[    1.431634\] pc : sched\_numa\_find\_nth\_cpu+0x2a0/0x488
\[    1.432094\] lr : sched\_numa\_find\_nth\_cpu+0x284/0x488
\[    1.432543\] sp : ffffffc084e1b960
\[    1.432843\] x29: ffffffc084e1b960 x28: ffffff80078a8800 x27: ffffffc0846eb1d0
\[    1.433495\] x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000
\[    1.434144\] x23: 0000000000000000 x22: fffffffffff7f093 x21: ffffffc081de6378
\[    1.434792\] x20: 0000000000000000 x19: 0000000ffff7f093 x18: 00000000ffffffff
\[    1.435441\] x17: 3030303866666666 x16: 66663d736b73616d x15: ffffffc104e1b5b7
\[    1.436091\] x14: 0000000000000000 x13: ffffffc084712860 x12: 0000000000000372
\[    1.436739\] x11: 0000000000000126 x10: ffffffc08476a860 x9 : ffffffc084712860
\[    1.437389\] x8 : 00000000ffffefff x7 : ffffffc08476a860 x6 : 0000000000000000
\[    1.438036\] x5 : 000000000000bff4 x4 : 0000000000000000 x3 : 0000000000000000
\[    1.438683\] x2 : 0000000000000000 x1 : ffffffc0846eb000 x0 : ffffff8000407b68
\[    1.439332\] Call trace:
\[    1.439559\]  sched\_numa\_find\_nth\_cpu+0x2a0/0x488 (P)
\[    1.440016\]  smp\_call\_function\_any+0xc8/0xd0
\[    1.440416\]  armv8\_pmu\_init+0x58/0x27c
\[    1.440770\]  armv8\_cortex\_a72\_pmu\_init+0x20/0x2c
\[    1.441199\]  arm\_pmu\_device\_probe+0x1e4/0x5e8
\[    1.441603\]  armv8\_pmu\_device\_probe+0x1c/0x28
\[    1.442007\]  platform\_probe+0x5c/0xac
\[    1.442347\]  really\_probe+0xbc/0x298
\[    1.442683\]  \_\_driver\_probe\_device+0x78/0x12c
\[    1.443087\]  driver\_probe\_device+0xdc/0x160
\[    1.443475\]  \_\_driver\_attach+0x94/0x19c
\[    1.443833\]  bus\_for\_each\_dev+0x74/0xd4
\[    1.444190\]  driver\_attach+0x24/0x30
\[    1.444525\]  bus\_add\_driver+0xe4/0x208
\[    1.444874\]  driver\_register+0x60/0x128
\[    1.445233\]  \_\_platform\_driver\_register+0x24/0x30
\[    1.445662\]  armv8\_pmu\_driver\_init+0x28/0x4c
\[    1.446059\]  do\_one\_initcall+0x44/0x25c
\[    1.446416\]  kernel\_init\_freeable+0x1dc/0x3bc
\[    1.446820\]  kernel\_init+0x20/0x1d8
\[    1.447151\]  ret\_from\_fork+0x10/0x20
\[    1.447493\] Code: 90022e21 f000e5f5 910de2b5 2a1703e2 (f8767803)
\[    1.448040\] ---\[ end trace 0000000000000000 \]---
\[    1.448483\] note: swapper/0\[1\] exited with preempt\_count 1
\[    1.449047\] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
\[    1.449741\] SMP: stopping secondary CPUs
\[    1.450105\] Kernel Offset: disabled
\[    1.450419\] CPU features: 0x000000,00080000,20002001,0400421b
\[    
---truncated---

## Affected and fixed versions

- Linux: \>= cd7f55359c90a4108e6528e326b8623fce1ad72a, \< f9b8d4dba8e78c1887fecd81ba0d8204d6ff05fc; \>= cd7f55359c90a4108e6528e326b8623fce1ad72a, \< b3ec50cc5eb5ca84256ca701d28b137a6036c412; \>= cd7f55359c90a4108e6528e326b8623fce1ad72a, \< b921c288cd8abef9af5b59e056a63cc2c263a9e3; \>= cd7f55359c90a4108e6528e326b8623fce1ad72a, \< 5ebf512f335053a42482ebff91e46c6dc156bf8c (cvelist)
- Linux: 6.3 (cvelist)

## Mitigation

- Upgrade Linux to 5ebf512f335053a42482ebff91e46c6dc156bf8c or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-39895. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-39895.md
Affected: Linux >= cd7f55359c90a4108e6528e326b8623fce1ad72a, < f9b8d4dba8e78c1887fecd81ba0d8204d6ff05fc; >= cd7f55359c90a4108e6528e326b8623fce1ad72a, < b3ec50cc5eb5ca84256ca701d28b137a6036c412; >= cd7f55359c90a4108e6528e326b8623fce1ad72a, < b921c288cd8abef9af5b59e056a63cc2c263a9e3; >= cd7f55359c90a4108e6528e…
Fixed in: Linux 5ebf512f335053a42482ebff91e46c6dc156bf8c

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-39895 being exploited?

There is no confirmed exploitation: CVE-2025-39895 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.22% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-39895?

Medium: CVSS 5.5 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-39895?

Linux \>= cd7f55359c90a4108e6528e326b8623fce1ad72a, \< f9b8d4dba8e78c1887fecd81ba0d8204d6ff05fc; \>= cd7f55359c90a4108e6528e326b8623fce1ad72a, \< b3ec50cc5eb5ca84256ca701d28b137a6036c412; \>= cd7f55359c90a4108e6528e326b8623fce1ad72a, \< b921c288cd8abef9af5b59e056a63cc2c263a9e3; \>= cd7f55359c90a4108e6528e326b8623fce1ad72a, \< 5ebf512f335053a42482ebff91e46c6dc156bf8c; Linux 6.3.

### Is there a fix for CVE-2025-39895?

Yes. Fixed in Linux 5ebf512f335053a42482ebff91e46c6dc156bf8c. Upgrade Linux to 5ebf512f335053a42482ebff91e46c6dc156bf8c or later.

### How do I check if I'm affected by CVE-2025-39895?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/f9b8d4dba8e78c1887fecd81ba0d8204d6ff05fc>
- patch: <https://git.kernel.org/stable/c/b3ec50cc5eb5ca84256ca701d28b137a6036c412>
- patch: <https://git.kernel.org/stable/c/b921c288cd8abef9af5b59e056a63cc2c263a9e3>
- patch: <https://git.kernel.org/stable/c/5ebf512f335053a42482ebff91e46c6dc156bf8c>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-39895>

HTML: <https://flawdb.com/CVE-2025-39895> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-39895>
