lkml.org 
[lkml]   [2003]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Misc 2.5 Fixes: cp-user-vicam


Fix handling of user bufs (arg), use copy_from_user.


drivers/usb/media/vicam.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)

diff -puN drivers/usb/media/vicam.c~cp-user-vicam drivers/usb/media/vicam.c
--- linux-2.5.70-ds/drivers/usb/media/vicam.c~cp-user-vicam 2003-06-08 03:55:24.000000000 +0530
+++ linux-2.5.70-ds-dipankar/drivers/usb/media/vicam.c 2003-06-08 04:03:39.000000000 +0530
@@ -611,7 +611,12 @@ vicam_ioctl(struct inode *inode, struct

case VIDIOCSPICT:
{
- struct video_picture *vp = (struct video_picture *) arg;
+ struct video_picture vp;
+
+ if (copy_from_user(&vp, arg, sizeof (vp))) {
+ retval = -EFAULT;
+ break;
+ }

DBG("VIDIOCSPICT depth = %d, pal = %d\n", vp->depth,
vp->palette);
@@ -652,7 +657,12 @@ vicam_ioctl(struct inode *inode, struct
case VIDIOCSWIN:
{

- struct video_window *vw = (struct video_window *) arg;
+ struct video_window vw;
+
+ if (copy_from_user(&vw, arg, sizeof (vw))) {
+ retval = -EFAULT;
+ break;
+ }
DBG("VIDIOCSWIN %d x %d\n", vw->width, vw->height);

if ( vw->width != 320 || vw->height != 240 )
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.062 / U:5.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site