summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSasha Levin <sasha.levin@oracle.com>2013-11-19 14:25:36 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-08 07:29:27 -0800
commitca77581ebaa42e9279a231fbcb98ee031c37fe3a (patch)
treee0f1abd323bbaff28e1d1c0079c25826476738e6
parentf99510dc9a9b63ba8131e1e5eb70884db122a1bc (diff)
downloadlinux-3.10-ca77581ebaa42e9279a231fbcb98ee031c37fe3a.tar.gz
linux-3.10-ca77581ebaa42e9279a231fbcb98ee031c37fe3a.tar.bz2
linux-3.10-ca77581ebaa42e9279a231fbcb98ee031c37fe3a.zip
video: kyro: fix incorrect sizes when copying to userspace
commit 2ab68ec927310dc488f3403bb48f9e4ad00a9491 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>
-rw-r--r--drivers/video/kyro/fbdev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c
index 6157f74ac60..ec7fc87fa5a 100644
--- a/drivers/video/kyro/fbdev.c
+++ b/drivers/video/kyro/fbdev.c
@@ -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;
}