I ran a sample ebpf code with void as return type and calling bpf_printk before returning. I was expecting this code to be rejected by the verifier. However, I was able to successfully load it into the kernel and it kind of damaged my networking subsystem as it was related to xdp and had to restart my machine to get the networking working again. Is this normal?
Kernel: Linux asus 6.5.0-28-generic #29~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 4 14:39:20 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
OS: Ubuntu 22.04.4 LTS
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
int counter = 0;
SEC("xdp")
void error_packet_count(void *ctx) {
bpf_printk("%d", counter);
counter++;
return;
}
char LICENSE[] SEC("license") = "Dual BSD/GPL";