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:	Fri, 29 Jan 2010 14:30:49 -0800
From:	Sridhar Samudrala <sri@...ibm.com>
To:	Herbert Xu <herbert@...dor.apana.org.au>
CC:	David Miller <davem@...emloft.net>,
	Rusty Russell <rusty@...tcorp.com.au>,
	"Michael S. Tsirkin" <mst@...hat.com>,
	netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next-2.6] packet: Add GSO/checksum offload support
 to af_packet sockets

On 1/29/2010 1:36 PM, Herbert Xu wrote:
> On Fri, Jan 29, 2010 at 01:25:08PM -0800, Sridhar Samudrala wrote:
>    
>> This check is to dis-allow processing of packets with virtio_net_hdr
>> destined for non-ethernet devices.
>> Is it OK if i add a check in packet_bind() to not allow binding to
>> a non-ethernet device when PACKET_VNET_HDR option is set?
>>
>> I need to figure out a way to set the skb protocol correctly based
>> on the packet. Any clues?
>>      
> IMHO the skb protocol should be set by whatever is invoking the
> sendmsg call.  After all they would know what the L2 header is
> and should be able to deduce the protocol correctly.
>    
In this use-case, the component that is calling sendmsg() can be either 
the vhost-net in host kernel
or qemu. They get the buffer including the L2 header from the guest. 
They too need to parse the L2
header to find the protocol.
The packet itself originates from the guest virtio-net driver. but when 
it converts the skb to a virtio-ring
buffer, some of the information in the skb(including protocol and vlan 
info etc) is lost. I guess if we could
re-design, virtio_net_hdr would include this info too. But i think it is 
too late to make any such changes.
So either the callers of sendmsg() or packet_snd() need to parse the L2 
header to get the protocol and
vlan info etc. sendmsg() caller could fill in the protocol, but not the 
vlan info.

Thanks
Sridhar

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ