freebsd-nq/share
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
..
colldef Add lv_LV, move lt_LT to common part 2009-09-03 16:53:11 +00:00
dict Various changes from various sources: 2010-09-23 11:19:03 +00:00
doc bmake and other updates necessary for the BIND 9.8.x upgrade. 2011-07-16 11:20:54 +00:00
examples It's a bit odd, but "make update" in src/ can also update the ports/, 2011-06-16 12:28:37 +00:00
i18n Add the BSD-licensed Citrus iconv to the base system with default off 2011-02-25 00:04:39 +00:00
info
man Fix a deficiency in the selinfo interface: 2011-08-25 15:51:54 +00:00
me
misc MFV pciids-20110716, r224099 2011-07-16 15:40:26 +00:00
mk Add macros to specify owner, group and mode of config files for installation. 2011-06-27 13:23:51 +00:00
mklocale Add lv_LV, move lt_LT to common part 2009-09-03 17:12:45 +00:00
monetdef Last character is a space for the international currency symbol. 2009-09-13 22:17:23 +00:00
msgdef Add lv_LV 2009-09-04 06:19:37 +00:00
numericdef Add lv_LV 2009-09-03 17:37:23 +00:00
security Remove stale references to utmp(5) and its corresponding filenames. 2010-01-21 17:25:12 +00:00
sendmail
skel skel/.shrc: Improve commented CDPATH example for POSIX requirements. 2011-06-10 13:47:11 +00:00
snmp
syscons syscons: install all available kbdmaps 2011-01-30 12:57:10 +00:00
tabset
termcap Improve 256 color support. 2011-02-19 11:06:00 +00:00
timedef Partial fix for PR 91106. Correct the short weekday names. Done according to this poll https://bugzilla.redhat.com/show_bug.cgi?id=242296. This will not close the bug fully yet, as the month names are still not correctly in Genitive. More research on this topic will be done, as I'm suspecting a bug in the libc locale functions picking the month name from the wrong group. 2011-02-27 21:32:25 +00:00
zoneinfo Officially speaking, the zoneinfo data files are contributed data. 2010-02-25 06:44:16 +00:00
Makefile Add the BSD-licensed Citrus iconv to the base system with default off 2011-02-25 00:04:39 +00:00
Makefile.inc