summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2022-06-09 21:18:46 +0300
committerakpm <akpm@linux-foundation.org>2022-07-04 04:08:39 +0300
commitd9da8f6cf55eeca642c021912af1890002464c64 (patch)
treef858a56b334f12e8324b21707f60fb087276ab78 /include
parentaeaec8e27eddc147b96fe32df2671980ce7ca87c (diff)
downloadlinux-d9da8f6cf55eeca642c021912af1890002464c64.tar.xz
mm: introduce clear_highpage_kasan_tagged
Add a clear_highpage_kasan_tagged() helper that does clear_highpage() on a page potentially tagged by KASAN. This helper is used by the following patch. Link: https://lkml.kernel.org/r/4471979b46b2c487787ddcd08b9dc5fedd1b6ffd.1654798516.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Cc: Alexander Potapenko <glider@google.com> Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Marco Elver <elver@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/highmem.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index fee9835e3793..22379a63e293 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -243,6 +243,16 @@ static inline void clear_highpage(struct page *page)
kunmap_local(kaddr);
}
+static inline void clear_highpage_kasan_tagged(struct page *page)
+{
+ u8 tag;
+
+ tag = page_kasan_tag(page);
+ page_kasan_tag_reset(page);
+ clear_highpage(page);
+ page_kasan_tag_set(page, tag);
+}
+
#ifndef __HAVE_ARCH_TAG_CLEAR_HIGHPAGE
static inline void tag_clear_highpage(struct page *page)