freebsd-dev/sys/dev/sound
Ariff Abdullah 7982e7a465 Fix severe 8bit integer overflow during channel creation and destruction,
especially for vchans. It turns out that channel numbering always depend
on d->devcount counter (which keep increasing), while PCMMKMINOR() truncate
everything to 8bit length. At some point the truncation cause the newly
created character device overlapped with the existence one, causing erratic
overall system behaviour and panic. Easily reproduce with something like:

	(Luckily, only root can reproduce this)

	while : ; do
		sysctl hw.snd.pcm0.vchans=200
		sysctl hw.snd.pcm0.vchans=100
	done

- Enforce channel/chardev numbering within 8bit boundary. Return E2BIG
  if necessary.
- Traverse d->channels SLIST and try to reclaim "free" counter during channel
  creation. Don't rely on d->devcount at all.
- Destroy vchans in reverse order.

Anyway, this is not the fault of vchans. It is just that vchans are so cute
and begging to be abused ;) . Don't blame her.

Old, hidden bugs.. sigh..

MFC after:	3 days
2006-03-16 04:12:49 +00:00
..
isa Fix memory leak in some failure cases. 2006-02-05 17:10:52 +00:00
pci Add another inverted amplifier sense quirk for Kvazar-Micro Senator 3592XT. 2006-03-07 05:48:14 +00:00
pcm Fix severe 8bit integer overflow during channel creation and destruction, 2006-03-16 04:12:49 +00:00
sbus Take advantage of ebus(4) having switched to SYS_RES_MEMORY for the 2005-05-19 18:13:49 +00:00
usb Convert NULL checks into KASSERT (and move them before the first 2006-02-05 17:47:26 +00:00
chip.h
driver.c Sort list of modules. 2006-01-23 11:58:01 +00:00