remarkable-linux/drivers
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
..
accessibility
acpi
amba
ata
atm
auxdisplay
base Merge branch 'akpm' 2009-06-16 19:50:13 -07:00
block
bluetooth
cdrom
char kexec: sysrq: simplify sysrq-c handler 2009-06-18 13:03:59 -07:00
clocksource Merge branches 'sh/pci-express-integration', 'sh/rsk-updates', 'sh/platform-updates' and 'sh/perf_counter' 2009-06-17 16:37:26 +09:00
connector
cpufreq
cpuidle
crypto
dca
dio
dma DMA: TXx9 Soc DMA Controller driver 2009-06-17 11:06:25 +01:00
edac edac: Kconfig: fix the meaning of EDAC abbreviation 2009-06-18 13:03:57 -07:00
eisa Merge branch 'akpm' 2009-06-16 19:50:13 -07:00
firewire Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2009-06-16 14:29:46 -07:00
firmware Pull for-2.6.31 into release 2009-06-17 09:35:24 -07:00
gpio gpio: pca953x: Add support for PCA9556 2009-06-18 13:03:44 -07:00
gpu drm/radeon/kms: remove the _DRM_DRIVER from the KMS paths. 2009-06-17 09:45:46 -07:00
hid
hwmon Merge branch 'akpm' 2009-06-16 19:50:13 -07:00
i2c i2c-stu300: Make driver depend on MACH_U300 2009-06-16 22:42:17 +01:00
ide
idle
ieee1394
ieee802154
infiniband
input Merge branch 'akpm' 2009-06-16 19:50:13 -07:00
isdn net: fix network drivers ndo_start_xmit() return values 2009-06-17 04:31:16 -07:00
leds
lguest
macintosh
mca
md Merge branch 'for-linus' of git://neil.brown.name/md 2009-06-18 13:11:50 -07:00
media soc-camera: unify i2c camera device platform data 2009-06-17 16:22:34 +09:00
memstick
message
mfd mfd: early init for MFD running regulators 2009-06-17 19:41:54 +02:00
misc gru: copyright fixes 2009-06-18 13:04:04 -07:00
mmc
mtd Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6 2009-06-17 09:48:30 -07:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2009-06-18 14:07:15 -07:00
nubus
of
oprofile
parisc
parport
pci Fix pci_claim_resource 2009-06-17 14:04:42 -07:00
pcmcia Merge branch 'akpm' 2009-06-16 19:50:13 -07:00
platform
pnp
power
pps LinuxPPS: core support 2009-06-18 13:04:04 -07:00
ps3
rapidio
regulator
rtc rtc-ds1553: drop IRQF_SHARED 2009-06-18 13:03:43 -07:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2009-06-18 14:07:15 -07:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2009-06-17 09:50:44 -07:00
serial Merge branches 'sh/pci-express-integration', 'sh/rsk-updates', 'sh/platform-updates' and 'sh/perf_counter' 2009-06-17 16:37:26 +09:00
sh
sn
spi spi: fix spi_write_then_read() comment 2009-06-18 13:03:42 -07:00
ssb
staging staging: p9auth: prevent some oopses and memory leaks 2009-06-19 11:00:54 -07:00
tc
telephony
thermal
uio
usb
uwb
video Merge branch 'akpm' 2009-06-16 19:50:13 -07:00
virtio
vlynq drivers: add support for the TI VLYNQ bus 2009-06-16 19:47:52 -07:00
w1 w1-gpio: add external pull-up enable callback 2009-06-18 13:03:58 -07:00
watchdog [WATCHDOG] hpwdt: Add NMI sourcing 2009-06-18 07:32:06 +00:00
xen
zorro
Kconfig LinuxPPS: core support 2009-06-18 13:04:04 -07:00
Makefile LinuxPPS: core support 2009-06-18 13:04:04 -07:00