mirror of
https://github.com/torvalds/linux.git
synced 2025-11-08 04:30:00 +02:00
Check that the per-cpu cluster mask pointer has been set prior to
clearing a dying cpu's bit. The per-cpu pointer is not set until the
target cpu reaches smp_callin() during CPUHP_BRINGUP_CPU, whereas the
teardown function, x2apic_dead_cpu(), is associated with the earlier
CPUHP_X2APIC_PREPARE. If an error occurs before the cpu is awakened,
e.g. if do_boot_cpu() itself fails, x2apic_dead_cpu() will dereference
the NULL pointer and cause a panic.
smpboot: do_boot_cpu failed(-22) to wakeup CPU#1
BUG: kernel NULL pointer dereference, address: 0000000000000008
RIP: 0010:x2apic_dead_cpu+0x1a/0x30
Call Trace:
cpuhp_invoke_callback+0x9a/0x580
_cpu_up+0x10d/0x140
do_cpu_up+0x69/0xb0
smp_init+0x63/0xa9
kernel_init_freeable+0xd7/0x229
? rest_init+0xa0/0xa0
kernel_init+0xa/0x100
ret_from_fork+0x35/0x40
Fixes:
|
||
|---|---|---|
| .. | ||
| apic.c | ||
| apic_common.c | ||
| apic_flat_64.c | ||
| apic_noop.c | ||
| apic_numachip.c | ||
| bigsmp_32.c | ||
| hw_nmi.c | ||
| io_apic.c | ||
| ipi.c | ||
| local.h | ||
| Makefile | ||
| msi.c | ||
| probe_32.c | ||
| probe_64.c | ||
| vector.c | ||
| x2apic_cluster.c | ||
| x2apic_phys.c | ||
| x2apic_uv_x.c | ||