diff --git a/kernel/allowlist.c b/kernel/allowlist.c index f6d8c3c7..30eb1c10 100644 --- a/kernel/allowlist.c +++ b/kernel/allowlist.c @@ -80,7 +80,7 @@ static void ksu_grant_root_to_shell() } #endif -bool ksu_get_app_profile(struct app_profile *profile, bool query_by_uid) +bool ksu_get_app_profile(struct app_profile *profile) { struct perm_data *p = NULL; struct list_head *pos = NULL; @@ -88,10 +88,8 @@ bool ksu_get_app_profile(struct app_profile *profile, bool query_by_uid) list_for_each (pos, &allow_list) { p = list_entry(pos, struct perm_data, list); - bool uid_match = - (query_by_uid && - profile->current_uid == p->profile.current_uid); - if (uid_match || !strcmp(profile->key, p->profile.key)) { + bool uid_match = profile->current_uid == p->profile.current_uid; + if (uid_match) { // found it, override it with ours memcpy(profile, &p->profile, sizeof(*profile)); found = true; @@ -183,7 +181,7 @@ bool ksu_is_allow_uid(uid_t uid) bool ksu_is_uid_should_umount(uid_t uid) { struct app_profile profile = { .current_uid = uid }; - bool found = ksu_get_app_profile(&profile, true); + bool found = ksu_get_app_profile(&profile); if (!found) { // no app profile found, it must be non root app return default_non_root_profile.umount_modules; diff --git a/kernel/allowlist.h b/kernel/allowlist.h index ac36a84c..1ff2b907 100644 --- a/kernel/allowlist.h +++ b/kernel/allowlist.h @@ -18,7 +18,7 @@ bool ksu_get_allow_list(int *array, int *length, bool allow); void ksu_prune_allowlist(bool (*is_uid_exist)(uid_t, void *), void *data); -bool ksu_get_app_profile(struct app_profile *, bool query_by_uid); +bool ksu_get_app_profile(struct app_profile *); bool ksu_set_app_profile(struct app_profile *, bool persist); bool ksu_is_uid_should_umount(uid_t uid); diff --git a/kernel/core_hook.c b/kernel/core_hook.c index f487292d..5564ebcc 100644 --- a/kernel/core_hook.c +++ b/kernel/core_hook.c @@ -361,7 +361,7 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3, return 0; } - bool success = ksu_get_app_profile(&profile, false); + bool success = ksu_get_app_profile(&profile); if (success) { if (copy_to_user(arg3, &profile, sizeof(profile))) { pr_err("copy profile failed\n");