Run throne_tracker() in kthread instead of blocking the caller.
Prevents full lockup during installation and removing the manager.
First run remains synchronous for compatibility purposes (FDE, FBEv1, FBEv2)
Features:
- run track_throne() in a kthread after the first synchronous run
- prevent duplicate thread creation with a single-instance check
- spinlock-on-d_lock based polling adressing possible race conditions.
Race conditions adressed
- single instance kthread lock, smp_mb()
- is_manager_apk, apk, spinlock-on-d_lock based polling
This is a squash of:
https://github.com/tiann/KernelSU/pull/2632
Rebased on top of
https://github.com/tiann/KernelSU/pull/2757
Original skeleton based on:
`kernelsu: move throne_tracker() to kthread`
`kernelsu: check locking before accessing files and dirs during searching manager`
`kernelsu: look for manager UID in /data/system/packages.list, not /data/system/packages.list.tmp`
0b05e927...8783badd
Co-Authored-By: backslashxx <118538522+backslashxx@users.noreply.github.com>
Co-Authored-By: Yaroslav Zviezda <10716792+acroreiser@users.noreply.github.com>
Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
17 lines
249 B
C
17 lines
249 B
C
#ifndef __KSU_H_KSUD
|
|
#define __KSU_H_KSUD
|
|
|
|
#include <linux/types.h>
|
|
|
|
#define KSUD_PATH "/data/adb/ksud"
|
|
|
|
void on_post_fs_data(void);
|
|
|
|
bool ksu_is_safe_mode(void);
|
|
|
|
extern u32 ksu_devpts_sid;
|
|
|
|
extern void escape_to_root(bool do_check_first);
|
|
|
|
#endif
|