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

Configure Feed

Select the types of activity you want to include in your feed.

um: init cpu_tasks[] earlier

This is currently done in uml_finishsetup(), but e.g. with
KCOV enabled we'll crash because some init code can call
into e.g. memparse(), which has coverage annotations, and
then the checks in check_kcov_mode() crash because current
is NULL.

Simply initialize the cpu_tasks[] array statically, which
fixes the crash. For the later SMP work, it seems to have
not really caused any problems yet, but initialize all of
the entries anyway.

Link: https://patch.msgid.link/20250924113214.c76cd74d0583.I974f691ebb1a2b47915bd2b04cc38e5263b9447f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

+3 -3
+3 -1
arch/um/kernel/process.c
··· 43 43 * cares about its entry, so it's OK if another processor is modifying its 44 44 * entry. 45 45 */ 46 - struct task_struct *cpu_tasks[NR_CPUS]; 46 + struct task_struct *cpu_tasks[NR_CPUS] = { 47 + [0 ... NR_CPUS - 1] = &init_task, 48 + }; 47 49 EXPORT_SYMBOL(cpu_tasks); 48 50 49 51 void free_stack(unsigned long stack, int order)
-2
arch/um/kernel/um_arch.c
··· 239 239 240 240 void uml_finishsetup(void) 241 241 { 242 - cpu_tasks[0] = &init_task; 243 - 244 242 atomic_notifier_chain_register(&panic_notifier_list, 245 243 &panic_exit_notifier); 246 244