lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 24 May 2011 22:25:18 +0200
From:	Németh Márton <nm127@...email.hu>
To:	Greg KH <greg@...ah.com>
CC:	Matthew Wilcox <matthew@....cx>, Matt Mooney <mfm@...eddisk.com>,
	linux-usb@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
	usbip-devel@...ts.sourceforge.net
Subject: Re: USBIP protocol documentation?

Greg KH wrote:
> On Tue, May 24, 2011 at 08:28:13PM +0200, Németh Márton wrote:
>> Hi,
>>
>> I'm looking for the USBIP protocol documentation. I found that
>> there was already a discussion about the USBIP protocol and
>> there is some draft about it:
>>
>>   * http://marc.info/?l=linux-kernel&m=122001863119269&w=2
>>   * http://www.kernel.org/pub/linux/kernel/people/willy/usbip/usbip-protocol-draft-1
>>
>> Unfortunately I couldn't found any detailed protocol documentation
>> on the project homepage:
>>
>>   * http://usbip.sourceforge.net/#documentation
>>
>> Do you know any follow-up on the USBIP protocol documentation?
> 
> I think the code is the "real" documentation.

If it is, then I need to read it in the right way, through it is not an easy task.
I tried to find the points in the USBIP kernel code where opening, sending,
receiving and closing of the TCP connection takes place. I took all function names
from linux/net.h and I found the following places so far:

$ grep -n -E
'sock_wake_async|sock_register|sock_unregister|sock_create|sock_create_kern|sock_create_lite|sock_release|sock_sendmsg|sock_recvmsg|sock_map_fd|sockfd_lookup|sockfd_put|net_ratelimit|kernel_sendmsg|kernel_recvmsg|kernel_bind|kernel_listen|kernel_accept|kernel_connect|kernel_getsockname|kernel_getpeername|kernel_getsockopt|kernel_setsockopt|kernel_sendpage|kernel_sock_ioctl|kernel_sock_shutdown|SHUT_'
linux-2.6/drivers/staging/usbip/*

linux-2.6/drivers/staging/usbip/stub_dev.c:201:         kernel_sock_shutdown(ud->tcp_socket, SHUT_RDWR);
linux-2.6/drivers/staging/usbip/stub_dev.c:216:         sock_release(ud->tcp_socket);
linux-2.6/drivers/staging/usbip/stub_tx.c:263:          ret = kernel_sendmsg(sdev->ud.tcp_socket, &msg,
linux-2.6/drivers/staging/usbip/stub_tx.c:338:          ret = kernel_sendmsg(sdev->ud.tcp_socket, &msg, iov,
linux-2.6/drivers/staging/usbip/usbip_common.c:382:                     result = kernel_sendmsg(sock, &msg, &iov, 1, size);
linux-2.6/drivers/staging/usbip/usbip_common.c:384:                     result = kernel_recvmsg(sock, &msg, &iov, 1, size,
linux-2.6/drivers/staging/usbip/vhci_hcd.c:845:         kernel_sock_shutdown(ud->tcp_socket, SHUT_RDWR);
linux-2.6/drivers/staging/usbip/vhci_hcd.c:858:         sock_release(vdev->ud.tcp_socket);
linux-2.6/drivers/staging/usbip/vhci_tx.c:119:          ret = kernel_sendmsg(vdev->ud.tcp_socket, &msg, iov, 3, txsize);
linux-2.6/drivers/staging/usbip/vhci_tx.c:189:          ret = kernel_sendmsg(vdev->ud.tcp_socket, &msg, iov, 1, txsize);

I guess this is not all, there is also a protocol defined to the user-space world.

> Note a number of developers are actively working on changing the protocol
> and fixing it up based on Matthew's previous comments.  Look at the
> thread on the usbip project's mailing list for a few details.  More will
> be in the patches produced by the developers.

I had a look at the usbip-devel mailing list archive at
http://sourceforge.net/mailarchive/forum.php?forum_name=usbip-devel and found
a thread where I could find some protocol description also:

 * http://sourceforge.net/mailarchive/message.php?msg_id=27240940

The current protocol implementation is based on top of TCP. In the message
at http://marc.info/?l=linux-kernel&m=122001883519653&w=2 the SCTP is mentioned.
Have anybody worked on finding out what benefits the SCTP could give to USBIP
and what would be the drawbacks?

Regards,

	Márton Németh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ