feat: try manual reboot hook (#521)

* feat: try manual reboot hook

* refactor: move ksu_handle_reboot to supercalls.c for ShirkNeko

---------
This commit is contained in:
AlexLiuDev233
2025-11-04 01:08:49 +08:00
committed by GitHub
parent d286f49e11
commit 1853d9decf
3 changed files with 45 additions and 9 deletions

View File

@@ -69,6 +69,17 @@ static void init_uid_scanner(void)
}
}
void ksu_handle_reboot(int magic1, int magic2, void __user * arg) {
if (magic1 == KSU_INSTALL_MAGIC1 && magic2 == KSU_INSTALL_MAGIC2) {
int fd = ksu_install_fd();
pr_info("[%d] install ksu fd: %d\n", current->pid, fd);
if (copy_to_user(arg, &fd, sizeof(fd))) {
pr_err("install ksu fd reply err\n");
}
}
}
static int do_grant_root(void __user *arg)
{
// Check if current UID is allowed