]> Git Repo - linux.git/commit
arm64: kasan: Revert "arm64: mte: reset the page tag in page->flags"
authorCatalin Marinas <[email protected]>
Fri, 10 Jun 2022 15:21:41 +0000 (16:21 +0100)
committerWill Deacon <[email protected]>
Thu, 7 Jul 2022 09:48:37 +0000 (10:48 +0100)
commit20794545c14692094a882d2221c251c4573e6adf
tree1c06ac7b159e2ccb16315df9af074082d5a8640a
parent6d05141a393071e104bf5be5ad4d0c79c6dff343
arm64: kasan: Revert "arm64: mte: reset the page tag in page->flags"

This reverts commit e5b8d9218951e59df986f627ec93569a0d22149b.

Pages mapped in user-space with PROT_MTE have the allocation tags either
zeroed or copied/restored to some user values. In order for the kernel
to access such pages via page_address(), resetting the tag in
page->flags was necessary. This tag resetting was deferred to
set_pte_at() -> mte_sync_page_tags() but it can race with another CPU
reading the flags (via page_to_virt()):

P0 (mte_sync_page_tags): P1 (memcpy from virt_to_page):
  Rflags!=0xff
  Wflags=0xff
  DMB (doesn't help)
  Wtags=0
  Rtags=0   // fault

Since now the post_alloc_hook() function resets the page->flags tag when
unpoisoning is skipped for user pages (including the __GFP_ZEROTAGS
case), revert the arm64 commit calling page_kasan_tag_reset().

Signed-off-by: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Vincenzo Frascino <[email protected]>
Cc: Andrey Konovalov <[email protected]>
Cc: Peter Collingbourne <[email protected]>
Reviewed-by: Vincenzo Frascino <[email protected]>
Acked-by: Andrey Konovalov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Will Deacon <[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.0698530000000001 seconds and 4 git commands to generate.