Messages in this thread | | | From | Oliver Neukum <> | Subject | Re: [linux-usb-devel] [PATCH 8/9] USB usbfs: missing lock in proc_getdriver | Date | Wed, 14 Apr 2004 13:04:48 +0200 |
| |
> + down_read(&usb_bus_type.subsys.rwsem); > + if (interface && interface->dev.driver) { > + strncpy(gd.driver, interface->dev.driver->name, sizeof(gd.driver)); > + ret = copy_to_user(arg, &gd, sizeof(gd)) ? -EFAULT : 0; > + } > + up_read(&usb_bus_type.subsys.rwsem); > + return ret;
IMHO you should drop the lock before you copy to userspace.
Regards Oliver
- 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/
| |