mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
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>
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…