From 61e3a9bcf29f765d52df955fab844ff53d714e05 Mon Sep 17 00:00:00 2001 From: rsuntk <90097027+rsuntk@users.noreply.github.com> Date: Sun, 25 May 2025 01:43:19 +0000 Subject: [PATCH] kernel: fix ksu_sys_umount compatibility * Some people reports about undefined reference to `sys_umount` * Since ksys_umount exist on Linux 4.17-rc1, then we gonna use that one. Rev 2: Use correct int instead of long for ksys_umount Signed-off-by: rsuntk <90097027+rsuntk@users.noreply.github.com> --- kernel/core_hook.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/core_hook.c b/kernel/core_hook.c index ba528a77..97e3e560 100644 --- a/kernel/core_hook.c +++ b/kernel/core_hook.c @@ -993,7 +993,11 @@ static int ksu_sys_umount(const char *mnt, int flags) mm_segment_t old_fs = get_fs(); set_fs(KERNEL_DS); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) + int ret = ksys_umount(usermnt, flags); +#else long ret = sys_umount(usermnt, flags); // cuz asmlinkage long sys##name +#endif set_fs(old_fs); pr_info("%s: path: %s code: %d \n", __func__, usermnt, ret); }