alistair23-linux/arch
Vincenzo Frascino e5b8d92189 arm64: mte: reset the page tag in page->flags
The hardware tag-based KASAN for compatibility with the other modes stores
the tag associated to a page in page->flags.  Due to this the kernel
faults on access when it allocates a page with an initial tag and the user
changes the tags.

Reset the tag associated by the kernel to a page in all the meaningful
places to prevent kernel faults on access.

Note: An alternative to this approach could be to modify page_to_virt().
This though could end up being racy, in fact if a CPU checks the
PG_mte_tagged bit and decides that the page is not tagged but another CPU
maps the same with PROT_MTE and becomes tagged the subsequent kernel
access would fail.

Link: https://lkml.kernel.org/r/9073d4e973747a6f78d5bdd7ebe17f290d087096.1606161801.git.andreyknvl@google.com
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Branislav Rankov <Branislav.Rankov@arm.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Marco Elver <elver@google.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-12-22 12:55:07 -08:00
..
alpha RTC for 5.11 2020-12-20 10:12:06 -08:00
arc tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
arm power supply and reset changes for the v5.11 series 2020-12-19 11:58:46 -08:00
arm64 arm64: mte: reset the page tag in page->flags 2020-12-22 12:55:07 -08:00
c6x tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
csky Tracing updates for 5.11 2020-12-17 13:22:17 -08:00
h8300 tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
hexagon tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
ia64 epoll: wire up syscall epoll_pwait2 2020-12-19 11:18:38 -08:00
m68k Fixes include: 2020-12-21 10:35:11 -08:00
microblaze epoll: wire up syscall epoll_pwait2 2020-12-19 11:18:38 -08:00
mips epoll: fix compat syscall wire up of epoll_pwait2 2020-12-20 10:01:38 -08:00
nds32 Tracing updates for 5.11 2020-12-17 13:22:17 -08:00
nios2 tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
openrisc OpenRISC updates for 5.11 2020-12-17 13:41:27 -08:00
parisc epoll: wire up syscall epoll_pwait2 2020-12-19 11:18:38 -08:00
powerpc epoll: wire up syscall epoll_pwait2 2020-12-19 11:18:38 -08:00
riscv The core framework got some nice improvements this time around. We gained the 2020-12-21 10:39:37 -08:00
s390 ARM: 2020-12-20 10:44:05 -08:00
sh The core framework got some nice improvements this time around. We gained the 2020-12-21 10:39:37 -08:00
sparc epoll: fix compat syscall wire up of epoll_pwait2 2020-12-20 10:01:38 -08:00
um This pull request contains the following changes for UML: 2020-12-17 17:56:44 -08:00
x86 ARM: 2020-12-20 10:44:05 -08:00
xtensa The core framework got some nice improvements this time around. We gained the 2020-12-21 10:39:37 -08:00
.gitignore
Kconfig Tracing updates for 5.11 2020-12-17 13:22:17 -08:00