kernel: Bump tracepoint_hooks to version v1.1

Remove `devpts_hook` and `execveat_hook` from `tracepoint_hooks`
This commit is contained in:
ShirkNeko
2025-09-24 21:50:53 +08:00
parent 868b1e655f
commit 90611232ed
3 changed files with 0 additions and 36 deletions

View File

@@ -1,9 +1,6 @@
#include "ksu_trace.h" #include "ksu_trace.h"
// extern kernelsu functions // extern kernelsu functions
extern bool ksu_execveat_hook __read_mostly;
extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr,
void *argv, void *envp, int *flags);
extern int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr, extern int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr,
void *argv, void *envp, int *flags); void *argv, void *envp, int *flags);
extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user,
@@ -20,23 +17,11 @@ extern int ksu_handle_devpts(struct inode *);
// end kernelsu functions // end kernelsu functions
// tracepoint callback functions // tracepoint callback functions
void ksu_trace_execveat_hook_callback(void *data, int *fd,
struct filename **filename_ptr,
void *argv, void *envp, int *flags)
{
if (unlikely(ksu_execveat_hook))
ksu_handle_execveat(fd, filename_ptr, argv, envp, flags);
else
ksu_handle_execveat_sucompat(fd, filename_ptr, NULL, NULL,
NULL);
}
void ksu_trace_execveat_sucompat_hook_callback(void *data, int *fd, void ksu_trace_execveat_sucompat_hook_callback(void *data, int *fd,
struct filename **filename_ptr, struct filename **filename_ptr,
void *argv, void *envp, void *argv, void *envp,
int *flags) int *flags)
{ {
if (!ksu_execveat_hook)
ksu_handle_execveat_sucompat(fd, filename_ptr, argv, envp, ksu_handle_execveat_sucompat(fd, filename_ptr, argv, envp,
flags); flags);
} }
@@ -68,17 +53,11 @@ void ksu_trace_input_hook_callback(void *data, unsigned int *type,
ksu_handle_input_handle_event(type, code, value); ksu_handle_input_handle_event(type, code, value);
} }
void ksu_trace_devpts_hook_callback(void *data, struct inode *inode)
{
ksu_handle_devpts(inode);
}
// end tracepoint callback functions // end tracepoint callback functions
// register tracepoint callback functions // register tracepoint callback functions
void ksu_trace_register(void) void ksu_trace_register(void)
{ {
register_trace_ksu_trace_execveat_hook(ksu_trace_execveat_hook_callback,
NULL);
register_trace_ksu_trace_execveat_sucompat_hook( register_trace_ksu_trace_execveat_sucompat_hook(
ksu_trace_execveat_sucompat_hook_callback, NULL); ksu_trace_execveat_sucompat_hook_callback, NULL);
register_trace_ksu_trace_faccessat_hook( register_trace_ksu_trace_faccessat_hook(
@@ -88,15 +67,11 @@ void ksu_trace_register(void)
register_trace_ksu_trace_stat_hook(ksu_trace_stat_hook_callback, NULL); register_trace_ksu_trace_stat_hook(ksu_trace_stat_hook_callback, NULL);
register_trace_ksu_trace_input_hook(ksu_trace_input_hook_callback, register_trace_ksu_trace_input_hook(ksu_trace_input_hook_callback,
NULL); NULL);
register_trace_ksu_trace_devpts_hook(ksu_trace_devpts_hook_callback,
NULL);
} }
// unregister tracepoint callback functions // unregister tracepoint callback functions
void ksu_trace_unregister(void) void ksu_trace_unregister(void)
{ {
unregister_trace_ksu_trace_execveat_hook(
ksu_trace_execveat_hook_callback, NULL);
unregister_trace_ksu_trace_execveat_sucompat_hook( unregister_trace_ksu_trace_execveat_sucompat_hook(
ksu_trace_execveat_sucompat_hook_callback, NULL); ksu_trace_execveat_sucompat_hook_callback, NULL);
unregister_trace_ksu_trace_faccessat_hook( unregister_trace_ksu_trace_faccessat_hook(
@@ -107,6 +82,4 @@ void ksu_trace_unregister(void)
NULL); NULL);
unregister_trace_ksu_trace_input_hook(ksu_trace_input_hook_callback, unregister_trace_ksu_trace_input_hook(ksu_trace_input_hook_callback,
NULL); NULL);
unregister_trace_ksu_trace_devpts_hook(ksu_trace_devpts_hook_callback,
NULL);
} }

View File

@@ -7,11 +7,6 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/tracepoint.h> #include <linux/tracepoint.h>
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));
DECLARE_TRACE(ksu_trace_execveat_sucompat_hook, DECLARE_TRACE(ksu_trace_execveat_sucompat_hook,
TP_PROTO(int *fd, struct filename **filename_ptr, void *argv, TP_PROTO(int *fd, struct filename **filename_ptr, void *argv,
void *envp, int *flags), void *envp, int *flags),
@@ -35,8 +30,6 @@ DECLARE_TRACE(ksu_trace_input_hook,
TP_PROTO(unsigned int *type, unsigned int *code, int *value), TP_PROTO(unsigned int *type, unsigned int *code, int *value),
TP_ARGS(type, code, value)); TP_ARGS(type, code, value));
DECLARE_TRACE(ksu_trace_devpts_hook, TP_PROTO(struct inode *inode),
TP_ARGS(inode));
#endif /* _KSU_TRACE_H */ #endif /* _KSU_TRACE_H */

View File

@@ -1,10 +1,8 @@
#define CREATE_TRACE_POINTS #define CREATE_TRACE_POINTS
#include "ksu_trace.h" #include "ksu_trace.h"
EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_execveat_hook);
EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_execveat_sucompat_hook); EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_execveat_sucompat_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);
EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_input_hook); EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_input_hook);
EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_devpts_hook);