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 4c04508267
commit 0c9ebb9bad
5 changed files with 15 additions and 3 deletions

View File

@@ -428,7 +428,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;
@@ -505,6 +505,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) {
@@ -548,6 +551,7 @@ uid_ready:
pr_info("Manager search finished\n");
}
prune:
// then prune the allowlist
ksu_prune_allowlist(is_uid_exist, &uid_list);
out: