melifaro 34ec5c8650 Fix old panic when BPF consumer attaches to destroying interface.
'flags' field is added to the end of bpf_if structure. Currently the only
flag is BPFIF_FLAG_DYING which is set on bpf detach and checked by bpf_attachd()
Problem can be easily triggered on SMP stable/[89] by the following command (sort of):
'while true; do ifconfig vlan222 create vlan 222 vlandev em0 up ; tcpdump -pi vlan222 & ; ifconfig vlan222 destroy ; done'

Fix possible use-after-free when BPF detaches itself from interface, freeing bpf_bif memory,
while interface is still UP and there can be routes via this interface.
Freeing is now delayed till ifnet_departure_event is received via eventhandler(9) api.

Convert bpfd rwlock back to mutex due lack of performance gain (currently checking if packet
matches filter is done without holding bpfd lock and we have to acquire write lock if packet matches)

Approved by:      kib(mentor)
MFC in:            4 weeks
2012-05-21 22:17:29 +00:00
..
2011-12-05 10:34:52 +00:00
2011-04-13 11:28:46 +00:00
MFC
2011-05-31 21:22:44 +00:00
2012-01-02 12:12:10 +00:00
2012-03-28 20:58:30 +00:00
2012-03-28 20:58:30 +00:00
2010-11-25 20:05:11 +00:00
2012-03-28 20:58:30 +00:00
2012-03-28 20:58:30 +00:00
2012-03-28 20:58:30 +00:00
2011-07-10 00:53:04 +00:00
2012-01-02 12:12:10 +00:00
2012-02-01 14:34:52 +00:00
2012-01-26 16:35:09 +00:00
2012-03-12 11:56:57 +00:00
2012-01-02 12:12:10 +00:00