powerpc/kasan: Mark more real-mode code as not to be instrumented
authorPaul Mackerras <paulus@ozlabs.org>
Thu, 19 May 2022 07:45:21 +0000 (17:45 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 29 May 2022 00:30:42 +0000 (10:30 +1000)
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
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/rtas.c
arch/powerpc/kexec/crash.c
arch/powerpc/platforms/powernv/Makefile

index 2e2a2a9bcf43f09ef4d9025c1f308d93c6c7ffe6..f91f0f29a566acf4cc3430eb84a9ead48287937c 100644 (file)
@@ -37,6 +37,8 @@ KASAN_SANITIZE_paca.o := n
 KASAN_SANITIZE_setup_64.o := n
 KASAN_SANITIZE_mce.o := n
 KASAN_SANITIZE_mce_power.o := n
+KASAN_SANITIZE_udbg.o := n
+KASAN_SANITIZE_udbg_16550.o := n
 
 # we have to be particularly careful in ppc64 to exclude code that
 # runs with translations off, as we cannot access the shadow with
index 9bb43aa53d43ec331299a2d378751b694bed609d..a6fce3106e02b73d595fee1747740b3385f1007d 100644 (file)
@@ -993,8 +993,8 @@ int rtas_call_reentrant(int token, int nargs, int nret, int *outputs, ...)
  *
  * Return: A pointer to the specified errorlog or NULL if not found.
  */
-struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log,
-                                             uint16_t section_id)
+noinstr struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log,
+                                                     uint16_t section_id)
 {
        struct rtas_ext_event_log_v6 *ext_log =
                (struct rtas_ext_event_log_v6 *)log->buffer;
index d85fa9fc6f3ca4a7f12681974961308ace4a78a8..80f54723cf6d1ffa04543fb4f7d7c7a24fb82ca0 100644 (file)
@@ -224,7 +224,7 @@ void crash_kexec_secondary(struct pt_regs *regs)
 
 /* wait for all the CPUs to hit real mode but timeout if they don't come in */
 #if defined(CONFIG_SMP) && defined(CONFIG_PPC64)
-static void __maybe_unused crash_kexec_wait_realmode(int cpu)
+noinstr static void __maybe_unused crash_kexec_wait_realmode(int cpu)
 {
        unsigned int msecs;
        int i;
index 6488b38421999efd62dff4be1f30294cfb368559..19f0fc5c6f1b4176f208d47801366d067ba74a1c 100644 (file)
@@ -4,6 +4,7 @@
 # in particular, idle code runs a bunch of things in real mode
 KASAN_SANITIZE_idle.o := n
 KASAN_SANITIZE_pci-ioda.o := n
+KASAN_SANITIZE_pci-ioda-tce.o := n
 # pnv_machine_check_early
 KASAN_SANITIZE_setup.o := n