kernel: Revert partial changes
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
// extern kernelsu functions
|
// 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 int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, int *flags);
|
||||||
extern bool ksu_vfs_read_hook __read_mostly;
|
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);
|
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
|
// 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)
|
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,
|
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
|
// register tracepoint callback functions
|
||||||
void ksu_trace_register(void)
|
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_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_sys_read_hook(ksu_trace_sys_read_hook_callback, NULL);
|
||||||
register_trace_ksu_trace_stat_hook(ksu_trace_stat_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
|
// unregister tracepoint callback functions
|
||||||
void ksu_trace_unregister(void)
|
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_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_sys_read_hook(ksu_trace_sys_read_hook_callback, NULL);
|
||||||
unregister_trace_ksu_trace_stat_hook(ksu_trace_stat_hook_callback, NULL);
|
unregister_trace_ksu_trace_stat_hook(ksu_trace_stat_hook_callback, NULL);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/tracepoint.h>
|
#include <linux/tracepoint.h>
|
||||||
|
|
||||||
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_PROTO(int *fd, struct filename **filename_ptr, void *argv, void *envp, int *flags),
|
||||||
TP_ARGS(fd, filename_ptr, argv, envp, flags));
|
TP_ARGS(fd, filename_ptr, argv, envp, flags));
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#define CREATE_TRACE_POINTS
|
#define CREATE_TRACE_POINTS
|
||||||
#include "ksu_trace.h"
|
#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_faccessat_hook);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_sys_read_hook);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_sys_read_hook);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_stat_hook);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_stat_hook);
|
||||||
|
|||||||
@@ -126,26 +126,9 @@ int ksu_handle_execve_sucompat(int *fd, const char __user **filename_user,
|
|||||||
void *__never_use_argv, void *__never_use_envp,
|
void *__never_use_argv, void *__never_use_envp,
|
||||||
int *__never_use_flags)
|
int *__never_use_flags)
|
||||||
{
|
{
|
||||||
char path[sizeof(su)];
|
|
||||||
|
|
||||||
if (!is_su_allowed((const void *)filename_user))
|
if (!is_su_allowed((const void *)filename_user))
|
||||||
return 0;
|
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);
|
return ksu_sucompat_user_common(filename_user, "sys_execve", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user