All of lore.kernel.org
 help / color / mirror / Atom feed
* + kfence-fix-kasan-hw-tags-bypass-via-runtime-sample_interval-change.patch added to mm-nonmm-unstable branch
@ 2026-05-08 20:09 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-05-08 20:09 UTC (permalink / raw)
  To: mm-commits, roman.gushchin, pimyn, gthelen, elver, glider, akpm


The patch titled
     Subject: kfence: fix KASAN HW tags bypass via runtime sample_interval change
has been added to the -mm mm-nonmm-unstable branch.  Its filename is
     kfence-fix-kasan-hw-tags-bypass-via-runtime-sample_interval-change.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/kfence-fix-kasan-hw-tags-bypass-via-runtime-sample_interval-change.patch

This patch will later appear in the mm-nonmm-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 various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: Alexander Potapenko <glider@google.com>
Subject: kfence: fix KASAN HW tags bypass via runtime sample_interval change
Date: Thu, 7 May 2026 11:52:37 +0200

If a user writes a non-zero value to the sample_interval module parameter
at runtime, the missing KASAN HW tags check in the late init path allows
KFENCE to be enabled alongside KASAN HW tags, bypassing the boot
restriction.

This patch adds the missing check to param_set_sample_interval() to reject
the parameter change if KASAN HW tags are enabled.

Link: https://lore.kernel.org/20260507095237.741017-1-glider@google.com
Fixes: 09833d99db36 ("mm/kfence: disable KFENCE upon KASAN HW tags enablement")
Signed-off-by: Alexander Potapenko <glider@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Pimyn Girgis <pimyn@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/kfence/core.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/mm/kfence/core.c~kfence-fix-kasan-hw-tags-bypass-via-runtime-sample_interval-change
+++ a/mm/kfence/core.c
@@ -77,6 +77,11 @@ static int param_set_sample_interval(con
 		WRITE_ONCE(kfence_enabled, false);
 	}
 
+	if (num && kasan_hw_tags_enabled()) {
+		pr_info("disabled as KASAN HW tags are enabled\n");
+		return -EINVAL;
+	}
+
 	*((unsigned long *)kp->arg) = num;
 
 	if (num && !READ_ONCE(kfence_enabled) && system_state != SYSTEM_BOOTING)
_

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

kfence-fix-kasan-hw-tags-bypass-via-runtime-sample_interval-change.patch


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

only message in thread, other threads:[~2026-05-08 20:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-08 20:09 + kfence-fix-kasan-hw-tags-bypass-via-runtime-sample_interval-change.patch added to mm-nonmm-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.