Skip to content

Commit 6f4b331

Browse files
committed
kernel: throne_tracker: escpae_to_root on kthread
for: tiann#2757 requires 684cb70
1 parent 684cb70 commit 6f4b331

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

kernel/throne_tracker.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "allowlist.h"
1212
#include "klog.h" // IWYU pragma: keep
1313
#include "ksu.h"
14+
#include "ksud.h"
1415
#include "manager.h"
1516
#include "throne_tracker.h"
1617
#include "kernel_compat.h"
@@ -657,6 +658,10 @@ static void track_throne_function()
657658
static int throne_tracker_thread(void *data)
658659
{
659660
pr_info("%s: pid: %d started\n", __func__, current->pid);
661+
// for the kthread, we need to escape to root
662+
// since it does not inherit the caller's context.
663+
// this runs as root but without the capabilities, so call it with false
664+
escape_to_root(false);
660665
track_throne_function();
661666
throne_thread = NULL;
662667
smp_mb();

0 commit comments

Comments
 (0)