Skip to contentSkip to conversation

Sanitizer flags an eBPF bug

DISCUSSION syeda-mahnur.asif 1 participant 3 messages Nov 3, 2025 – Dec 9, 2025 BPF

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

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 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

#2 lore raw

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,
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 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