media: atomisp: Ensure that USERPTR pointers are page aligned
authorHans de Goede <hdegoede@redhat.com>
Sun, 21 Aug 2022 18:29:06 +0000 (20:29 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sat, 24 Sep 2022 07:46:03 +0000 (09:46 +0200)
commit6e6c4ae0f0ba295dbf6cbd48d93bec169d6ce431
treec37e84df743295257e6208becea3399d209581c4
parent30cf7e90f0ea7adb1f125a286f2273f9faa162fe
media: atomisp: Ensure that USERPTR pointers are page aligned

The atomisp code needs USERPTR pointers to be page aligned,
otherwise bad things (scribbling over other parts of the
process' RAM) happen.

Add a check to ensure this and exit VIDIOC_QBUF calls with
unaligned pointers with -EINVAL.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_ioctl.c