When an interface is moving to/from jail, it is still attached to bpf
and the consumers, tcpdump(1) e.g., do not get noticed. That is
counterintuitive and may leak informations ( sniffer traffic in parent
jail/vnet ).
MFC after: 1 week
Differential D45727
bpf: Detach descriptors on interface vmove event zlei on Jun 25 2024, 9:08 AM. Authored by Tags None Referenced Files
Details When an interface is moving to/from jail, it is still attached to bpf MFC after: 1 week One session: # tcpdump -nvi cxl0 tcpdump: listening on cxl0, link-type EN10MB (Ethernet), snapshot length 262144 bytes Another session: # jail -ic vnet persist 1 # ifconfig cxl0 vnet 1 On first session tcpdump: pcap_loop: The interface disappeared 0 packets captured 0 packets received by filter 0 packets dropped by kernel
Diff Detail
Event TimelineComment Actions You probably can directly call similar to bpf_ifdetach() function from if_vmove(). It is called from ioctl context, so you can make detaching synchronously. Comment Actions I've ever considered that approach, and finally chose this, the even handler. The latter is self constrained and loosely coupled, although with a little overhead of brainpower.
Comment Actions Think it twice, it is straight forward to synchronously detach the BPF descriptors. The logic is also simpler. |