freebsd-dev/sys/net
Robert Watson e82669d99b When resetting a BPF descriptor, properly check that zero-copy buffers
are not currently owned by userspace before clearing or rotating them.

Otherwise we may not play by the rules of the shared memory protocol,
potentially corrupting packet data or causing userspace applications
that are playing by the rules to spin due to being notified that a
buffer is complete but the shared memory header not reflecting that.

This behavior was seen with pflogd by a number of reporters; note that
this fix is not sufficient to get pflogd properly working with
zero-copy BPF, due to pflogd opening the BPF device before forking,
leading to the shared memory buffer not being propery inherited in the
privilege-separated child.  We're still deciding how to fix that
problem.

This change exposes buffer-model specific strategy information in
reset_d(), which will be fixed at a later date once we've decided how
best to improve the BPF buffer abstraction.

Reviewed by:	csjp
Reported by:	keramida
2009-03-07 22:17:44 +00:00
..
bpf_buffer.c
bpf_buffer.h
bpf_filter.c
bpf_jitter.c
bpf_jitter.h
bpf_zerocopy.c Clarify some comments, fix some types, and rename ZBUF_FLAG_IMMUTABLE to 2009-03-07 10:21:37 +00:00
bpf_zerocopy.h
bpf.c When resetting a BPF descriptor, properly check that zero-copy buffers 2009-03-07 22:17:44 +00:00
bpf.h
bpfdesc.h
bridgestp.c For all files including net/vnet.h directly include opt_route.h and 2009-02-27 14:12:05 +00:00
bridgestp.h
bsd_comp.c
ethernet.h
fddi.h
firewire.h
ieee8023ad_lacp.c
ieee8023ad_lacp.h
if_arc.h
if_arcsubr.c
if_arp.h
if_atm.h
if_atmsubr.c
if_bridge.c bridge_delete_member is called via the event handler from if_detach 2009-02-13 19:20:25 +00:00
if_bridgevar.h
if_clone.c
if_clone.h
if_disc.c
if_dl.h
if_edsc.c
if_ef.c For all files including net/vnet.h directly include opt_route.h and 2009-02-27 14:12:05 +00:00
if_enc.c
if_enc.h
if_ethersubr.c For all files including net/vnet.h directly include opt_route.h and 2009-02-27 14:12:05 +00:00
if_faith.c
if_fddisubr.c
if_fwsubr.c
if_gif.c
if_gif.h On architectures with strict alignment requirements compensate 2009-03-07 19:08:58 +00:00
if_gre.c
if_gre.h
if_iso88025subr.c
if_lagg.c
if_lagg.h
if_llatbl.c Like with r185713 make sure to not leak a lock as rtalloc1(9) returns 2009-01-31 10:48:02 +00:00
if_llatbl.h
if_llc.h
if_loop.c For all files including net/vnet.h directly include opt_route.h and 2009-02-27 14:12:05 +00:00
if_media.c
if_media.h
if_mib.c For all files including net/vnet.h directly include opt_route.h and 2009-02-27 14:12:05 +00:00
if_mib.h
if_ppp.c
if_ppp.h
if_pppvar.h
if_sl.c
if_slvar.h
if_sppp.h
if_spppfr.c
if_spppsubr.c IFF_NEEDSGIANT will no longer be supported, so remove compatibility code 2009-02-16 10:29:03 +00:00
if_stf.c
if_stf.h
if_tap.c
if_tap.h
if_tapvar.h
if_tun.c
if_tun.h
if_types.h
if_var.h Do a bit of struct ifnet cleanup in preparation for 8.0: group function 2009-03-01 12:42:54 +00:00
if_vlan_var.h
if_vlan.c For all files including net/vnet.h directly include opt_route.h and 2009-02-27 14:12:05 +00:00
if.c For all files including net/vnet.h directly include opt_route.h and 2009-02-27 14:12:05 +00:00
if.h remove unnecessary forward declaration 2009-02-16 15:09:37 +00:00
iso88025.h
netisr.c
netisr.h Reserve a netisr slot for the IGMPv3 output queue. 2009-03-04 02:54:11 +00:00
pfil.c
pfil.h
pfkeyv2.h
ppp_comp.h
ppp_deflate.c
ppp_defs.h
ppp_tty.c
radix_mpath.c
radix_mpath.h
radix.c
radix.h
raw_cb.c For all files including net/vnet.h directly include opt_route.h and 2009-02-27 14:12:05 +00:00
raw_cb.h
raw_usrreq.c For all files including net/vnet.h directly include opt_route.h and 2009-02-27 14:12:05 +00:00
route.c
route.h
rtsock.c Call prison_if from rtm_get_jailed, instead of splitting it out into 2009-02-05 14:58:16 +00:00
slcompress.c
slcompress.h
slip.h
vnet.h Add size-guards evaluated at compile-time to the main struct vnet_* 2009-03-01 11:01:00 +00:00
zlib.c
zlib.h