linux/drivers/staging
Serge E. Hallyn f82ebea5c8 staging: p9auth: prevent some oopses and memory leaks
Before all testcases, do:
	mknod /dev/caphash c 253 0
	mknod /dev/capuse c 253 1

This patch does the following:

1. caphash write of > CAP_NODE_SIZE bytes overruns node_ptr->data
	(test: cat /etc/mime.types > /dev/caphash)
2. make sure we don't dereference a NULL cap_devices[0].head
	(test: cat serge@root@abab > /dev/capuse)
3. don't let strlen dereference a NULL target_user etc
	(test: echo ab > /dev/capuse)
4. Don't leak a bunch of memory in cap_write().  Note that
   technically node_ptr is not needed for the capuse write case.
   As a result I have a much more extensive patch splitting up
   cap_write(), but I thought a smaller patch that is easier to test
   and verify would be a better start.  To test:
	cnt=0
	while [ 1 ]; do
		echo /etc/mime.types > /dev/capuse
		if [ $((cnt%25)) -eq 0 ]; then
			head -2 /proc/meminfo
		fi
		cnt=$((cnt+1))
		sleep 0.3
	done
   Without this patch, it MemFree steadily drops.  With the patch,
   it does not.

I have *not* tested this driver (with or without these patches)
with factotum or anything - only using the tests described above.

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:54 -07:00
..
agnx Staging: agnx: fix build warnings 2009-06-19 11:00:35 -07:00
altpciechdma Staging: remove driver_data direct access of struct device 2009-06-19 11:00:37 -07:00
android Staging: android: fix Kconfig issues 2009-06-19 11:00:52 -07:00
asus_oled Staging: asus_oled: do not use assignment in if condition 2009-04-03 14:53:15 -07:00
at76_usb net: fix network drivers ndo_start_xmit() return values (part 8) 2009-06-13 01:18:45 -07:00
b3dfg staging: b3dfg: clean up MODULE_PARM_DESC newline 2009-06-19 11:00:54 -07:00
comedi Staging: fix operator precedence errors 2009-06-19 11:00:36 -07:00
cpc-usb Staging: cpc-usb: fix build warnings 2009-06-19 11:00:53 -07:00
dst Staging: DST: fix build dependancy 2009-04-03 14:53:33 -07:00
echo Staging: oslec bug fix 2009-06-19 11:00:54 -07:00
epl Staging: epl: do not use CLONE_SIGHAND with allow_signal() 2009-06-19 11:00:52 -07:00
et131x net: use symbolic values for ndo_start_xmit() return codes 2009-06-13 01:18:50 -07:00
frontier Staging: remove unused #include <linux/version.h>'s 2009-06-19 11:00:36 -07:00
go7007 staging: wis-sony-tuner.c: fix &&/|| error 2009-06-19 11:00:54 -07:00
heci Staging: remove unused #include <linux/version.h>'s 2009-06-19 11:00:36 -07:00
line6 Staging: line6: convert to snd_card_create() 2009-04-17 11:06:25 -07:00
me4000 Staging: me4000: make file_operations const 2009-04-03 14:53:25 -07:00
meilhaus Staging: remove unused #include <linux/version.h>'s 2009-06-19 11:00:36 -07:00
mimio Staging: mimio: depends on INPUT 2009-04-03 14:53:29 -07:00
octeon Staging: Add octeon-ethernet driver files. 2009-06-17 11:06:30 +01:00
otus Staging: otus: beyond ARRAY_SIZE of wd->ap.wds.encryMode 2009-06-19 11:00:37 -07:00
p9auth staging: p9auth: prevent some oopses and memory leaks 2009-06-19 11:00:54 -07:00
panel trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
phison Staging: phison: depends on PCI 2009-04-03 14:53:40 -07:00
poch Staging: poch: fix verification of memory area 2009-01-28 15:49:06 -08:00
pohmelfs Staging: pohmelfs: Storage class should be before const qualifier 2009-06-19 11:00:39 -07:00
rspiusb Staging: rspiusb: use USB API functions rather than constants 2009-04-03 14:53:28 -07:00
rt2860 staging: rtlxxxx: off by one in AsicSendCommandToMcu() and NDIS_STATUS NICLoadFirmware() 2009-06-19 11:00:51 -07:00
rt2870 Staging: rt2870: fix build warnings 2009-06-19 11:00:51 -07:00
rt3070 Staging: rt{28,30}70: merge rt{28,30}70/sta/*.[ch] 2009-06-19 11:00:50 -07:00
rtl8187se Staging: rtl8187se: wmm_param[1].ac_aci_acm_aifsn tested twice 2009-06-19 11:00:36 -07:00
rtl8192su Staging: rtl8192su: Correct use of ! and & 2009-06-19 11:00:54 -07:00
serqt_usb Staging: remove unused #include <linux/version.h>'s 2009-06-19 11:00:36 -07:00
slicoss staging: slicoss: update README 2009-04-17 11:06:31 -07:00
stlc45xx Staging: stlc45xx: replace print_mac with %pM 2009-06-19 11:00:36 -07:00
sxg Staging: sxg: Add missing __devexit_p() 2009-06-19 11:00:35 -07:00
uc2322 USB: usb-serial: replace shutdown with disconnect, release 2009-06-15 21:44:47 -07:00
usbip Staging: BUG to BUG_ON changes 2009-04-03 14:54:26 -07:00
vt6655 Staging: vt6655: uses pci functions, should depend on PCI 2009-06-19 11:00:52 -07:00
winbond Staging: winbond: mac80211 - unify config_interface and bss_info_changed 2009-06-19 11:00:38 -07:00
wlan-ng Staging: wlan-ng: Update README file. Remove Lindent task 2009-06-19 11:00:39 -07:00
Kconfig Staging: add rtl8192SU wireless usb driver 2009-06-19 11:00:53 -07:00
Makefile Staging: add rtl8192SU wireless usb driver 2009-06-19 11:00:53 -07:00
staging.c Staging: workaround build system bug 2008-10-13 14:32:52 -07:00