diff --git a/kernel/ksu_trace.c b/kernel/ksu_trace.c index bc630c10..e4225167 100644 --- a/kernel/ksu_trace.c +++ b/kernel/ksu_trace.c @@ -2,7 +2,7 @@ // extern kernelsu functions -extern int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr, void *argv, void *envp, int *flags); +extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv, void *envp, int *flags); extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, int *flags); extern bool ksu_vfs_read_hook __read_mostly; extern int ksu_handle_sys_read(unsigned int fd, char __user **buf_ptr, size_t *count_ptr); @@ -13,10 +13,10 @@ extern int ksu_handle_input_handle_event(unsigned int *type, unsigned int *code, // tracepoint callback functions -void ksu_trace_execveat_sucompat_hook_callback(void *data, int *fd, struct filename **filename_ptr, +void ksu_trace_execveat_hook_callback(void *data, int *fd, struct filename **filename_ptr, void *argv, void *envp, int *flags) { - ksu_handle_execveat_sucompat(fd, filename_ptr, argv, envp, flags); + ksu_handle_execveat(fd, filename_ptr, argv, envp, flags); } void ksu_trace_faccessat_hook_callback(void *data, int *dfd, const char __user **filename_user, @@ -51,7 +51,7 @@ void ksu_trace_input_hook_callback(void *data, unsigned int *type, unsigned int // register tracepoint callback functions void ksu_trace_register(void) { - register_trace_ksu_trace_execveat_sucompat_hook(ksu_trace_execveat_sucompat_hook_callback, NULL); + register_trace_ksu_trace_execveat_hook(ksu_trace_execveat_hook_callback, NULL); register_trace_ksu_trace_faccessat_hook(ksu_trace_faccessat_hook_callback, NULL); register_trace_ksu_trace_sys_read_hook(ksu_trace_sys_read_hook_callback, NULL); register_trace_ksu_trace_stat_hook(ksu_trace_stat_hook_callback, NULL); @@ -61,7 +61,7 @@ void ksu_trace_register(void) // unregister tracepoint callback functions void ksu_trace_unregister(void) { - unregister_trace_ksu_trace_execveat_sucompat_hook(ksu_trace_execveat_sucompat_hook_callback, NULL); + unregister_trace_ksu_trace_execveat_hook(ksu_trace_execveat_hook_callback, NULL); unregister_trace_ksu_trace_faccessat_hook(ksu_trace_faccessat_hook_callback, NULL); unregister_trace_ksu_trace_sys_read_hook(ksu_trace_sys_read_hook_callback, NULL); unregister_trace_ksu_trace_stat_hook(ksu_trace_stat_hook_callback, NULL); diff --git a/kernel/ksu_trace.h b/kernel/ksu_trace.h index dc5394b2..06159b3c 100644 --- a/kernel/ksu_trace.h +++ b/kernel/ksu_trace.h @@ -7,7 +7,7 @@ #include #include -DECLARE_TRACE(ksu_trace_execveat_sucompat_hook, +DECLARE_TRACE(ksu_trace_execveat_hook, TP_PROTO(int *fd, struct filename **filename_ptr, void *argv, void *envp, int *flags), TP_ARGS(fd, filename_ptr, argv, envp, flags)); diff --git a/kernel/ksu_trace_export.c b/kernel/ksu_trace_export.c index afa44721..b303cbbd 100644 --- a/kernel/ksu_trace_export.c +++ b/kernel/ksu_trace_export.c @@ -1,7 +1,7 @@ #define CREATE_TRACE_POINTS #include "ksu_trace.h" -EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_execveat_sucompat_hook); +EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_execveat_hook); EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_faccessat_hook); EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_sys_read_hook); EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_stat_hook); diff --git a/kernel/sucompat.c b/kernel/sucompat.c index f1c17bb0..8f793922 100644 --- a/kernel/sucompat.c +++ b/kernel/sucompat.c @@ -126,26 +126,9 @@ int ksu_handle_execve_sucompat(int *fd, const char __user **filename_user, void *__never_use_argv, void *__never_use_envp, int *__never_use_flags) { - char path[sizeof(su)]; - if (!is_su_allowed((const void *)filename_user)) return 0; - if (ksu_copy_from_user_retry(path, *filename_user, sizeof(path)) == 0) { - - path[sizeof(path) - 1] = '\0'; - - if (memcmp(path, su, sizeof(su)) == 0) { - pr_info("do_execve_common su found\n"); - - *filename_user = ksud_user_path(); - - escape_to_root(); - - return 0; - } - } - return ksu_sucompat_user_common(filename_user, "sys_execve", true); }