freebsd-nq/sys/net
Attilio Rao 6aba400a70 Fix a deficiency in the selinfo interface:
If a selinfo object is recorded (via selrecord()) and then it is
quickly destroyed, with the waiters missing the opportunity to awake,
at the next iteration they will find the selinfo object destroyed,
causing a PF#.

That happens because the selinfo interface has no way to drain the
waiters before to destroy the registered selinfo object. Also this
race is quite rare to get in practice, because it would require a
selrecord(), a poll request by another thread and a quick destruction
of the selrecord()'ed selinfo object.

Fix this by adding the seldrain() routine which should be called
before to destroy the selinfo objects (in order to avoid such case),
and fix the present cases where it might have already been called.
Sometimes, the context is safe enough to prevent this type of race,
like it happens in device drivers which installs selinfo objects on
poll callbacks. There, the destruction of the selinfo object happens
at driver detach time, when all the filedescriptors should be already
closed, thus there cannot be a race.
For this case, mfi(4) device driver can be set as an example, as it
implements a full correct logic for preventing this from happening.

Sponsored by:	Sandvine Incorporated
Reported by:	rstone
Tested by:	pluknet
Reviewed by:	jhb, kib
Approved by:	re (bz)
MFC after:	3 weeks
2011-08-25 15:51:54 +00:00
..
bpf_buffer.c o Swap descriptions for net.bpf.bufsize and net.bpf.maxbufsize. 2010-11-24 05:50:19 +00:00
bpf_buffer.h
bpf_filter.c Clear the filter memory area before using it. Leaving it uninitialized may 2011-07-14 21:06:22 +00:00
bpf_jitter.c
bpf_jitter.h
bpf_zerocopy.c Introduce and use a new VM interface for temporarily pinning pages. This 2010-12-25 21:26:56 +00:00
bpf_zerocopy.h
bpf.c Fix a deficiency in the selinfo interface: 2011-08-25 15:51:54 +00:00
bpf.h Sync DLTs with the latest pcap version. 2010-10-29 18:41:09 +00:00
bpfdesc.h Implement flexible BPF timestamping framework. 2010-06-15 19:28:44 +00:00
bridgestp.c Set curvnet context in a callout-trigerred code path. 2011-06-07 20:46:03 +00:00
bridgestp.h Set curvnet context in a callout-trigerred code path. 2011-06-07 20:46:03 +00:00
ethernet.h
fddi.h
firewire.h
flowtable.c - Restore dropping the priority of syncer down to PPAUSE when it is idle. 2011-01-06 22:17:07 +00:00
flowtable.h allocate ipv6 flows from the ipv6 flow zone 2010-05-16 21:48:39 +00:00
ieee8023ad_lacp.c
ieee8023ad_lacp.h
if_arc.h
if_arcsubr.c Tag mbufs of all incoming frames or packets with the interface's FIB 2011-07-03 16:08:38 +00:00
if_arp.h - Merge changes to the base system to support OFED. These include 2011-03-21 09:40:01 +00:00
if_atm.h
if_atmsubr.c Tag mbufs of all incoming frames or packets with the interface's FIB 2011-07-03 16:08:38 +00:00
if_bridge.c Unbreak LINT by moving all carp hooks to net/if.c / netinet/ip_carp.h, with 2010-08-11 20:18:19 +00:00
if_bridgevar.h
if_clone.c After some off-list discussion, revert a number of changes to the 2010-11-22 19:32:54 +00:00
if_clone.h
if_dead.c
if_debug.c Add infrastructure to allow all frames/packets received on an interface 2011-07-03 12:22:02 +00:00
if_disc.c
if_dl.h
if_edsc.c
if_ef.c Add new tunable 'net.link.ifqmaxlen' to set default send interface 2010-05-03 07:32:50 +00:00
if_enc.c Make various (pseudo) interfaces compile without INET in the kernel 2011-04-27 19:30:44 +00:00
if_enc.h
if_epair.c Allow for vlan(4) interfaces with MTU of 1500 bytes to be configured 2011-05-24 08:02:55 +00:00
if_ethersubr.c Tag mbufs of all incoming frames or packets with the interface's FIB 2011-07-03 16:08:38 +00:00
if_faith.c
if_fddisubr.c Tag mbufs of all incoming frames or packets with the interface's FIB 2011-07-03 16:08:38 +00:00
if_fwsubr.c Tag mbufs of all incoming frames or packets with the interface's FIB 2011-07-03 16:08:38 +00:00
if_gif.c Tag mbufs of all incoming frames or packets with the interface's FIB 2011-07-03 16:08:38 +00:00
if_gif.h MFP4: @176978-176982, 176984, 176990-176994, 177441 2010-04-29 11:52:42 +00:00
if_gre.c gre(4) was using a field in the softc to detect possible recursion. 2011-06-18 09:34:03 +00:00
if_gre.h gre(4) was using a field in the softc to detect possible recursion. 2011-06-18 09:34:03 +00:00
if_iso88025subr.c Tag mbufs of all incoming frames or packets with the interface's FIB 2011-07-03 16:08:38 +00:00
if_lagg.c Add missing MODULE_VERSION() definition to protect against duplicating 2011-08-01 11:24:55 +00:00
if_lagg.h
if_llatbl.c The statically configured (permanent) ARP entries are removed when an 2011-05-20 19:12:20 +00:00
if_llatbl.h Permit ARP to proceed for IPv4 host routes for which the gateway is the 2011-07-08 09:38:33 +00:00
if_llc.h
if_loop.c After some off-list discussion, revert a number of changes to the 2010-11-22 19:32:54 +00:00
if_media.c Fix typos - remove duplicate "the". 2011-02-21 09:01:34 +00:00
if_media.h - Add 10baseT as an alias for 10baseT/UTP. 2011-05-15 12:58:29 +00:00
if_mib.c
if_mib.h
if_sppp.h
if_spppfr.c Tag mbufs of all incoming frames or packets with the interface's FIB 2011-07-03 16:08:38 +00:00
if_spppsubr.c Tag mbufs of all incoming frames or packets with the interface's FIB 2011-07-03 16:08:38 +00:00
if_stf.c Tag mbufs of all incoming frames or packets with the interface's FIB 2011-07-03 16:08:38 +00:00
if_stf.h
if_tap.c Fix a deficiency in the selinfo interface: 2011-08-25 15:51:54 +00:00
if_tap.h
if_tapvar.h
if_tun.c Fix a deficiency in the selinfo interface: 2011-08-25 15:51:54 +00:00
if_tun.h
if_types.h - Merge changes to the base system to support OFED. These include 2011-03-21 09:40:01 +00:00
if_var.h Add spares to the network stack for FreeBSD-9: 2011-07-17 21:15:20 +00:00
if_vlan_var.h - Merge changes to the base system to support OFED. These include 2011-03-21 09:40:01 +00:00
if_vlan.c - Merge changes to the base system to support OFED. These include 2011-03-21 09:40:01 +00:00
if.c Add infrastructure to allow all frames/packets received on an interface 2011-07-03 12:22:02 +00:00
if.h Add infrastructure to allow all frames/packets received on an interface 2011-07-03 12:22:02 +00:00
iso88025.h
netisr_internal.h Rework netisr policy mechanism so that per-protocol dispatch policies can 2011-05-24 12:34:19 +00:00
netisr.c On multi-core, multi-threaded PPC systems, it is important that the threads 2011-05-31 15:11:43 +00:00
netisr.h Rework netisr policy mechanism so that per-protocol dispatch policies can 2011-05-24 12:34:19 +00:00
pfil.c
pfil.h small portability fix to build on linux/windows 2010-07-15 14:41:06 +00:00
pfkeyv2.h
ppp_defs.h
radix_mpath.c When the RADIX_MPATH kernel option is enabled, the RADIX_MPATH code tries 2011-08-25 04:31:20 +00:00
radix_mpath.h
radix.c whitespace cleanup 2010-07-15 14:41:59 +00:00
radix.h Add spares to the network stack for FreeBSD-9: 2011-07-17 21:15:20 +00:00
raw_cb.c
raw_cb.h
raw_usrreq.c
route.c In rtinit1(), before rtrequest1_fib() is called, info.rti_flags is 2011-08-08 05:25:51 +00:00
route.h Garbage collect never used global, sysctl, externs. 2011-06-21 07:19:03 +00:00
rtsock.c As info.rti_info[RTAX_DST] can point inside of rtm we must not free the rtm 2011-02-10 01:24:09 +00:00
slcompress.c
slcompress.h
vnet.c Remove unneeded includes of <sys/linker_set.h>. Other headers that use 2011-01-11 13:59:06 +00:00
vnet.h Mfp4 CH=177255: 2011-02-11 14:17:58 +00:00
zlib.c
zlib.h
zutil.h