linux/arch
Andrey Konovalov be21fa3044 UPSTREAM: kasan, mm, arm64: tag non slab memory allocated via pagealloc
(Upstream commit 2813b9c029).

Tag-based KASAN doesn't check memory accesses through pointers tagged with
0xff.  When page_address is used to get pointer to memory that corresponds
to some page, the tag of the resulting pointer gets set to 0xff, even
though the allocated memory might have been tagged differently.

For slab pages it's impossible to recover the correct tag to return from
page_address, since the page might contain multiple slab objects tagged
with different values, and we can't know in advance which one of them is
going to get accessed.  For non slab pages however, we can recover the tag
in page_address, since the whole page was marked with the same tag.

This patch adds tagging to non slab memory allocated with pagealloc.  To
set the tag of the pointer returned from page_address, the tag gets stored
to page->flags when the memory gets allocated.

Link: http://lkml.kernel.org/r/d758ddcef46a5abc9970182b9137e2fbee202a2c.1544099024.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Bug: 128674696
Change-Id: I500bdf42462fee0ee14495a6be51815e7e44460f
2019-09-24 17:44:13 -07:00
..
alpha alpha: Fix Eiger NR_IRQS to 128 2019-02-20 10:25:47 +01:00
arc ARC: mm: SIGSEGV userspace trying to access kernel virtual memory 2019-09-16 08:22:14 +02:00
arm This is the 4.19.75 stable release 2019-09-21 07:55:26 +02:00
arm64 UPSTREAM: kasan, mm, arm64: tag non slab memory allocated via pagealloc 2019-09-24 17:44:13 -07:00
c6x
h8300 h8300: use cc-cross-prefix instead of hardcoding h8300-unknown-linux- 2019-04-05 22:32:55 +02:00
hexagon
ia64 ia64: fix build errors by exporting paddr_to_nid() 2019-06-22 08:15:19 +02:00
m68k crypto: speck - remove Speck 2019-04-03 15:25:12 -07:00
microblaze
mips This is the 4.19.69 stable release 2019-09-02 17:39:29 +02:00
nds32 Merge remote-tracking branch 'origin/upstream-f2fs-stable-linux-4.19.y' into android-4.19 2019-05-08 15:13:46 -07:00
nios2
openrisc
parisc parisc: Fix build of compressed kernel even with debug enabled 2019-08-06 19:06:55 +02:00
powerpc This is the 4.19.75 stable release 2019-09-21 07:55:26 +02:00
riscv riscv: remove unused variable in ftrace 2019-09-16 08:21:44 +02:00
s390 This is the 4.19.75 stable release 2019-09-21 07:55:26 +02:00
sh sh: kernel: hw_breakpoint: Fix missing break in switch statement 2019-08-25 10:47:42 +02:00
sparc sparc: perf: fix updated event period in response to PERF_EVENT_IOC_PERIOD 2019-06-25 11:35:57 +08:00
um um: Silence lockdep complaint about mmap_sem 2019-07-31 07:27:04 +02:00
unicore32
x86 BACKPORT: kasan: rename kasan_zero_page to kasan_early_shadow_page 2019-09-24 17:44:12 -07:00
xtensa BACKPORT: kasan: rename kasan_zero_page to kasan_early_shadow_page 2019-09-24 17:44:12 -07:00
.gitignore
Kconfig UPSTREAM: arm64: Add support for relocating the kernel with RELR relocations 2019-09-17 04:14:27 +00:00