9asmlinkage long (*
__orig_stat)(
const struct pt_regs *) = NULL;
13asmlinkage
long notrace
openat_hook(
const struct pt_regs *regs) {
14 const char __user *u_path = (
const char __user *)regs->si;
20asmlinkage
long notrace
stat_hook(
const struct pt_regs *regs) {
21 const char __user *u_path = NULL;
23 switch ((
int)regs->orig_ax) {
26 u_path = (
const char __user *)regs->di;
29 u_path = (
const char __user *)regs->si;
32 int fd = (int)regs->di;
33 struct file *filp = fget(fd);
37 struct path p = filp->f_path;
40 char *full = d_path(&p, buf_path,
sizeof(buf_path));
54 switch ((
int)regs->orig_ax) {
66asmlinkage
long notrace
chdir_hook(
const struct pt_regs *regs) {
67 const char __user *u_path = (
const char __user *)regs->di;
74 long request = regs->di;
79 if (request == PTRACE_ATTACH || request == PTRACE_TRACEME || request == PTRACE_DETACH) {
static struct dentry * file
asmlinkage long(* __orig_chdir)(const struct pt_regs *regs)
asmlinkage void notrace ptrace_hook(struct pt_regs *regs)
asmlinkage long notrace chdir_hook(const struct pt_regs *regs)
asmlinkage long(* __orig_openat)(const struct pt_regs *)
asmlinkage long(* __orig_lstat)(const struct pt_regs *)
asmlinkage long(* __orig_ptrace)(const struct pt_regs *regs)
asmlinkage long(* __orig_newfstatat)(const struct pt_regs *)
asmlinkage long notrace stat_hook(const struct pt_regs *regs)
asmlinkage long(* __orig_fstat)(const struct pt_regs *)
asmlinkage long(* __orig_stat)(const struct pt_regs *)
asmlinkage long notrace openat_hook(const struct pt_regs *regs)
int forbid_contains(const char __user *u_path)
int forbid_contains_str(const char *k_path)