mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
video: kyro: fix incorrect sizes when copying to userspace
commit 2ab68ec927
upstream.
kyro would copy u32s and specify sizeof(unsigned long) as the size to copy.
This would copy more data than intended and cause memory corruption and might
leak kernel memory.
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b79811fc00
commit
6fa8c5d6ac
1 changed files with 3 additions and 3 deletions
|
@ -625,15 +625,15 @@ static int kyrofb_ioctl(struct fb_info *info,
|
|||
}
|
||||
break;
|
||||
case KYRO_IOCTL_UVSTRIDE:
|
||||
if (copy_to_user(argp, &deviceInfo.ulOverlayUVStride, sizeof(unsigned long)))
|
||||
if (copy_to_user(argp, &deviceInfo.ulOverlayUVStride, sizeof(deviceInfo.ulOverlayUVStride)))
|
||||
return -EFAULT;
|
||||
break;
|
||||
case KYRO_IOCTL_STRIDE:
|
||||
if (copy_to_user(argp, &deviceInfo.ulOverlayStride, sizeof(unsigned long)))
|
||||
if (copy_to_user(argp, &deviceInfo.ulOverlayStride, sizeof(deviceInfo.ulOverlayStride)))
|
||||
return -EFAULT;
|
||||
break;
|
||||
case KYRO_IOCTL_OVERLAY_OFFSET:
|
||||
if (copy_to_user(argp, &deviceInfo.ulOverlayOffset, sizeof(unsigned long)))
|
||||
if (copy_to_user(argp, &deviceInfo.ulOverlayOffset, sizeof(deviceInfo.ulOverlayOffset)))
|
||||
return -EFAULT;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue