CVE-2025-39895: sched: Fix sched_numa_find_nth_cpu() if mask offline

Published Oct 1, 2025
·
Updated

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

sched: Fix schednumafindnthcpu() if mask offline

schednumafindnthcpu() uses a bsearch to look for the 'closest' CPU in scheddomainsnumamasks 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 : schednumafindnthcpu+0x2a0/0x488 [ 1.432094] lr : schednumafindnthcpu+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] schednumafindnthcpu+0x2a0/0x488 (P) [ 1.440016] smpcallfunctionany+0xc8/0xd0 [ 1.440416] armv8pmuinit+0x58/0x27c [ 1.440770] armv8cortexa72pmuinit+0x20/0x2c [ 1.441199] armpmudeviceprobe+0x1e4/0x5e8 [ 1.441603] armv8pmudeviceprobe+0x1c/0x28 [ 1.442007] platformprobe+0x5c/0xac [ 1.442347] reallyprobe+0xbc/0x298 [ 1.442683] driverprobedevice+0x78/0x12c [ 1.443087] driverprobedevice+0xdc/0x160 [ 1.443475] driverattach+0x94/0x19c [ 1.443833] busforeachdev+0x74/0xd4 [ 1.444190] driverattach+0x24/0x30 [ 1.444525] busadddriver+0xe4/0x208 [ 1.444874] driverregister+0x60/0x128 [ 1.445233] platformdriverregister+0x24/0x30 [ 1.445662] armv8pmudriverinit+0x28/0x4c [ 1.446059] dooneinitcall+0x44/0x25c [ 1.446416] kernelinitfreeable+0x1dc/0x3bc [ 1.446820] kernelinit+0x20/0x1d8 [ 1.447151] retfromfork+0x10/0x20 [ 1.447493] Code: 90022e21 f000e5f5 910de2b5 2a1703e2 (f8767803) [ 1.448040] ---[ end trace 0000000000000000 ]--- [ 1.448483] note: swapper/0[1] exited with preemptcount 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 Software

10 affected componentsFixes available
Linux Kernel
Microsoft azl3 kernel 6.6.96.2-2
Microsoft azl3 kernel 6.6.104.2-4
Linux Linux kernel>=6.3<6.6.105
Linux Linux kernel>=6.7<6.12.46
Linux Linux kernel>=6.13<6.16.6
Linux Linux kernel=6.17-rc1
Linux Linux kernel=6.17-rc2
Linux Linux kernel=6.17-rc3
Linux Linux kernel=6.17-rc4

Event History

Oct 1, 2025
CVE Published
via MITRE·07:42 AM
Data Sourced
via MITRE·07:42 AM
Description
Data Sourced
via NVD·08:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Oct 2, 2025
Data Sourced
via Microsoft·01:06 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·01:06 AM
Affected Software
Updated
via Microsoft·01:06 AM
DescriptionSeverity

Frequently Asked Questions

1

What is the severity of CVE-2025-39895?

CVE-2025-39895 has a medium severity rating due to its potential impact on CPU scheduling and resource allocation in the Linux kernel.

2

How do I fix CVE-2025-39895?

To fix CVE-2025-39895, update to the latest patch of the Linux kernel that addresses the vulnerability.

3

Which versions of the Linux kernel are affected by CVE-2025-39895?

CVE-2025-39895 affects various versions of the Linux kernel prior to the patch release that addresses the issue.

4

What type of vulnerability is CVE-2025-39895?

CVE-2025-39895 is a scheduling vulnerability in the Linux kernel related to the function sched_numa_find_nth_cpu().

5

Is CVE-2025-39895 exploit code available in the wild?

As of now, there are no known exploit codes publicly available for CVE-2025-39895.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203