Re: [PATCH 2/2] powerpc/64: poison __per_cpu_offset to catch use-before-init

2022-08-01 Thread Michael Ellerman
Nicholas Piggin writes: > If the boot CPU tries to access per-cpu data of other CPUs before > per cpu areas are set up, it will unexpectedly use offset 0. > > Try to catch such accesses by poisoning the __per_cpu_offset array. I wasn't sure about this. On bare metal it's just an instant checksto

[PATCH 2/2] powerpc/64: poison __per_cpu_offset to catch use-before-init

2022-07-10 Thread Nicholas Piggin
If the boot CPU tries to access per-cpu data of other CPUs before per cpu areas are set up, it will unexpectedly use offset 0. Try to catch such accesses by poisoning the __per_cpu_offset array. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/percpu.h | 1 + arch/powerpc/kernel/paca