Skip to content

Commit

Permalink
kernel: core_hook: upstream ksu_umount_mnt
Browse files Browse the repository at this point in the history
cherry picked from tiann@898e9d4
  • Loading branch information
backslashxx committed Feb 23, 2025
1 parent c77096e commit b126a91
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions kernel/core_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,14 +499,12 @@ static bool should_umount(struct path *path)
return false;
}

static int ksu_umount_mnt(struct path *path, int flags)
static void ksu_umount_mnt(struct path *path, int flags)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) || defined(KSU_UMOUNT)
return path_umount(path, flags);
#else
// TODO: umount for non GKI kernel
return -ENOSYS;
#endif
int err = path_umount(path, flags);
if (err) {
pr_info("umount %s failed: %d\n", path->dentry->d_iname, err);
}
}

static void try_umount(const char *mnt, bool check_mnt, int flags)
Expand All @@ -527,10 +525,7 @@ static void try_umount(const char *mnt, bool check_mnt, int flags)
return;
}

err = ksu_umount_mnt(&path, flags);
if (err) {
pr_warn("umount %s failed: %d\n", mnt, err);
}
ksu_umount_mnt(&path, flags);
}

int ksu_handle_setuid(struct cred *new, const struct cred *old)
Expand Down

0 comments on commit b126a91

Please sign in to comment.