m0nad / Diamorphine

LKM rootkit for Linux Kernels 2.6.x/3.x/4.x/5.x/6.x (x86/x86_64 and ARM64)
Other
1.82k stars 431 forks source link

Compilation Errors on CentOS 5.8 - Kernel 2.6.18-308.16.1.el5 #16

Closed mukesh-610 closed 3 years ago

mukesh-610 commented 4 years ago

I'm getting a bunch of "undefined syscall number" errors.

diamorphine.c: In function ‘get_syscall_table_bf’:
diamorphine.c:46: error: ‘__NR_close’ undeclared (first use in this function)
diamorphine.c:46: error: (Each undeclared identifier is reported only once
diamorphine.c:46: error: for each function it appears in.)
diamorphine.c: In function ‘diamorphine_init’:
diamorphine.c:299: error: ‘__NR_getdents’ undeclared (first use in this function)
diamorphine.c:300: error: ‘__NR_getdents64’ undeclared (first use in this function)
diamorphine.c:301: error: ‘__NR_kill’ undeclared (first use in this function)
diamorphine.c: In function ‘diamorphine_cleanup’:
diamorphine.c:316: error: ‘__NR_getdents’ undeclared (first use in this function)
diamorphine.c:317: error: ‘__NR_getdents64’ undeclared (first use in this function)
diamorphine.c:318: error: ‘__NR_kill’ undeclared (first use in this function)

Am I missing any packages?

Kernel 2.6.18-308.16.1.el5
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52)
mukesh-610 commented 4 years ago

Wow. Just as I finished typing this comment, I found the relevant definitions in asm/unistd.h. I just put #include <asm/unistd.h> on the top in diamorphine.c and it compiled perfectly.

But, I have a different issue now. After insmod the VM crashed and rebooted.

m0nad commented 4 years ago

Thanks for reporting, but I need to investigate the issue.

m0nad commented 3 years ago

Compilation should work now.