kernel: slightly polish up code

This commit is contained in:
Rifat Azad
2024-12-16 02:42:33 +06:00
parent f2fcb3687b
commit a545a3e81c
2 changed files with 3 additions and 3 deletions

View File

@@ -521,13 +521,15 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old)
#endif
}
// check old process's selinux context, if it is not zygote, ignore it!
// because some su apps may setuid to untrusted_app but they are in global mount namespace
// when we umount for such process, that is a disaster!
bool is_zygote_child = is_zygote(old->security);
if (!is_zygote_child) {
pr_info("handle umount ignore non zygote child: %d\n",
current->pid);
return 0;
}
#ifdef CONFIG_KSU_DEBUG
// umount the target mnt
pr_info("handle umount for uid: %d, pid: %d\n", new_uid.val,

View File

@@ -362,5 +362,3 @@ void ksu_sucompat_exit()
unregister_kprobe(&pts_unix98_lookup_kp);
#endif
}