kernel & KernelSU: Replace kabi member susfs_task_state of tast_struct and use...
kernel & KernelSU: Replace kabi member susfs_task_state of tast_struct and use tast_struct->thread_info.flags instead; Fix for sus_path not working on some OEM devices; KSU_SUSFS requires CONFIG_THREAD_INFO_IN_TASK now; - Since the kabi member is not guaranteed to be unused by OEM, that is why some deivces may conflict with the kabi member added by susfs, we should use less kabi member as much as possible. - Luckily we have task_struct->thread_info that is enabled by all gki kernels just like kprobes, so we can utilize thread_info->flags for faster check, but it needs CONFIG_THREAD_INFO_IN_TASK to be on which should always be enabled - Big thanks to fatalcoder524 (https://github.com/fatalcoder524) who did an excellent debug process for me Co-authored-by: simonpunk <simonpunk2016@gmail.com>
This commit is contained in:
@@ -1244,7 +1244,7 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old)
|
||||
// the detection, really big helps here!
|
||||
else if (new_uid.val >= 90000 && new_uid.val < 1000000 && susfs_is_umount_for_zygote_iso_service_enabled) {
|
||||
task_lock(current);
|
||||
current->susfs_task_state |= TASK_STRUCT_NON_ROOT_USER_APP_PROC;
|
||||
susfs_set_current_non_root_user_app_proc();
|
||||
task_unlock(current);
|
||||
goto out_susfs_try_umount_all;
|
||||
}
|
||||
@@ -1263,7 +1263,7 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old)
|
||||
#ifdef CONFIG_KSU_SUSFS
|
||||
else {
|
||||
task_lock(current);
|
||||
current->susfs_task_state |= TASK_STRUCT_NON_ROOT_USER_APP_PROC;
|
||||
susfs_set_current_non_root_user_app_proc();
|
||||
task_unlock(current);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user