All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-introduce-clear_highpage_kasan_tagged.patch added to mm-unstable branch
@ 2022-06-09 18:45 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2022-06-09 18:45 UTC (permalink / raw)
  To: mm-commits, ryabinin.a.a, glider, elver, dvyukov, andreyknvl, akpm


The patch titled
     Subject: mm: introduce clear_highpage_kasan_tagged
has been added to the -mm mm-unstable branch.  Its filename is
     mm-introduce-clear_highpage_kasan_tagged.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-introduce-clear_highpage_kasan_tagged.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Andrey Konovalov <andreyknvl@google.com>
Subject: mm: introduce clear_highpage_kasan_tagged
Date: Thu, 9 Jun 2022 20:18:46 +0200

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>
---

 include/linux/highmem.h |   10 ++++++++++
 mm/page_alloc.c         |    8 ++------
 2 files changed, 12 insertions(+), 6 deletions(-)

--- a/include/linux/highmem.h~mm-introduce-clear_highpage_kasan_tagged
+++ a/include/linux/highmem.h
@@ -243,6 +243,16 @@ static inline void clear_highpage(struct
 	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)
--- a/mm/page_alloc.c~mm-introduce-clear_highpage_kasan_tagged
+++ a/mm/page_alloc.c
@@ -1310,12 +1310,8 @@ static void kernel_init_pages(struct pag
 
 	/* s390's use of memset() could override KASAN redzones. */
 	kasan_disable_current();
-	for (i = 0; i < numpages; i++) {
-		u8 tag = page_kasan_tag(page + i);
-		page_kasan_tag_reset(page + i);
-		clear_highpage(page + i);
-		page_kasan_tag_set(page + i, tag);
-	}
+	for (i = 0; i < numpages; i++)
+		clear_highpage_kasan_tagged(page + i);
 	kasan_enable_current();
 }
 
_

Patches currently in -mm which might be from andreyknvl@google.com are

mm-rename-kernel_init_free_pages-to-kernel_init_pages.patch
mm-introduce-clear_highpage_kasan_tagged.patch
kasan-fix-zeroing-vmalloc-memory-with-hw_tags.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-09 18:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 18:45 + mm-introduce-clear_highpage_kasan_tagged.patch added to mm-unstable branch Andrew Morton

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.