Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'bitmap-for-6.17-rc5' of https://github.com/norov/linux

Pull bitmap fix from Yury Norov:
"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"

* tag 'bitmap-for-6.17-rc5' of https://github.com/norov/linux:
sched: Fix sched_numa_find_nth_cpu() if mask offline

+2
+2
kernel/sched/topology.c
··· 2201 2201 goto unlock; 2202 2202 2203 2203 hop_masks = bsearch(&k, k.masks, sched_domains_numa_levels, sizeof(k.masks[0]), hop_cmp); 2204 + if (!hop_masks) 2205 + goto unlock; 2204 2206 hop = hop_masks - k.masks; 2205 2207 2206 2208 ret = hop ?