[Devel] [PATCH hci-8.1 3/4] configs: build the User Mode Linux KUnit kernel with KASAN

Konstantin Khorenko khorenko at virtuozzo.com
Mon Oct 26 21:05:45 MSK 2026


Generic KASAN catches out-of-bounds and use-after-free accesses that a
test itself does not notice. Instrumentation is inline and covers
vmalloc too.

The KASAN self-test stays out. It makes bad accesses on purpose and
expects their reports on the console, where hci-kunit counts any report
as a failure of the run. What it checks is KASAN itself, not our code.

SLUB_DEBUG_ON stays off: KASAN catches what its redzones and poisoning
would, and at the moment of the access.

https://virtuozzo.atlassian.net/browse/VSTOR-143636
https://virtuozzo.atlassian.net/browse/VSTOR-148112

Feature: KUnit tests on User Mode Linux
Co-developed-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 redhat/configs/custom-overrides/generic/um/CONFIG_KASAN            | 1 +
 redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_GENERIC    | 1 +
 redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_INLINE     | 1 +
 redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_KUNIT_TEST | 1 +
 redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_OUTLINE    | 1 +
 redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_VMALLOC    | 1 +
 6 files changed, 6 insertions(+)

diff --git a/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN b/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN
new file mode 100644
index 0000000000000..4d920992d7c88
--- /dev/null
+++ b/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN
@@ -0,0 +1 @@
+CONFIG_KASAN=y
diff --git a/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_GENERIC b/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_GENERIC
new file mode 100644
index 0000000000000..1c58d0d4a67d6
--- /dev/null
+++ b/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_GENERIC
@@ -0,0 +1 @@
+CONFIG_KASAN_GENERIC=y
diff --git a/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_INLINE b/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_INLINE
new file mode 100644
index 0000000000000..80f3231193560
--- /dev/null
+++ b/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_INLINE
@@ -0,0 +1 @@
+CONFIG_KASAN_INLINE=y
diff --git a/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_KUNIT_TEST b/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_KUNIT_TEST
new file mode 100644
index 0000000000000..c3842ac36b18c
--- /dev/null
+++ b/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_KUNIT_TEST
@@ -0,0 +1 @@
+# CONFIG_KASAN_KUNIT_TEST is not set
diff --git a/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_OUTLINE b/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_OUTLINE
new file mode 100644
index 0000000000000..9b97879cd3adc
--- /dev/null
+++ b/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_OUTLINE
@@ -0,0 +1 @@
+# CONFIG_KASAN_OUTLINE is not set
diff --git a/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_VMALLOC b/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_VMALLOC
new file mode 100644
index 0000000000000..290120758d0b0
--- /dev/null
+++ b/redhat/configs/custom-overrides/generic/um/CONFIG_KASAN_VMALLOC
@@ -0,0 +1 @@
+CONFIG_KASAN_VMALLOC=y

-- 
2.43.0



More information about the Devel mailing list