mirror of
https://github.com/tiann/KernelSU.git
synced 2025-02-20 11:43:32 +08:00
Some checks failed
Build Manager / build-lkm (push) Waiting to run
Build Manager / build-ksud (macos-latest, aarch64-apple-darwin) (push) Blocked by required conditions
Build Manager / build-ksud (macos-latest, x86_64-apple-darwin) (push) Blocked by required conditions
Build Manager / build-ksud (ubuntu-latest, aarch64-linux-android) (push) Blocked by required conditions
Build Manager / build-ksud (ubuntu-latest, aarch64-unknown-linux-musl) (push) Blocked by required conditions
Build Manager / build-ksud (ubuntu-latest, x86_64-linux-android) (push) Blocked by required conditions
Build Manager / build-ksud (ubuntu-latest, x86_64-pc-windows-gnu) (push) Blocked by required conditions
Build Manager / build-ksud (ubuntu-latest, x86_64-unknown-linux-musl) (push) Blocked by required conditions
Build Manager / build-manager (push) Blocked by required conditions
Build Kernel - Android 12 / build-kernel (2024-05, 209) (push) Has been cancelled
Build Kernel - Android 12 / build-kernel (2024-08, 218) (push) Has been cancelled
Build Kernel - Android 12 / build-kernel (2024-11, 226) (push) Has been cancelled
Build Kernel - Android 12 / check-build-kernel (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-05, 148, 5.15) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-05, 209, 5.10) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-06, 210, 5.10) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-07, 149, 5.15) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-07, 214, 5.10) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-08, 151, 5.15) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-08, 218, 5.10) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-09, 153, 5.15) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-11, 167, 5.15) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-11, 223, 5.10) (push) Has been cancelled
Build Kernel - Android 13 / check-build-kernel (2024-11, 167, 5.15) (push) Has been cancelled
Build Kernel - Android 13 / check-build-kernel (2024-11, 223, 5.10) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-05, 148, 5.15) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-05, 75, 6.1) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-06, 149, 5.15) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-06, 78, 6.1) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-07, 153, 5.15) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-07, 84, 6.1) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-08, 158, 5.15) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-08, 90, 6.1) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-09, 164, 5.15) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-09, 93, 6.1) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-10, 99, 6.1) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-11, 112, 6.1) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-11, 167, 5.15) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-12, 115, 6.1) (push) Has been cancelled
Build Kernel - Android 14 / check-build-kernel (2024-11, 167, 5.15) (push) Has been cancelled
Build Kernel - Android 14 / check-build-kernel (2024-12, 115, 6.1) (push) Has been cancelled
Build Kernel - Android 15 / build-kernel (2024-08, 30, 6.6) (push) Has been cancelled
Build Kernel - Android 15 / build-kernel (2024-09, 46, 6.6) (push) Has been cancelled
Build Kernel - Android 15 / build-kernel (2024-10, 50, 6.6) (push) Has been cancelled
Build Kernel - Android 15 / build-kernel (2024-11, 56, 6.6) (push) Has been cancelled
Build Kernel - Android 15 / build-kernel (2024-12, 57, 6.6) (push) Has been cancelled
Build Kernel - Android 15 / check-build-kernel (2024-12, 57, 6.6) (push) Has been cancelled
Build Kernel - ChromeOS ARCVM / Build ChromeOS ARCVM kernel (arm64, build.config.gki.aarch64, arm64_arcvm_defconfig, Image) (push) Has been cancelled
Build Kernel - ChromeOS ARCVM / Build ChromeOS ARCVM kernel (x86_64, build.config.gki.x86_64, x86_64_arcvm_defconfig, bzImage) (push) Has been cancelled
Build Kernel - AVD / build-kernel (aarch64, android-15-avd_aarch64.xml, android-15-avd_aarch64) (push) Has been cancelled
Build Kernel - AVD / build-kernel (x86_64, android-14-avd_x86_64.xml, android-14-avd_x86_64) (push) Has been cancelled
Build Kernel - AVD / build-kernel (x86_64, android-15-avd_x86_64.xml, android-15-avd_x86_64) (push) Has been cancelled
Build Kernel - WSA / build (arm64, 5.15.104.1) (push) Has been cancelled
Build Kernel - WSA / build (arm64, 5.15.104.2) (push) Has been cancelled
Build Kernel - WSA / build (arm64, 5.15.104.3) (push) Has been cancelled
Build Kernel - WSA / build (arm64, 5.15.104.4) (push) Has been cancelled
Build Kernel - WSA / build (arm64, 5.15.94.2) (push) Has been cancelled
Build Kernel - WSA / build (x86_64, 5.15.104.1) (push) Has been cancelled
Build Kernel - WSA / build (x86_64, 5.15.104.2) (push) Has been cancelled
Build Kernel - WSA / build (x86_64, 5.15.104.3) (push) Has been cancelled
Build Kernel - WSA / build (x86_64, 5.15.104.4) (push) Has been cancelled
Build Kernel - WSA / build (x86_64, 5.15.94.2) (push) Has been cancelled
Build Kernel - WSA / check_build (arm64) (push) Has been cancelled
Build Kernel - WSA / check_build (x86_64) (push) Has been cancelled
Build Kernel - Android 12 / upload-artifacts (push) Has been cancelled
Build Kernel - Android 13 / upload-artifacts (push) Has been cancelled
Build Kernel - Android 14 / upload-artifacts (push) Has been cancelled
Build Kernel - Android 15 / upload-artifacts (push) Has been cancelled
92 lines
2.3 KiB
C
92 lines
2.3 KiB
C
#include <linux/export.h>
|
|
#include <linux/fs.h>
|
|
#include <linux/kobject.h>
|
|
#include <linux/module.h>
|
|
#include <linux/workqueue.h>
|
|
|
|
#include "allowlist.h"
|
|
#include "arch.h"
|
|
#include "core_hook.h"
|
|
#include "klog.h" // IWYU pragma: keep
|
|
#include "ksu.h"
|
|
#include "throne_tracker.h"
|
|
|
|
static struct workqueue_struct *ksu_workqueue;
|
|
|
|
bool ksu_queue_work(struct work_struct *work)
|
|
{
|
|
return queue_work(ksu_workqueue, work);
|
|
}
|
|
|
|
extern int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr,
|
|
void *argv, void *envp, int *flags);
|
|
|
|
extern int ksu_handle_execveat_ksud(int *fd, struct filename **filename_ptr,
|
|
void *argv, void *envp, int *flags);
|
|
|
|
int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv,
|
|
void *envp, int *flags)
|
|
{
|
|
ksu_handle_execveat_ksud(fd, filename_ptr, argv, envp, flags);
|
|
return ksu_handle_execveat_sucompat(fd, filename_ptr, argv, envp,
|
|
flags);
|
|
}
|
|
|
|
extern void ksu_sucompat_init();
|
|
extern void ksu_sucompat_exit();
|
|
extern void ksu_ksud_init();
|
|
extern void ksu_ksud_exit();
|
|
|
|
int __init kernelsu_init(void)
|
|
{
|
|
#ifdef CONFIG_KSU_DEBUG
|
|
pr_alert("*************************************************************");
|
|
pr_alert("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **");
|
|
pr_alert("** **");
|
|
pr_alert("** You are running KernelSU in DEBUG mode **");
|
|
pr_alert("** **");
|
|
pr_alert("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **");
|
|
pr_alert("*************************************************************");
|
|
#endif
|
|
|
|
ksu_core_init();
|
|
|
|
ksu_workqueue = alloc_ordered_workqueue("kernelsu_work_queue", 0);
|
|
|
|
ksu_allowlist_init();
|
|
|
|
ksu_throne_tracker_init();
|
|
|
|
ksu_sucompat_init();
|
|
ksu_ksud_init();
|
|
|
|
#ifdef MODULE
|
|
#ifndef CONFIG_KSU_DEBUG
|
|
kobject_del(&THIS_MODULE->mkobj.kobj);
|
|
#endif
|
|
#endif
|
|
return 0;
|
|
}
|
|
|
|
void kernelsu_exit(void)
|
|
{
|
|
ksu_allowlist_exit();
|
|
|
|
ksu_throne_tracker_exit();
|
|
|
|
destroy_workqueue(ksu_workqueue);
|
|
|
|
ksu_ksud_exit();
|
|
ksu_sucompat_exit();
|
|
|
|
ksu_core_exit();
|
|
}
|
|
|
|
module_init(kernelsu_init);
|
|
module_exit(kernelsu_exit);
|
|
|
|
MODULE_LICENSE("GPL");
|
|
MODULE_AUTHOR("weishu");
|
|
MODULE_DESCRIPTION("Android KernelSU");
|
|
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
|