]> git.baikalelectronics.ru Git - kernel.git/commit
[media] omap_vout: Added check in reqbuf & mmap for buf_size allocation
authorVaibhav Hiremath <hvaibhav@ti.com>
Thu, 14 Apr 2011 16:42:34 +0000 (13:42 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 1 Jul 2011 18:47:53 +0000 (15:47 -0300)
commite79dc6905183772f1bb89d394f6555e0d55ab7ca
tree31790a31565229c3719b963d1be26f001eeb59b8
parent15a6a0dde859d711576437ce5957290b38062b55
[media] omap_vout: Added check in reqbuf & mmap for buf_size allocation

The usecase where, user allocates small size of buffer
through bootargs (video1_bufsize/video2_bufsize) and later from application
tries to set the format which requires larger buffer size, driver doesn't
check for insufficient buffer size and allows application to map extra buffer.
This leads to kernel crash, when user application tries to access memory
beyond the allocation size.

Added check in both mmap and reqbuf call back function,
and return error if the size of the buffer allocated by user through
bootargs is less than the S_FMT size.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/omap/omap_vout.c