Skip to content

Commit 3ed95bc

Browse files
committed
kernel: keep legacy throne tracker as an option
This commit restores older throne tracker that uses packages.list scanning to track app UIDs. It's intended for ultra-legacy Linux 3.X kernels that experience deadlocks or crashes with the newer implementation due to issues in user_data_actor(). We have to remember that the whole iterate_dir, and filldir subsystem is way different on 3.X. Changes: - CONFIG_KSU_THRONE_TRACKER_LEGACY in Kconfig - conditional compilation in Makefile - throne_tracker_legacy.c which keeps the old implementation Enable this option if newer throne tracker (tiann#2757) crashes on you. Signed-off-by: backslashxx <[email protected]>
1 parent 65a2675 commit 3ed95bc

File tree

3 files changed

+434
-1
lines changed

3 files changed

+434
-1
lines changed

kernel/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ config KSU
77
help
88
Enable kernel-level root privileges on Android System.
99

10+
config KSU_THRONE_TRACKER_LEGACY
11+
bool "Use legacy throne tracker (packages.list scanning)"
12+
depends on KSU
13+
default n
14+
help
15+
Use legacy throne tracker that scans packages.list for app UIDs.
16+
This is kept for Ultra-Legacy Linux 3.X kernels which are prone to deadlocks.
17+
Enable this if default scanning deadlocks/crashes on you.
18+
1019
config KSU_DEBUG
1120
bool "KernelSU debug mode"
1221
depends on KSU

kernel/Makefile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ kernelsu-objs := ksu.o
22
kernelsu-objs += allowlist.o
33
kernelsu-objs += apk_sign.o
44
kernelsu-objs += sucompat.o
5-
kernelsu-objs += throne_tracker.o
65
kernelsu-objs += core_hook.o
76
kernelsu-objs += ksud.o
87
kernelsu-objs += embed_ksud.o
@@ -11,6 +10,21 @@ kernelsu-objs += kernel_compat.o
1110
kernelsu-objs += selinux/selinux.o
1211
kernelsu-objs += selinux/sepolicy.o
1312
kernelsu-objs += selinux/rules.o
13+
14+
#ifeq ($(shell [ $(VERSION) -lt 4 ] && echo $$?),0)
15+
#kernelsu-objs += throne_tracker_legacy.o
16+
#else
17+
#kernelsu-objs += throne_tracker.o
18+
#endif
19+
20+
ifeq ($(CONFIG_KSU_THRONE_TRACKER_LEGACY),y)
21+
$(info -- KernelSU/compat: using legacy throne tracker)
22+
kernelsu-objs += throne_tracker_legacy.o
23+
else
24+
$(info -- KernelSU/compat: using new throne tracker)
25+
kernelsu-objs += throne_tracker.o
26+
endif
27+
1428
ccflags-y += -I$(srctree)/security/selinux -I$(srctree)/security/selinux/include
1529
ccflags-y += -I$(objtree)/security/selinux -include $(srctree)/include/uapi/asm-generic/errno.h
1630

0 commit comments

Comments
 (0)