lib: add test module for CONFIG_DEBUG_VIRTUAL
[email protected]
maintainerPATCH 83/126 lib: add test module for CONFIG_DEBUG_VIRTUAL
From: Florian Fainelli <[email protected]>
Subject: lib: add test module for CONFIG_DEBUG_VIRTUAL
Add a test module that allows testing that CONFIG_DEBUG_VIRTUAL works correctly, at least that it can catch invalid calls to virt_to_phys() against the non-linear kernel virtual address map.
Signed-off-by Florian Fainelli <[email protected]>
Cc "Luis R. Rodriguez" <[email protected]>
Cc Kees Cook <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
lib/Kconfig.debug | 11 ++++++++ lib/Makefile | 1 lib/test_debug_virtual.c | 49 +++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+)
lib/Kconfig.debug renamed from lib/Kconfig.debug~lib-add-test-module-for-config_debug_virtual +11 -0
@@ -1930,6 +1930,17 @@ config TEST_KMOD If unsure, say N. +config TEST_DEBUG_VIRTUAL + tristate "Test CONFIG_DEBUG_VIRTUAL feature" + depends on DEBUG_VIRTUAL + help + Test the kernel's ability to detect incorrect calls to + virt_to_phys() done against the non-linear part of the + kernel's virtual address map. + + If unsure, say N. + + source "samples/Kconfig" source "lib/Kconfig.kgdb"
lib/Makefile renamed from lib/Makefile~lib-add-test-module-for-config_debug_virtual +1 -0
@@ -62,6 +62,7 @@ obj-$(CONFIG_TEST_BITMAP) += test_bitmap obj-$(CONFIG_TEST_UUID) += test_uuid.o obj-$(CONFIG_TEST_PARMAN) += test_parman.o obj-$(CONFIG_TEST_KMOD) += test_kmod.o +obj-$(CONFIG_TEST_DEBUG_VIRTUAL) += test_debug_virtual.o ifeq ($(CONFIG_DEBUG_KOBJECT),y) CFLAGS_kobject.o += -DDEBUG
lib/test_debug_virtual.c new file +49 -0
49 lines not on this page · raw message
_