backport to 4.14 (#59)

This commit is contained in:
chen2021-web
2023-01-15 15:34:15 +08:00
committed by GitHub
parent fb4b9d0173
commit 2359b16526
3 changed files with 21 additions and 4 deletions

View File

@@ -236,7 +236,11 @@ static int read_handler_pre(struct kprobe *p, struct pt_regs *regs)
}
static struct kprobe faccessat_kp = {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
.symbol_name = "do_faccessat",
#else
.symbol_name = "sys_faccessat",
#endif
.pre_handler = faccessat_handler_pre,
};
@@ -248,9 +252,11 @@ static struct kprobe newfstatat_kp = {
static struct kprobe execve_kp = {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
.symbol_name = "do_execveat_common",
#else
.symbol_name = "__do_execve_file",
#endif
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) && LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0)
.symbol_name = "__do_execve_file",
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) && LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0)
.symbol_name = "do_execveat_common",
#endif
.pre_handler = execve_handler_pre,
};