linux/include
Dan Carpenter 05be8b81aa Input: force feedback - potential integer wrap in input_ff_create()
The problem here is that max_effects can wrap on 32 bits systems.
We'd allocate a smaller amount of data than sizeof(struct ff_device).
The call to kcalloc() on the next line would fail but it would write
the NULL return outside of the memory we just allocated causing data
corruption.

The call path is that uinput_setup_device() get ->ff_effects_max from
the user and sets the value in the ->private_data struct.  From there
it is:
-> uinput_ioctl_handler()
   -> uinput_create_device()
      -> input_ff_create(dev, udev->ff_effects_max);

I've also changed ff_effects_max so it's an unsigned int instead of
a signed int as a cleanup.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-12 21:13:11 -07:00
..
acpi Merge branch 'apei-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2011-08-03 21:53:27 -10:00
asm-generic All Arch: remove linkage for sys_nfsservctl system call 2011-08-26 15:09:58 -07:00
crypto net: remove mm.h inclusion from netdevice.h 2011-06-21 19:17:20 -07:00
drm drm: Separate EDID Header Check from EDID Block Check 2011-08-04 14:39:35 +01:00
keys encrypted-keys: add key format support 2011-06-27 09:10:45 -04:00
linux Input: force feedback - potential integer wrap in input_ff_create() 2011-10-12 21:13:11 -07:00
math-emu
media [media] V4L: initial driver for ov5642 CMOS sensor 2011-07-27 17:56:09 -03:00
mtd
net ipv4: route non-local sources for raw socket 2011-08-07 22:52:32 -07:00
pcmcia Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2011-07-31 06:23:08 -10:00
rdma atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
rxrpc atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
scsi Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osd 2011-08-06 22:56:03 -07:00
sound ASoC: omap: Update e-mail address of Jarkko Nikula 2011-08-12 11:45:10 +09:00
target target: Make standard INQUIRY return 'not connected' for tpg_virt_lun0 2011-08-22 19:25:35 +00:00
trace Merge branch 'for-linus' of git://git.kernel.dk/linux-block 2011-08-19 10:47:07 -07:00
video OMAP: DSS2: Remove unused opt_clock_available 2011-07-25 10:22:05 +03:00
xen xen/balloon: memory hotplug support for Xen balloon driver 2011-07-25 20:57:08 -07:00
Kbuild