kernel: try introduce like susfs's method to fix prctl delay
Co-authored-by: AlexLiuDev233 <wzylin11@outlook.com>
This commit is contained in:
@@ -471,6 +471,9 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
||||
u32 *result = (u32 *)arg5;
|
||||
u32 reply_ok = KERNEL_SU_OPTION;
|
||||
uid_t current_uid_val = current_uid().val;
|
||||
if (likely(ksu_is_current_proc_umounted())) { // prevent side channel attack in ksu side
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_KSU_MANUAL_SU
|
||||
is_manual_su_cmd = (arg2 == CMD_SU_ESCALATION_REQUEST ||
|
||||
@@ -1082,6 +1085,10 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old)
|
||||
// try umount ksu temp path
|
||||
try_umount("/debug_ramdisk", false, MNT_DETACH);
|
||||
|
||||
get_task_struct(current); // delay fix
|
||||
ksu_set_current_proc_umounted();
|
||||
put_task_struct(current);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user