* [PATCH] Staging: dt3155: Remove copy_to_user for ioctl's DT3155_{STOP|START}
@ 2010-07-21 0:57 H Hartley Sweeten
2010-07-21 7:57 ` Jiri Slaby
0 siblings, 1 reply; 3+ messages in thread
From: H Hartley Sweeten @ 2010-07-21 0:57 UTC (permalink / raw)
To: Linux Kernel; +Cc: devel, gregkh, ss
The ioctl's DT3155_STOP and DT3155_START are defined with the macro
_IO indicating that they have no parameters. They should not be using
copy_to_user to return data to user space.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Scott Smedley <ss@aao.gov.au>
---
diff --git a/drivers/staging/dt3155/dt3155_drv.c b/drivers/staging/dt3155/dt3155_drv.c
index fed7e62..5eb1bcd 100644
--- a/drivers/staging/dt3155/dt3155_drv.c
+++ b/drivers/staging/dt3155/dt3155_drv.c
@@ -570,8 +570,6 @@ static int dt3155_ioctl(struct inode *inode,
return 0;
quick_stop(minor);
- if (copy_to_user(up, dts, sizeof(*dts)))
- return -EFAULT;
return 0;
}
case DT3155_START:
@@ -593,8 +591,6 @@ static int dt3155_ioctl(struct inode *inode,
}
dt3155_init_isr(minor);
- if (copy_to_user(up, dts, sizeof(*dts)))
- return -EFAULT;
return 0;
}
default:
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] Staging: dt3155: Remove copy_to_user for ioctl's DT3155_{STOP|START}
2010-07-21 0:57 [PATCH] Staging: dt3155: Remove copy_to_user for ioctl's DT3155_{STOP|START} H Hartley Sweeten
@ 2010-07-21 7:57 ` Jiri Slaby
2010-07-22 17:55 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Slaby @ 2010-07-21 7:57 UTC (permalink / raw)
To: H Hartley Sweeten; +Cc: Linux Kernel, devel, ss, gregkh
On 07/21/2010 02:57 AM, H Hartley Sweeten wrote:
> The ioctl's DT3155_STOP and DT3155_START are defined with the macro
> _IO indicating that they have no parameters. They should not be using
> copy_to_user to return data to user space.
This is not a reason for removing them. You should check what real users
do/expect and base your reasoning on the top of that.
So could you investigate that?
regards,
--
js
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] Staging: dt3155: Remove copy_to_user for ioctl's DT3155_{STOP|START}
2010-07-21 7:57 ` Jiri Slaby
@ 2010-07-22 17:55 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2010-07-22 17:55 UTC (permalink / raw)
To: Jiri Slaby; +Cc: H Hartley Sweeten, Linux Kernel, devel, ss, gregkh
On Wed, Jul 21, 2010 at 09:57:16AM +0200, Jiri Slaby wrote:
> On 07/21/2010 02:57 AM, H Hartley Sweeten wrote:
> > The ioctl's DT3155_STOP and DT3155_START are defined with the macro
> > _IO indicating that they have no parameters. They should not be using
> > copy_to_user to return data to user space.
>
> This is not a reason for removing them. You should check what real users
> do/expect and base your reasoning on the top of that.
>
> So could you investigate that?
I agree, we can't remove this, it changes the functionality of the
kernel in a way that userspace might not be expecting.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-22 18:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-21 0:57 [PATCH] Staging: dt3155: Remove copy_to_user for ioctl's DT3155_{STOP|START} H Hartley Sweeten
2010-07-21 7:57 ` Jiri Slaby
2010-07-22 17:55 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox