* [patch] Staging: ft1000-usb: copying to wrong location
@ 2010-11-17 6:55 Dan Carpenter
2010-11-17 8:49 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-11-17 6:55 UTC (permalink / raw)
To: kernel-janitors
We made "dpram_data" a pointer ealier but missed one place which needs
to be changed. It causes a compile error with
CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y
In function ‘copy_from_user’,
inlined from ‘ft1000_ChIoctl’ at
drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c:701:
arch/x86/include/asm/uaccess_32.h:212: error: call to
‘copy_from_user_overflow’ declared with attribute error:
copy_from_user() buffer size is not provably correct
make[4]: *** [drivers/staging/ft1000/ft1000-usb/ft1000_chdev.o] Error 1
Also I initialized "dpram_data" to NULL. That silences a compiler
warning from where we pass uninitialized data to the kfree(dpram_data);
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c b/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
index 20d5098..d546750 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
@@ -650,7 +650,7 @@ static long ft1000_ChIoctl (struct file *File, unsigned int Command,
break;
case IOCTL_SET_DPRAM_CMD:
{
- IOCTL_DPRAM_BLK *dpram_data;
+ IOCTL_DPRAM_BLK *dpram_data = NULL;
//IOCTL_DPRAM_COMMAND dpram_command;
USHORT qtype;
USHORT msgsz;
@@ -698,7 +698,7 @@ static long ft1000_ChIoctl (struct file *File, unsigned int Command,
break;
//if ( copy_from_user(&(dpram_command.dpram_blk), (PIOCTL_DPRAM_BLK)Argument, msgsz+2) ) {
- if ( copy_from_user(&dpram_data, argp, msgsz+2) ) {
+ if (copy_from_user(dpram_data, argp, msgsz + 2)) {
DEBUG("FT1000:ft1000_ChIoctl: copy fault occurred\n");
result = -EFAULT;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] Staging: ft1000-usb: copying to wrong location
2010-11-17 6:55 [patch] Staging: ft1000-usb: copying to wrong location Dan Carpenter
@ 2010-11-17 8:49 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2010-11-17 8:49 UTC (permalink / raw)
To: kernel-janitors
On Wed, Nov 17, 2010 at 09:55:05AM +0300, Dan Carpenter wrote:
> We made "dpram_data" a pointer ealier but missed one place which needs
> to be changed. It causes a compile error with
> CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y
>
Never mind. Steven Rostedt beat me to it.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-17 8:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-17 6:55 [patch] Staging: ft1000-usb: copying to wrong location Dan Carpenter
2010-11-17 8:49 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).