diff --git a/driver/LKM/include/smith_hook.h b/driver/LKM/include/smith_hook.h index fc3b5df49..7df635a03 100644 --- a/driver/LKM/include/smith_hook.h +++ b/driver/LKM/include/smith_hook.h @@ -14,6 +14,7 @@ #include "kprobe.h" #include "util.h" #include "filter.h" +#include "memcache.h" #include "struct_wrap.h" #include diff --git a/driver/LKM/include/util.h b/driver/LKM/include/util.h index 44cf98805..d6ef35a4d 100644 --- a/driver/LKM/include/util.h +++ b/driver/LKM/include/util.h @@ -28,6 +28,20 @@ static unsigned int ROOT_PID_NS_INUM; +/* + * macro definitions for legacy kernels + */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0) +#define __ARG_PLACEHOLDER_1 0, +#define config_enabled(cfg) _config_enabled(cfg) +#define _config_enabled(value) __config_enabled(__ARG_PLACEHOLDER_##value) +#define __config_enabled(arg1_or_junk) ___config_enabled(arg1_or_junk 1, 0) +#define ___config_enabled(__ignored, val, ...) val +#define IS_ENABLED(option) \ + (config_enabled(option) || config_enabled(option##_MODULE)) +#endif + /* * wrapper of kernel memory allocation routines */ diff --git a/driver/LKM/src/anti_rootkit.c b/driver/LKM/src/anti_rootkit.c index 39652915e..7539d5829 100644 --- a/driver/LKM/src/anti_rootkit.c +++ b/driver/LKM/src/anti_rootkit.c @@ -12,11 +12,10 @@ #if ANTI_ROOTKIT_CHECK #include +#include "../include/util.h" #include "../include/trace.h" -#include "../include/struct_wrap.h" #include "../include/kprobe.h" #include "../include/anti_rootkit.h" -#include "../include/util.h" #define CREATE_PRINT_EVENT #include "../include/anti_rootkit_print.h" diff --git a/driver/LKM/src/trace.c b/driver/LKM/src/trace.c index 567615509..038cd6801 100644 --- a/driver/LKM/src/trace.c +++ b/driver/LKM/src/trace.c @@ -9,9 +9,10 @@ #include #include #include + +#include "../include/util.h" #include "../include/trace.h" #include "../include/kprobe.h" -#include "../include/util.h" #define PROC_ENDPOINT "elkeid-endpoint"