linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 0/4] arm64: improve efficiency of setting tags for user pages
@ 2021-06-02 23:52 Peter Collingbourne
  2021-06-02 23:52 ` [PATCH v6 1/4] mm: arch: remove indirection level in alloc_zeroed_user_highpage_movable() Peter Collingbourne
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Peter Collingbourne @ 2021-06-02 23:52 UTC (permalink / raw)
  To: Andrey Konovalov, Alexander Potapenko, Catalin Marinas,
	Vincenzo Frascino, Andrew Morton, Jann Horn
  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 avoiding poisoning user pages on free.

Peter Collingbourne (4):
  mm: arch: remove indirection level in
    alloc_zeroed_user_highpage_movable()
  kasan: use separate (un)poison implementation for integrated init
  arm64: mte: handle tags zeroing at page allocation time
  kasan: disable freed user page poisoning with HW tags

 arch/alpha/include/asm/page.h   |  6 +--
 arch/arm64/include/asm/mte.h    |  4 ++
 arch/arm64/include/asm/page.h   | 10 +++--
 arch/arm64/lib/mte.S            | 20 ++++++++++
 arch/arm64/mm/fault.c           | 26 +++++++++++++
 arch/arm64/mm/proc.S            | 10 +++--
 arch/ia64/include/asm/page.h    |  6 +--
 arch/m68k/include/asm/page_no.h |  6 +--
 arch/s390/include/asm/page.h    |  6 +--
 arch/x86/include/asm/page.h     |  6 +--
 include/linux/gfp.h             | 18 +++++++--
 include/linux/highmem.h         | 43 ++++++++-------------
 include/linux/kasan.h           | 64 +++++++++++++++++++-------------
 include/linux/page-flags.h      |  9 +++++
 include/trace/events/mmflags.h  |  9 ++++-
 mm/kasan/common.c               |  4 +-
 mm/kasan/hw_tags.c              | 32 ++++++++++++++++
 mm/mempool.c                    |  6 ++-
 mm/page_alloc.c                 | 66 +++++++++++++++++++--------------
 19 files changed, 242 insertions(+), 109 deletions(-)

-- 
2.32.0.rc1.229.g3e70b5a671-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-06-04 19:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02 23:52 [PATCH v6 0/4] arm64: improve efficiency of setting tags for user pages Peter Collingbourne
2021-06-02 23:52 ` [PATCH v6 1/4] mm: arch: remove indirection level in alloc_zeroed_user_highpage_movable() Peter Collingbourne
2021-06-04  9:45   ` Catalin Marinas
2021-06-02 23:52 ` [PATCH v6 2/4] kasan: use separate (un)poison implementation for integrated init Peter Collingbourne
2021-06-02 23:52 ` [PATCH v6 3/4] arm64: mte: handle tags zeroing at page allocation time Peter Collingbourne
2021-06-02 23:52 ` [PATCH v6 4/4] kasan: disable freed user page poisoning with HW tags Peter Collingbourne
2021-06-04  3:03 ` [PATCH v6 0/4] arm64: improve efficiency of setting tags for user pages Andrew Morton
2021-06-04 18:31   ` Will Deacon
2021-06-04 19:48 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).