When using BPF, I consistently get a kernel panic. I have attached the core.txt.0 file that was generated. If there is anything more I can do to help track this down please ask. Sorry this was initially empty, I hit enter in the wrong place and ended up submitting it.
Created attachment 145415 [details] Core dump
Running this binary is what reproduces the panic for me. Usage as follows: ---- $ sudo chmod g+rw /dev/bpf $ RUST_TEST_TASKS=1 ./pnet ---- Within seconds, the kernel will panic. All networking should be done on the loopback interface, but just in case it might be best to run this offline. Obviously it will panic the machine too. Binary can be found here (4.5meg, too large to upload as an attachment): http://octarineparrot.com/assets/pnet
The panic only seems to occur when using the loopback interface. I will try and narrow this down further if possible.
Created attachment 145446 [details] Minimal test case to reproduce the kernel panic This is a minimal test case which reproduces the kernel panic. It only happens when using the loopback interface, setting the pseudo header to AF_INET, and using BIOCFEEDBACK.
Created attachment 145448 [details] Quick fix which prevents panic This patch prevents the kernel panic. It is probably not the correct solution, but it does work.
Over to maintainers.
A commit references this bug: Author: ae Date: Thu Mar 12 14:55:34 UTC 2015 New revision: 279920 URL: https://svnweb.freebsd.org/changeset/base/279920 Log: Add if_input_default() method, that will be used for if_input initialization, when no input method specified before if_attach(). This prevents panics when if_input() method called directly e.g. from bpf(4) code. PR: 192426 Reviewed by: glebius MFC after: 1 week Changes: head/sys/net/if.c
A commit references this bug: Author: ae Date: Thu Mar 19 13:10:10 UTC 2015 New revision: 280256 URL: https://svnweb.freebsd.org/changeset/base/280256 Log: MFC r279920: Add if_input_default() method, that will be used for if_input initialization, when no input method specified before if_attach(). This prevents panics when if_input() method called directly e.g. from bpf(4) code. PR: 192426 Changes: _U stable/10/ stable/10/sys/net/if.c
A commit references this bug: Author: ae Date: Thu Mar 19 13:33:17 UTC 2015 New revision: 280257 URL: https://svnweb.freebsd.org/changeset/base/280257 Log: MFC r279920: Add if_input_default() method, that will be used for if_input initialization, when no input method specified before if_attach(). This prevents panics when if_input() method called directly e.g. from bpf(4) code. PR: 192426 Changes: _U stable/9/sys/ _U stable/9/sys/net/ stable/9/sys/net/if.c
Fixed in head/, stable/10 and stable/9. Thanks!