Skip to content

Commit

Permalink
FIXME: building failed for CentOS 6.0
Browse files Browse the repository at this point in the history
IS_EANBLED isn't defined for CentOS 6.0 of kernel 2.6.32-71,
but it's referenced in kprobe_print.h, anti_rootkit_print.h
and struct_wrap.h

We've already had IS_ENABLED defined in util.h but trace.c
does not include uitl.h before trace.h

Signed-off-by: shenping.matt <[email protected]>
  • Loading branch information
shenping-bd committed Dec 8, 2023
1 parent 88d50d5 commit 25c4253
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions driver/LKM/include/smith_hook.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "kprobe.h"
#include "util.h"
#include "filter.h"
#include "memcache.h"
#include "struct_wrap.h"

#include <linux/usb.h>
Expand Down
14 changes: 14 additions & 0 deletions driver/LKM/include/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
3 changes: 1 addition & 2 deletions driver/LKM/src/anti_rootkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
#if ANTI_ROOTKIT_CHECK

#include <linux/kthread.h>
#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"
Expand Down
3 changes: 2 additions & 1 deletion driver/LKM/src/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
#include <linux/proc_fs.h>
#include <linux/slab.h>
#include <linux/version.h>

#include "../include/util.h"
#include "../include/trace.h"
#include "../include/kprobe.h"
#include "../include/util.h"

#define PROC_ENDPOINT "elkeid-endpoint"

Expand Down

0 comments on commit 25c4253

Please sign in to comment.