[for-stable-4.19 PATCH v2 0/2] Backport patches to fix KASAN+LKDTM with recent clang on ARM64
From: Nicolas Boichat
Date: Sat Mar 20 2021 - 00:17:46 EST
Backport 2 patches that are required to make KASAN+LKDTM work
with recent clang (patch 2/2 has a complete description).
Tested on our chromeos-4.19 branch.
Also compile tested on x86-64 and arm64 with gcc this time
around.
Patch 1/2 adds a guard around noinstr that matches upstream,
to prevent a build issue, and has some minor context conflicts.
Patch 2/2 is a clean backport.
These patches have been merged to 5.4 stable already. We might
need to backport to older stable branches, but this is what I
could test for now.
Changes in v2:
- Guard noinstr macro by __KERNEL__ && !__ASSEMBLY__ to prevent
expansion in linker script and match upstream.
Mark Rutland (1):
lkdtm: don't move ctors to .rodata
Thomas Gleixner (1):
vmlinux.lds.h: Create section for protection against instrumentation
arch/powerpc/kernel/vmlinux.lds.S | 1 +
drivers/misc/lkdtm/Makefile | 2 +-
drivers/misc/lkdtm/rodata.c | 2 +-
include/asm-generic/sections.h | 3 ++
include/asm-generic/vmlinux.lds.h | 10 ++++++
include/linux/compiler.h | 54 +++++++++++++++++++++++++++++++
include/linux/compiler_types.h | 6 ++++
scripts/mod/modpost.c | 2 +-
8 files changed, 77 insertions(+), 3 deletions(-)
--
2.31.0.rc2.261.g7f71774620-goog