Skip to content

Commit d20f15e

Browse files
committed
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>
1 parent b748574 commit d20f15e

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
@@ -541,7 +541,11 @@ static void ksu_sys_umount(const char *mnt, int flags)
541541

542542
mm_segment_t old_fs = get_fs();
543543
set_fs(KERNEL_DS);
544+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
545+
int ret = ksys_umount(usermnt, flags);
546+
#else
544547
long ret = sys_umount(usermnt, flags); // cuz asmlinkage long sys##name
548+
#endif
545549
set_fs(old_fs);
546550
pr_info("%s: path: %s ret: %d \n", __func__, usermnt, ret);
547551
}

0 commit comments

Comments
 (0)