kernel: Resolve compilation issues
This commit is contained in:
@@ -33,23 +33,10 @@ config KPM
|
||||
select KALLSYMS
|
||||
select KALLSYMS_ALL
|
||||
|
||||
choice
|
||||
prompt "KernelSU hook type"
|
||||
depends on KSU
|
||||
default KSU_TRACEPOINT_HOOK
|
||||
|
||||
config KSU_TRACEPOINT_HOOK
|
||||
bool "Hook KernelSU with Tracepoint"
|
||||
depends on HAVE_SYSCALL_TRACEPOINTS
|
||||
help
|
||||
If enabled, Hook required KernelSU syscalls with Tracepoint.
|
||||
|
||||
config KSU_MANUAL_HOOK
|
||||
bool "Hook KernelSU manually"
|
||||
depends on KSU != m
|
||||
help
|
||||
If enabled, Hook required KernelSU syscalls with manually-patched function.
|
||||
|
||||
endchoice
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -119,12 +119,13 @@ ccflags-y += -DKSU_MANAGER_PACKAGE=\"$(KSU_MANAGER_PACKAGE)\"
|
||||
$(info -- SukiSU Manager package name: $(KSU_MANAGER_PACKAGE))
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_KSU_TRACEPOINT_HOOK), y)
|
||||
$(info -- SukiSU: KSU_TRACEPOINT_HOOK)
|
||||
ccflags-y += -DKSU_HAVE_SYSCALL_TRACEPOINTS_HOOK
|
||||
else ifeq ($(CONFIG_KSU_MANUAL_HOOK), y)
|
||||
$(info -- SukiSU: KSU_MANUAL_HOOK)
|
||||
ifeq ($(CONFIG_KSU_MANUAL_HOOK), y)
|
||||
ccflags-y += -DKSU_MANUAL_HOOK
|
||||
$(info -- SukiSU: KSU_MANUAL_HOOK)
|
||||
else
|
||||
ccflags-y += -DKSU_HAVE_SYSCALL_TRACEPOINTS_HOOK
|
||||
ccflags-y += -DKSU_KPROBES_HOOK
|
||||
$(info -- SukiSU: KSU_TRACEPOINT_HOOK)
|
||||
endif
|
||||
|
||||
KERNEL_VERSION := $(VERSION).$(PATCHLEVEL)
|
||||
|
||||
@@ -588,7 +588,7 @@ void ksu_temp_revoke_root_once(uid_t uid)
|
||||
strcpy(profile.rp_config.profile.selinux_domain, KSU_DEFAULT_SELINUX_DOMAIN);
|
||||
|
||||
ksu_set_app_profile(&profile, false);
|
||||
persistent_allow_list();
|
||||
save_allow_list();
|
||||
pr_info("pending_root: UID=%d removed and persist updated\n", uid);
|
||||
}
|
||||
#endif
|
||||
@@ -6,12 +6,6 @@
|
||||
#include "ss/policydb.h"
|
||||
#include "linux/key.h"
|
||||
|
||||
#if defined(CONFIG_KPROBES) && !defined(KSU_MANUAL_HOOK)
|
||||
#define KSU_KPROBES_HOOK 1
|
||||
#else
|
||||
#define KSU_KPROBES_HOOK 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Adapt to Huawei HISI kernel without affecting other kernels ,
|
||||
* Huawei Hisi Kernel EBITMAP Enable or Disable Flag ,
|
||||
|
||||
12
kernel/ksu.c
12
kernel/ksu.c
@@ -17,6 +17,14 @@
|
||||
#include "ksud.h"
|
||||
#include "supercalls.h"
|
||||
|
||||
|
||||
static struct workqueue_struct *ksu_workqueue;
|
||||
|
||||
bool ksu_queue_work(struct work_struct *work)
|
||||
{
|
||||
return queue_work(ksu_workqueue, work);
|
||||
}
|
||||
|
||||
int __init kernelsu_init(void)
|
||||
{
|
||||
#ifdef CONFIG_KSU_DEBUG
|
||||
@@ -35,6 +43,8 @@ int __init kernelsu_init(void)
|
||||
|
||||
ksu_core_init();
|
||||
|
||||
ksu_workqueue = alloc_ordered_workqueue("kernelsu_work_queue", 0);
|
||||
|
||||
ksu_allowlist_init();
|
||||
|
||||
ksu_throne_tracker_init();
|
||||
@@ -62,6 +72,8 @@ void kernelsu_exit(void)
|
||||
|
||||
ksu_throne_tracker_exit();
|
||||
|
||||
destroy_workqueue(ksu_workqueue);
|
||||
|
||||
#ifdef KSU_KPROBES_HOOK
|
||||
ksu_ksud_exit();
|
||||
ksu_sucompat_exit();
|
||||
|
||||
@@ -95,6 +95,8 @@ struct app_profile {
|
||||
};
|
||||
};
|
||||
|
||||
bool ksu_queue_work(struct work_struct *work);
|
||||
|
||||
static inline int startswith(char *s, char *prefix)
|
||||
{
|
||||
return strncmp(s, prefix, strlen(prefix));
|
||||
|
||||
Reference in New Issue
Block a user