Skip to content

Commit 47ad3b8

Browse files
committed
TODO: kthread fix
for tiann#2757
1 parent f3a7b62 commit 47ad3b8

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

kernel/core_hook.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,6 @@ void escape_to_root(void)
143143
return;
144144
}
145145

146-
if (cred->euid.val == 0) {
147-
pr_warn("Already root, don't escape!\n");
148-
abort_creds(cred);
149-
return;
150-
}
151-
152146
struct root_profile *profile = ksu_get_root_profile(cred->uid.val);
153147

154148
cred->uid.val = profile->uid;

kernel/throne_tracker.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,9 @@ static void track_throne_function()
657657
static int throne_tracker_thread(void *data)
658658
{
659659
pr_info("%s: pid: %d started\n", __func__, current->pid);
660+
// for the kthread, we need to escape to root
661+
// since it does not inherit the caller's context.
662+
escape_to_root();
660663
track_throne_function();
661664
throne_thread = NULL;
662665
smp_mb();

0 commit comments

Comments
 (0)