]> git.baikalelectronics.ru Git - kernel.git/commit
media: intel-ipu3: cio2: fix a crash with out-of-bounds access
authorYong Zhi <yong.zhi@intel.com>
Thu, 4 Jan 2018 02:57:16 +0000 (21:57 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 5 Jan 2018 17:43:20 +0000 (12:43 -0500)
commit4dafcc599ee9634250a5585231fadc0a7c923435
tree86db2077e8387e8174b9d838ad000812334792b8
parent44fc08d473767b16751acc173ddbd3f195afba6d
media: intel-ipu3: cio2: fix a crash with out-of-bounds access

When dmabuf is used for BLOB type frame, the frame
buffers allocated by gralloc will hold more pages
than the valid frame data due to height alignment.

In this case, the page numbers in sg list could exceed the
FBPT upper limit value - max_lops(8)*1024 to cause crash.

Limit the LOP access to the valid data length
to avoid FBPT sub-entries overflow.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Cao Bing Bu <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/pci/intel/ipu3/ipu3-cio2.c