kernel: fixup sucompat

* For whatever reason, sh is ksud.

Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
This commit is contained in:
rsuntk
2025-07-22 22:14:22 +07:00
committed by ShirkNeko
parent cf50966952
commit 39811e311f

View File

@@ -25,9 +25,7 @@
#define SU_PATH "/system/bin/su" #define SU_PATH "/system/bin/su"
#define SH_PATH "/system/bin/sh" #define SH_PATH "/system/bin/sh"
static const char sh_path[] = SH_PATH;
static const char su[] = SU_PATH; static const char su[] = SU_PATH;
static const char ksud_path[] = KSUD_PATH;
extern void escape_to_root(); 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) static inline char __user *sh_user_path(void)
{ {
const char sh_path[] = SH_PATH;
return userspace_stack_buffer(sh_path, sizeof(sh_path)); return userspace_stack_buffer(sh_path, sizeof(sh_path));
} }
static inline char __user *ksud_user_path(void) static inline char __user *ksud_user_path(void)
{ {
const char ksud_path[] = KSUD_PATH;
return userspace_stack_buffer(ksud_path, sizeof(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) int *__never_use_flags)
{ {
struct filename *filename; struct filename *filename;
const char sh[] = KSUD_PATH;
#ifndef CONFIG_KSU_KPROBES_HOOK #ifndef CONFIG_KSU_KPROBES_HOOK
if (!ksu_sucompat_hook_state) { if (!ksu_sucompat_hook_state) {
return 0; return 0;