]> Git Repo - linux.git/commit
arm64: mte: reset the page tag in page->flags
authorVincenzo Frascino <[email protected]>
Tue, 22 Dec 2020 20:01:31 +0000 (12:01 -0800)
committerLinus Torvalds <[email protected]>
Tue, 22 Dec 2020 20:55:07 +0000 (12:55 -0800)
commite5b8d9218951e59df986f627ec93569a0d22149b
treeca062c821b1621f828f36e535b63ae1764627ca4
parent85f49cae4dfcfae16f17418466e00370091de03d
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 <[email protected]>
Signed-off-by: Andrey Konovalov <[email protected]>
Reviewed-by: Catalin Marinas <[email protected]>
Tested-by: Vincenzo Frascino <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: Branislav Rankov <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Cc: Evgenii Stepanov <[email protected]>
Cc: Kevin Brodsky <[email protected]>
Cc: Marco Elver <[email protected]>
Cc: Vasily Gorbik <[email protected]>
Cc: Will Deacon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
arch/arm64/kernel/hibernate.c
arch/arm64/kernel/mte.c
arch/arm64/mm/copypage.c
arch/arm64/mm/mteswap.c
This page took 0.056445 seconds and 4 git commands to generate.