Files
xdp-project-bpf-examples/bpf-link-hang
Toke Høiland-Jørgensen 25acd99b58 Add example to show hang on bpf_link close
Minimal example to show that the close() operation on a bpf_link can hang
indefinitely if the kernel is loaded (for example by traffic on an
interface with an XDP program loaded).

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2021-03-23 00:09:44 +01:00
..

Demonstration of close() hang on bpf_link fd close

This is a minimal example to demonstrate an issue where close()'ing an fd for a bpf_link kernel structure will hang indefinitely if the system is fully loaded. This only happens on a kernel compiled with CONFIG_PREEMPT=y, but on such a kernel the issue is quite easy to trigger: Simply load up the system (with work inside the kernel; sending it a lot of network traffic works pretty well), and run the bpf-link-hang program as root. The program will hang until load is lowered…