mirror of
https://github.com/h3xduck/TripleCross.git
synced 2025-12-26 03:13:07 +08:00
[BUILD FAILING] Checkpoint for backup, added new hook for file system, tweaked makefile for real kernel header files inclusion, still not working. Commiting for periodic backup
This commit is contained in:
@@ -8,32 +8,16 @@
|
||||
#include "xdp_filter.skel.h"
|
||||
|
||||
//Connections
|
||||
int attach_kprobe__64_compat_sys_read(struct xdp_filter_bpf *skel){
|
||||
skel->links.kprobe__64_compat_sys_read = bpf_program__attach(skel->progs.kprobe__64_compat_sys_read);
|
||||
return libbpf_get_error(skel->links.kprobe__64_compat_sys_read);
|
||||
}
|
||||
|
||||
int attach_kprobe__64_sys_read(struct xdp_filter_bpf *skel){
|
||||
skel->links.kprobe__64_sys_read = bpf_program__attach(skel->progs.kprobe__64_sys_read);
|
||||
return libbpf_get_error(skel->links.kprobe__64_sys_read);
|
||||
}
|
||||
|
||||
int attach_fs_all(struct xdp_filter_bpf *skel){
|
||||
return attach_kprobe__64_compat_sys_read(skel) |
|
||||
attach_kprobe__64_sys_read(skel);
|
||||
return attach_kprobe__64_sys_read(skel);
|
||||
}
|
||||
|
||||
|
||||
//Disconnections
|
||||
int detach_kprobe__64_compat_sys_read(struct xdp_filter_bpf *skel){
|
||||
int err = detach_link_generic(skel->links.kprobe__64_compat_sys_read);
|
||||
if(err<0){
|
||||
fprintf(stderr, "Failed to detach fs link\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int detach_kprobe__64_sys_read(struct xdp_filter_bpf *skel){
|
||||
int err = detach_link_generic(skel->links.kprobe__64_sys_read);
|
||||
if(err<0){
|
||||
@@ -44,8 +28,7 @@ int detach_kprobe__64_sys_read(struct xdp_filter_bpf *skel){
|
||||
}
|
||||
|
||||
int detach_fs_all(struct xdp_filter_bpf *skel){
|
||||
return detach_kprobe__64_compat_sys_read(skel) ||
|
||||
detach_kprobe__64_sys_read(skel);
|
||||
return detach_kprobe__64_sys_read(skel);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -56,7 +56,6 @@ int setup_all_modules(){
|
||||
if(config.fs_module.all == ON){
|
||||
ret = attach_fs_all(attr.skel);
|
||||
}else{
|
||||
if(config.fs_module.kprobe__64_compat_sys_read == ON) ret = attach_kprobe__64_compat_sys_read(attr.skel);
|
||||
if(config.fs_module.kprobe__64_sys_read == ON) ret = attach_kprobe__64_sys_read(attr.skel);
|
||||
}
|
||||
if(ret!=0) return -1;
|
||||
|
||||
Reference in New Issue
Block a user