Sanitizer flags an eBPF bug
Hi,
I've been playing around with eBPF and have sanitizers enabled, a "BUG: Invalid wait context" is thrown in some specific instances:
1. The eBPF program is of Tracing type
2. Ringbuf helper functions are used.
3. The program is attached to perf_event related symbols in the kernel.
I'm attaching a folder with two instances of such programs and the info dumped by the sanitizer. The attached files for each instance include:
1. bpf_prog(x).c
2. bpf_prog(x).o - object file that is compiled with "clang-16 -O2 -g -target bpf -c bpf_progx.c -o bpf_progx.o" and loaded by libbpf (v1.6)
3. trig(x).c - File in C that is compiled as a binary and when executed causes the bpf program to run
4. dump(x).txt - Sanitizer dump
5. vmlinux.h - Specific vmlinux file used in compiling the ebpf program object files
Happy to provide any other additional info that might be relevant.
Best regards,
Mahnur
Hi,
Just wondering if there is any update on this?
Best regards,
Mahnur
Quoted 19 lines · syeda-mahnur.asif
Hi,
I've been playing around with eBPF and have sanitizers enabled, a "BUG: Invalid wait context" is thrown in some specific instances:
1. The eBPF program is of Tracing type
2. Ringbuf helper functions are used.
3. The program is attached toperf_eventrelated symbols in the kernel.I'm attaching a folder with two instances of such programs and the info dumped by the sanitizer. The attached files for each instance include:
1. bpf_prog(x).c
2. bpf_prog(x).o - object file that is compiled with "clang-16 -O2 -g
-target bpf -cbpf_progx.c-o bpf_progx.o" and loaded by libbpf (v1.6)
3. trig(x).c - File in C that is compiled as a binary and when executed causes the bpf program to run
4. dump(x).txt - Sanitizer dump
5.vmlinux.h- Specific vmlinux file used in compiling the ebpf program object filesHappy to provide any other additional info that might be relevant.
Best regards,
Mahnur
Hi,
I would like to disclose this at a conference in a few weeks, and it would be great if there is any confirmation / update on this?
Best regards,
Mahnur
Quoted 27 lines · syeda-mahnur.asif
Hi,
Just wondering if there is any update on this?
Best regards,
MahnurQuoted 19 lines · syeda-mahnur.asif
Hi,
I've been playing around with eBPF and have sanitizers enabled, a "BUG: Invalid wait context" is thrown in some specific instances:
1. The eBPF program is of Tracing type
2. Ringbuf helper functions are used.
3. The program is attached toperf_eventrelated symbols in the kernel.I'm attaching a folder with two instances of such programs and the info dumped by the sanitizer. The attached files for each instance include:
1. bpf_prog(x).c
2. bpf_prog(x).o - object file that is compiled with "clang-16 -O2 -g
-target bpf -cbpf_progx.c-o bpf_progx.o" and loaded by libbpf (v1.6)
3. trig(x).c - File in C that is compiled as a binary and when executed causes the bpf program to run
4. dump(x).txt - Sanitizer dump
5.vmlinux.h- Specific vmlinux file used in compiling the ebpf program object filesHappy to provide any other additional info that might be relevant.
Best regards,
Mahnur