powerpc/kasan: Mark more real-mode code as not to be instrumented
PATCH 1/1 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 <[email protected]>
Signed-off-by Paul Mackerras <[email protected]>
--- arch/powerpc/kernel/Makefile | 2 ++ arch/powerpc/kernel/rtas.c | 4 ++-- arch/powerpc/kexec/crash.c | 2 +- arch/powerpc/platforms/powernv/Makefile | 1 + 4 files changed, 6 insertions(+), 3 deletions(-)
arch/powerpc/kernel/Makefile +2 -0
@@ -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
arch/powerpc/kernel/rtas.c +2 -2
@@ -974,8 +974,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;
arch/powerpc/kexec/crash.c +1 -1
@@ -225,7 +225,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;
arch/powerpc/platforms/powernv/Makefile +1 -0
@@ -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
Signature · 1 line
2.35.3
Michael Ellerman
AppliedQuoted 6 lines · Paul Mackerras
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.
Applied to powerpc/fixes.
[1/1] powerpc/kasan: Mark more real-mode code as not to be instrumented
https://git.kernel.org/powerpc/c/743cdb7bd0f1cb32c03680c8b38257957db2e692
cheers