[Bug 544527] Re: usbfs is bugged with > and <=2.6.33 (breaks VMWare, Qemu, sane scanners, ...)

David Kühling 544527 at bugs.launchpad.net
Tue Jul 13 15:14:05 UTC 2010

This bugfix is incomplete.  Isochronous transfers are still broken, when
running 32-bit software on a 64-bit kernel.  Function
processcompl_compat() in devio.c needs a similar fix to the fix that was
applied to processcompl().  Looking at processcompl_compat() I see:

	if (as->userbuffer && urb->actual_length)
		if (copy_to_user(as->userbuffer, urb->transfer_buffer,
			return -EFAULT;

correct code would be something like

	if (as->userbuffer && urb->actual_length) {
		if (urb->number_of_packets > 0)		/* Isochronous */
			i = urb->transfer_buffer_length;
		else					/* Non-Isoc */
			i = urb->actual_length;
		if (copy_to_user(as->userbuffer, urb->transfer_buffer, i))
			goto err_out;

(note the difference between urb->actual_length and

With kernel 2.6.32-23-generic x86_64 on Ubuntu 10.04, using proprietary
USB-hardware hooked up to the USB bus (with software compiled for
32-bit), I can directly observe how isochronous transfers retrieved via
ioctl(.. USBDEVFS_REAPURB ..) are too short, i.e. the kernel does not
write the end of the data packet to the supplied buffer.  Booting on the
2.6.31 kernel still present from before I upgraded from Ubuntu 9.10, the
same software runs flawlessly.

As a workaround I'll use the older kernel for now (also I could compile
for 64-bit, actually...).



usbfs is bugged with > and <=2.6.33 (breaks VMWare, Qemu, sane scanners, ...)
You received this bug notification because you are a member of Kernel
Bugs, which is subscribed to linux in ubuntu.

More information about the kernel-bugs mailing list