From: Peter Collingbourne <pcc@google.com>
To: Andrey Konovalov <andreyknvl@gmail.com>,
Alexander Potapenko <glider@google.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Jann Horn <jannh@google.com>
Cc: Peter Collingbourne <pcc@google.com>,
Evgenii Stepanov <eugenis@google.com>,
linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 0/4] arm64: improve efficiency of setting tags for user pages
Date: Thu, 27 May 2021 18:04:11 -0700 [thread overview]
Message-ID: <20210528010415.1852012-1-pcc@google.com> (raw)
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.rc0.204.g9fa02ecfa5-goog
next reply other threads:[~2021-05-28 1:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-28 1:04 Peter Collingbourne [this message]
2021-05-28 1:04 ` [PATCH v4 1/4] mm: arch: remove indirection level in alloc_zeroed_user_highpage_movable() Peter Collingbourne
2021-05-28 16:33 ` kernel test robot
2021-05-28 1:04 ` [PATCH v4 2/4] kasan: use separate (un)poison implementation for integrated init Peter Collingbourne
2021-05-28 10:25 ` Andrey Konovalov
2021-06-01 19:28 ` Peter Collingbourne
2021-06-02 12:19 ` Andrey Konovalov
2021-05-28 1:04 ` [PATCH v4 3/4] arm64: mte: handle tags zeroing at page allocation time Peter Collingbourne
2021-05-28 1:04 ` [PATCH v4 4/4] kasan: disable freed user page poisoning with HW tags Peter Collingbourne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210528010415.1852012-1-pcc@google.com \
--to=pcc@google.com \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=eugenis@google.com \
--cc=glider@google.com \
--cc=jannh@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=vincenzo.frascino@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).