Commit c5955bc2 authored by Hongtao Lyu's avatar Hongtao Lyu
Browse files

update change

parent 58049168
......@@ -1163,10 +1163,12 @@ EXPORT_SYMBOL(file_open_root);
///////////////////////////////////change start:
int flag_openat_sBPF = 0;
const char* (*sBPF_hook_openat_prog)(const char * filename, int flag) = NULL;
void (*sBPF_hook_openat_prog_fixup)(void)=NULL;
int print_flag = 0;
EXPORT_SYMBOL(flag_openat_sBPF);
EXPORT_SYMBOL(sBPF_hook_openat_prog);
EXPORT_SYMBOL(sBPF_hook_openat_prog_fixup);
EXPORT_SYMBOL(print_flag);
//////////////////////////////////change end
......@@ -1198,7 +1200,7 @@ static long do_sys_openat2(int dfd, const char __user *filename,
print_flag = 1;
}
////////////////////////////////////
//////////////////////////////////// end
if (IS_ERR(tmp))
return PTR_ERR(tmp);
......@@ -1214,6 +1216,13 @@ static long do_sys_openat2(int dfd, const char __user *filename,
}
}
putname(tmp);
//////////////////////////////// start
if(flag_openat_sBPF==1){
sBPF_hook_openat_prog_fixup();
}
//////////////////////////////// end
return fd;
}
......
......@@ -93,8 +93,10 @@ extern int sysctl_protected_regular;
extern int flag_openat_sBPF;
extern const char* (*sBPF_hook_openat_prog)(const char * filename, int flag);
extern void(*sBPF_hook_openat_prog_fixup)(void);
extern int print_flag;
/////////////////////////////////
typedef __kernel_rwf_t rwf_t;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment