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:	Thu, 13 Feb 2014 16:59:19 -0800
From:	Tom Herbert <therbert@...gle.com>
To:	Joseph Gasparakis <joseph.gasparakis@...el.com>
Cc:	Or Gerlitz <or.gerlitz@...il.com>,
	Or Gerlitz <ogerlitz@...lanox.com>,
	David Miller <davem@...emloft.net>,
	Linux Netdev List <netdev@...r.kernel.org>,
	Jerry Chu <hkchu@...gle.com>,
	Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH 2/3] net: UDP gro_receive accept csum=0

>> > But even worse, is there a fundamental issue where udp4_csum_init is able
>> > to change ip_summed to be CHECKSUM_UNNECESSARY (either check == 0
>> > or ip_summed == CHECKSUM_UNNECESSARY) regardless of
>> > skb->encapsulation, sending the packet into encap_rcv which could
>> > ultimately incorrectly apply ip_summed on the inner TCP/UDP packet?
>>
>> By fundamental you mean performance issue or functionality issue (bug) or both?
>>
>
> I would expect the check to be for ip_summed == CHECKSUM_UNNECESSARY. This
> was the original thought behind commit:
>
> 0afb166 vxlan: Add capability of Rx checksum offload for inner packet

It looks like udp4_csum_init turns CHECKSUM_COMPLETE and check==0 into
CHECKSUM_UNNECESSARY which could bypass the checksum validation for
the encapsulated packet. This would be a significant functionality
bug. Unfortunately udp4_csum_init writes ip_summed without regard to
encapsulation.

Seems like the logic in the UDP rcv path should be:

if ip_summed == CHECKSUM_COMPLETE, ensure this is same value when
calling encap_rcv
if ip_summed == CHECKSUM_UNNECESSARY && !skb->encap change to
CHECKSUM_NONE before calling encap_rcv
if ip_summed == CHECKSUM_UNNECESSARY && skb->encap ip_summed value is okay

In any case, we need to consider the orignal ip_summed value from the
driver, not the one that udp4_csum_init (udp_gro or anywhere else in
the path) would set.

Also, udp_gro_receive should be able to handle the case where
ip_summed == CHECKSUM_UNNECESSARY and !skb->encapsulation, that will
be very common scenario. Probably CHECKSUM_NONE also.
--
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