From 39811e311f4dda55269ee63bd01d8d55e1e58e60 Mon Sep 17 00:00:00 2001 From: rsuntk Date: Tue, 22 Jul 2025 22:14:22 +0700 Subject: [PATCH] kernel: fixup sucompat * For whatever reason, sh is ksud. Signed-off-by: rsuntk --- kernel/sucompat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/sucompat.c b/kernel/sucompat.c index e6d534fc..ff7bd785 100644 --- a/kernel/sucompat.c +++ b/kernel/sucompat.c @@ -25,9 +25,7 @@ #define SU_PATH "/system/bin/su" #define SH_PATH "/system/bin/sh" -static const char sh_path[] = SH_PATH; static const char su[] = SU_PATH; -static const char ksud_path[] = KSUD_PATH; extern void escape_to_root(); @@ -44,11 +42,13 @@ static inline void __user *userspace_stack_buffer(const void *d, size_t len) static inline char __user *sh_user_path(void) { + const char sh_path[] = SH_PATH; return userspace_stack_buffer(sh_path, sizeof(sh_path)); } static inline char __user *ksud_user_path(void) { + const char ksud_path[] = KSUD_PATH; return userspace_stack_buffer(ksud_path, sizeof(ksud_path)); } @@ -112,6 +112,7 @@ int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr, int *__never_use_flags) { struct filename *filename; + const char sh[] = KSUD_PATH; #ifndef CONFIG_KSU_KPROBES_HOOK if (!ksu_sucompat_hook_state) { return 0;