]> git.baikalelectronics.ru Git - kernel.git/commit
[media] zoran: fix integer overflow in setup_window()
authorXi Wang <xi.wang@gmail.com>
Mon, 9 Apr 2012 20:15:45 +0000 (17:15 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 19 Apr 2012 12:11:25 +0000 (09:11 -0300)
commit369b7664b22a01967927a9b3a3b291aab536cdd4
treefb62bbd35c0936e59daf533624cf7372c49d847a
parent02154aa88d0a0f6618aeb39d954024b07ee0e97a
[media] zoran: fix integer overflow in setup_window()

`clipcount' is from userspace and thus needs validation.  Otherwise,
a large `clipcount' could overflow the vmalloc() size, leading to
out-of-bounds access.

| setup_window()
| zoran_s_fmt_vid_overlay()
| __video_do_ioctl()
| video_ioctl2()

Use 2048 as the maximum `clipcount'.  Also change the corresponding
parameter type to `unsigned int'.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/zoran/zoran_driver.c