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

powerpc/kasan: Mark more real-mode code as not to be instrumented

This marks more files and functions that can possibly be called in
real mode as not to be instrumented by KASAN. Most were found by
inspection, except for get_pseries_errorlog() which was reported as
causing a crash in testing.

Reported-by: Nageswara R Sastry <rnsastry@linux.ibm.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/YoX1kZPnmUX4RZEK@cleo

authored by

Paul Mackerras and committed by
Michael Ellerman
743cdb7b 6112bd00

+6 -3
+2
arch/powerpc/kernel/Makefile
··· 37 37 KASAN_SANITIZE_setup_64.o := n 38 38 KASAN_SANITIZE_mce.o := n 39 39 KASAN_SANITIZE_mce_power.o := n 40 + KASAN_SANITIZE_udbg.o := n 41 + KASAN_SANITIZE_udbg_16550.o := n 40 42 41 43 # we have to be particularly careful in ppc64 to exclude code that 42 44 # runs with translations off, as we cannot access the shadow with
+2 -2
arch/powerpc/kernel/rtas.c
··· 993 993 * 994 994 * Return: A pointer to the specified errorlog or NULL if not found. 995 995 */ 996 - struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log, 997 - uint16_t section_id) 996 + noinstr struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log, 997 + uint16_t section_id) 998 998 { 999 999 struct rtas_ext_event_log_v6 *ext_log = 1000 1000 (struct rtas_ext_event_log_v6 *)log->buffer;
+1 -1
arch/powerpc/kexec/crash.c
··· 224 224 225 225 /* wait for all the CPUs to hit real mode but timeout if they don't come in */ 226 226 #if defined(CONFIG_SMP) && defined(CONFIG_PPC64) 227 - static void __maybe_unused crash_kexec_wait_realmode(int cpu) 227 + noinstr static void __maybe_unused crash_kexec_wait_realmode(int cpu) 228 228 { 229 229 unsigned int msecs; 230 230 int i;
+1
arch/powerpc/platforms/powernv/Makefile
··· 4 4 # in particular, idle code runs a bunch of things in real mode 5 5 KASAN_SANITIZE_idle.o := n 6 6 KASAN_SANITIZE_pci-ioda.o := n 7 + KASAN_SANITIZE_pci-ioda-tce.o := n 7 8 # pnv_machine_check_early 8 9 KASAN_SANITIZE_setup.o := n 9 10