lkml.org 
[lkml]   [2004]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectPATCH: 2.6.7-rc3 drivers/usb/core/devio.c: user/kernel pointer bugs
From
Date
Since ctrl is copied in from userspace, ctrl.data cannot safely be 
dereferenced. Let me know if you have any questions or if I've made
a mistake.

Best,
Rob

--- linux-2.6.7-rc3-full/drivers/usb/core/devio.c.orig Wed Jun 9 12:50:34 2004
+++ linux-2.6.7-rc3-full/drivers/usb/core/devio.c Wed Jun 9 12:49:50 2004
@@ -558,7 +558,7 @@ static int proc_control(struct dev_state
if (usbfs_snoop) {
dev_info(&dev->dev, "control read: data ");
for (j = 0; j < ctrl.wLength; ++j)
- printk ("%02x ", (unsigned char)((char *)ctrl.data)[j]);
+ printk ("%02x ", (unsigned char)(tbuf)[j]);
printk("\n");
}
if (copy_to_user(ctrl.data, tbuf, ctrl.wLength)) {
@@ -578,7 +578,7 @@ static int proc_control(struct dev_state
if (usbfs_snoop) {
dev_info(&dev->dev, "control write: data: ");
for (j = 0; j < ctrl.wLength; ++j)
- printk ("%02x ", (unsigned char)((char *)ctrl.data)[j]);
+ printk ("%02x ", (unsigned char)(tbuf)[j]);
printk("\n");
}
i = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), ctrl.bRequest, ctrl.bRequestType,


-
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 14:03    [W:0.064 / U:0.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site