Skip to content

Commit

Permalink
libbpfgo: mitigate tc error messages
Browse files Browse the repository at this point in the history
This is a workaround for the following issue:

$ sudo ./dist/tracee-ebpf -o format:json -o option:parse-arguments -o
    option:detect-syscall -trace comm=bash -trace follow -trace
    event=net_packet -trace net=docker0 -capture net=docker0

libbpf: Kernel error message: Exclusivity flag on, cannot modify
libbpf: Kernel error message: Exclusivity flag on, cannot modify

Discussed at https://www.spinics.net/lists/bpf/msg44842.html without
conclusions.
  • Loading branch information
rafaeldtinoco committed Jun 14, 2022
1 parent dc6a519 commit b694513
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions libbpfgo.go
Expand Up @@ -36,6 +36,16 @@ int libbpf_print_fn(enum libbpf_print_level level, const char *format,
if (level != LIBBPF_WARN)
return 0;
// BUG: https://github.com/aquasecurity/tracee/issues/1676
va_list check; va_copy(check, args);
char *str = va_arg(check, char *);
if (strstr(str, "Exclusivity flag on") != NULL) {
va_end(check);
return 0;
}
va_end(check);
return vfprintf(stderr, format, args);
}
Expand Down

0 comments on commit b694513

Please sign in to comment.