Skip to content

Commit 227ad17

Browse files
rsuntkbackslashxx
authored andcommitted
kernel: core_hook: call ksys_umount on 4.17+
Linux 4.17 added the following: `fs: add ksys_umount() helper; remove in-kernel call to sys_umount()` torvalds/linux@3a18ef5 - which adds a ksys_umount helper, basically turning sys_umount `syscalls/core: Introduce CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y` torvalds/linux@1bd21c6 - which undefines in-kernel calls of syscalls, which is enabled on 4.19's arch/arm64/Kconfig Ref: - https://github.com/torvalds/linux/commits/v4.17/include/linux/syscalls.h - rsuntk@d20f15e Fixes: `kernel: core_hook: screw path_umount backport, call sys_umount directly` for 4.19/5.4 Tested-by: rsuntk <[email protected]> Signed-off-by: backslashxx <[email protected]>
1 parent 2a005e0 commit 227ad17

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kernel/core_hook.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,11 @@ static void ksu_sys_umount(const char *mnt, int flags)
524524

525525
mm_segment_t old_fs = get_fs();
526526
set_fs(KERNEL_DS);
527+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
528+
int ret = ksys_umount(usermnt, flags);
529+
#else
527530
long ret = sys_umount(usermnt, flags); // cuz asmlinkage long sys##name
531+
#endif
528532
set_fs(old_fs);
529533
pr_info("%s: path: %s code: %d \n", __func__, mnt, ret);
530534
}

0 commit comments

Comments
 (0)