kernel: Prune allowlist only after boot completed

For unknown reason, packages.list is not reliable during boot for oplus
devices, so we have to disable pruning and re-run pruning after boot.
This commit is contained in:
Wang Han
2025-11-12 21:43:02 +08:00
committed by ShirkNeko
parent 906c4bdb01
commit 01ac06c3fd
5 changed files with 15 additions and 3 deletions

View File

@@ -427,7 +427,7 @@ static bool is_uid_exist(uid_t uid, char *package, void *data)
return exist;
}
void track_throne(void)
void track_throne(bool prune_only)
{
struct list_head uid_list;
struct uid_data *np, *n;
@@ -504,6 +504,9 @@ void track_throne(void)
}
uid_ready:
if (prune_only)
goto prune;
// first, check if manager_uid exist!
list_for_each_entry(np, &uid_list, list) {
if (np->uid == current_manager_uid) {
@@ -547,6 +550,7 @@ uid_ready:
pr_info("Manager search finished\n");
}
prune:
// then prune the allowlist
ksu_prune_allowlist(is_uid_exist, &uid_list);
out: