lkdtm: Do not depend on BLOCK and clean up headers
authorKees Cook <keescook@chromium.org>
Tue, 27 Nov 2018 17:11:15 +0000 (09:11 -0800)
committerKees Cook <keescook@chromium.org>
Wed, 9 Jan 2019 19:58:51 +0000 (11:58 -0800)
After the transition to kprobes, symbols are resolved at runtime. This
means there is no need to have all the Kconfig and header logic to
avoid build failures. This also paves the way to having arbitrary test
locations.

Reported-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Kees Cook <keescook@chromium.org>
drivers/misc/lkdtm/core.c
lib/Kconfig.debug

index 2837dc77478ed43e9a8561c850c92879f010b07d..5d41c2230d2e47de8711a71b4f31c76860876f40 100644 (file)
 #include <linux/kprobes.h>
 #include <linux/list.h>
 #include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/hrtimer.h>
 #include <linux/slab.h>
-#include <scsi/scsi_cmnd.h>
 #include <linux/debugfs.h>
 
-#ifdef CONFIG_IDE
-#include <linux/ide.h>
-#endif
-
 #define DEFAULT_COUNT 10
 
 static int lkdtm_debugfs_open(struct inode *inode, struct file *file);
@@ -102,9 +95,7 @@ static struct crashpoint crashpoints[] = {
        CRASHPOINT("MEM_SWAPOUT",        "shrink_inactive_list"),
        CRASHPOINT("TIMERADD",           "hrtimer_start"),
        CRASHPOINT("SCSI_DISPATCH_CMD",  "scsi_dispatch_cmd"),
-# ifdef CONFIG_IDE
        CRASHPOINT("IDE_CORE_CP",        "generic_ide_ioctl"),
-# endif
 #endif
 };
 
index d4df5b24d75e107061fe8db387948d5dc5c785c4..42479a9a4769f607578637b48ae920dc23d47e8c 100644 (file)
@@ -1700,7 +1700,6 @@ if RUNTIME_TESTING_MENU
 config LKDTM
        tristate "Linux Kernel Dump Test Tool Module"
        depends on DEBUG_FS
-       depends on BLOCK
        help
        This module enables testing of the different dumping mechanisms by
        inducing system failures at predefined crash points.