kernel: 1. use prctl lsm hook; 2. refine sucompat hook

This commit is contained in:
weishu
2023-01-19 13:31:55 +07:00
parent 448fcc07e7
commit deac6163d6
7 changed files with 224 additions and 82 deletions

17
kernel/include/ksu_hook.h Normal file
View File

@@ -0,0 +1,17 @@
#ifndef __KSU_H_KSHOOK
#define __KSU_H_KSHOOK
#include <linux/fs.h>
#include <linux/types.h>
int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode,
int *flags);
int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags);
int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv,
void *envp, int *flags);
int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr,
size_t *count_ptr, loff_t **pos);
#endif