Skip to contentSkip to conversation

kfence-fix-kasan-hw-tags-bypass-via-runtime-sample_interval-change.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message May 29

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: kfence: fix KASAN HW tags bypass via runtime sample_interval change
has been removed from the -mm tree. Its filename was
kfence-fix-kasan-hw-tags-bypass-via-runtime-sample_interval-change.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Alexander Potapenko <[email protected]>
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.

Fixes 09833d99db36 ("mm/kfence: disable KFENCE upon KASAN HW tags enablement")
Cc Marco Elver <[email protected]>
Cc Greg Thelen <[email protected]>
Cc Roman Gushchin <[email protected]>
Cc Pimyn Girgis <[email protected]>

---

 mm/kfence/core.c |    5 +++++
 1 file changed, 5 insertions(+)
mm/kfence/core.c renamed from mm/kfence/core.c~kfence-fix-kasan-hw-tags-bypass-via-runtime-sample_interval-change +5 -0
@@ -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 [email protected] are

lib-test_meminit-use-for-bools.patch