]> git.baikalelectronics.ru Git - kernel.git/commit
[media] media: videobuf2: fix the length check for mmap
authorMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 19 Apr 2013 10:18:01 +0000 (07:18 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 25 Apr 2013 12:54:00 +0000 (09:54 -0300)
commit58db2c1ace4a1422f309aea3be810522ee76af0a
tree4fc8507e954362d9f5898703e0c10dbd1651b2b8
parentcb2bc5cfc5a7c974b302f18b28c0c781d784f22c
[media] media: videobuf2: fix the length check for mmap

Memory maps typically require that the buffer size to be page
aligned. Currently, two memops drivers do such alignment
internally, but videobuf-vmalloc doesn't.
Also, the buffer overflow check doesn't take it into account.
So, instead of doing it at each memops driver, enforce it at
VB2 core.

Reported-by: Prabhakar lad <prabhakar.csengg@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/v4l2-core/videobuf2-core.c
drivers/media/v4l2-core/videobuf2-dma-contig.c
drivers/media/v4l2-core/videobuf2-dma-sg.c