All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] arm64: improve efficiency of setting tags for user pages
@ 2021-05-12 20:09 ` Peter Collingbourne
  0 siblings, 0 replies; 28+ messages in thread
From: Peter Collingbourne @ 2021-05-12 20:09 UTC (permalink / raw)
  To: Andrey Konovalov, Alexander Potapenko, Catalin Marinas,
	Vincenzo Frascino, Andrew Morton
  Cc: Peter Collingbourne, Evgenii Stepanov, linux-mm, linux-arm-kernel

Currently we can end up touching PROT_MTE user pages twice on fault
and once on unmap. On fault, with KASAN disabled we first clear data
and then set tags to 0, and with KASAN enabled we simultaneously
clear data and set tags to the KASAN random tag, and then set tags
again to 0. On unmap, we poison the page by setting tags, but this
is less likely to find a bug than poisoning kernel pages.

This patch series fixes these inefficiencies by only touching the pages
once on fault using the DC GZVA instruction to clear both data and
tags, and providing the option to avoid poisoning user pages on free.

Peter Collingbourne (3):
  kasan: use separate (un)poison implementation for integrated init
  arm64: mte: handle tags zeroing at page allocation time
  kasan: allow freed user page poisoning to be disabled with HW tags

 arch/arm64/include/asm/mte.h   |  4 ++
 arch/arm64/include/asm/page.h  |  9 ++++-
 arch/arm64/lib/mte.S           | 20 ++++++++++
 arch/arm64/mm/fault.c          | 25 +++++++++++++
 arch/arm64/mm/proc.S           | 10 +++--
 include/linux/gfp.h            | 18 +++++++--
 include/linux/highmem.h        |  8 ++++
 include/linux/kasan.h          | 66 ++++++++++++++++++++-------------
 include/linux/page-flags.h     |  9 +++++
 include/trace/events/mmflags.h |  9 ++++-
 mm/kasan/common.c              |  4 +-
 mm/kasan/hw_tags.c             | 31 ++++++++++++++++
 mm/mempool.c                   |  6 ++-
 mm/page_alloc.c                | 67 ++++++++++++++++++++--------------
 14 files changed, 221 insertions(+), 65 deletions(-)

-- 
2.31.1.607.g51e8a6a459-goog



^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2021-05-28  1:22 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-12 20:09 [PATCH v3 0/3] arm64: improve efficiency of setting tags for user pages Peter Collingbourne
2021-05-12 20:09 ` Peter Collingbourne
2021-05-12 20:09 ` [PATCH v3 1/3] kasan: use separate (un)poison implementation for integrated init Peter Collingbourne
2021-05-12 20:09   ` Peter Collingbourne
2021-05-25 22:00   ` Andrey Konovalov
2021-05-25 22:00     ` Andrey Konovalov
2021-05-28  1:04     ` Peter Collingbourne
2021-05-28  1:04       ` Peter Collingbourne
2021-05-26 10:12   ` Marco Elver
2021-05-26 10:12     ` Marco Elver
2021-05-26 19:27     ` Peter Collingbourne
2021-05-26 19:27       ` Peter Collingbourne
2021-05-26 19:54       ` Marco Elver
2021-05-26 19:54         ` Marco Elver
2021-05-12 20:09 ` [PATCH v3 2/3] arm64: mte: handle tags zeroing at page allocation time Peter Collingbourne
2021-05-12 20:09   ` Peter Collingbourne
2021-05-25 22:00   ` Andrey Konovalov
2021-05-25 22:00     ` Andrey Konovalov
2021-05-12 20:09 ` [PATCH v3 3/3] kasan: allow freed user page poisoning to be disabled with HW tags Peter Collingbourne
2021-05-12 20:09   ` Peter Collingbourne
2021-05-25 22:06   ` Andrey Konovalov
2021-05-25 22:06     ` Andrey Konovalov
2021-05-26 10:45     ` Jann Horn
2021-05-26 10:45       ` Jann Horn
2021-05-28  1:05       ` Peter Collingbourne
2021-05-28  1:05         ` Peter Collingbourne
2021-05-25 19:03 ` [PATCH v3 0/3] arm64: improve efficiency of setting tags for user pages Peter Collingbourne
2021-05-25 19:03   ` Peter Collingbourne

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.