diff --git a/ebpf_prog/README b/ebpf_prog/README index 08d930c0..119ea487 100644 --- a/ebpf_prog/README +++ b/ebpf_prog/README @@ -16,4 +16,14 @@ cd ../../../daemon --opensnitchd expects to find opensnitch.o in /etc/opensnitchd/ --start opensnitchd with: -opensnitchd -rules-path /etc/opensnitchd/rules -process-monitor-method ebpf \ No newline at end of file +opensnitchd -rules-path /etc/opensnitchd/rules -process-monitor-method ebpf + +The kernel where you intend to run it must have some options activated: + +$ grep BPF /boot/config-$(uname -r) +CONFIG_CGROUP_BPF=y +CONFIG_BPF=y +CONFIG_BPF_SYSCALL=y +CONFIG_BPF_EVENTS=y +CONFIG_KPROBES=y +CONFIG_KPROBE_EVENTS=y diff --git a/ebpf_prog/arm-clang-asm-fix.patch b/ebpf_prog/arm-clang-asm-fix.patch new file mode 100644 index 00000000..d8dd3945 --- /dev/null +++ b/ebpf_prog/arm-clang-asm-fix.patch @@ -0,0 +1,14 @@ +--- ../../arch/arm/include/asm/unified.h 2021-04-20 10:47:54.075834124 +0000 ++++ ../../arch/arm/include/asm/unified-clang-fix.h 2021-04-20 10:47:38.943811970 +0000 +@@ -11,7 +11,10 @@ + #if defined(__ASSEMBLY__) + .syntax unified + #else +-__asm__(".syntax unified"); ++//__asm__(".syntax unified"); ++#ifndef __clang__ ++ __asm__(".syntax unified"); ++#endif + #endif + + #ifdef CONFIG_CPU_V7M