netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ipv6: don't use CHECKSUM_PARTIAL on MSG_MORE/UDP_CORK sockets
@ 2015-10-20 14:38 Hannes Frederic Sowa
  2015-10-20 14:55 ` Vlad Yasevich
  2015-10-20 21:39 ` Vlad Yasevich
  0 siblings, 2 replies; 5+ messages in thread
From: Hannes Frederic Sowa @ 2015-10-20 14:38 UTC (permalink / raw)
  To: netdev; +Cc: sd, bcodding, vyasevich, Hannes Frederic Sowa

MSG_MORE might cause the packet to get fragmented in the end when
passed down to the flush function and the transhdrlen check alone is
not sufficient to protect against fragmentation. Instead check if the
socket user intends to add more data to the socket on the first packet.

This broke checksum calculation for UDPv6 for NFS protocols.

Fixes: 32dce968dd987 ("ipv6: Allow for partial checksums on non-ufo packets")
Cc: Vlad Yasevich <vyasevich@gmail.com>
Tested-by: Sabrina Dubroca <sd@quesysnail.net>
Tested-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 net/ipv6/ip6_output.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 61d403e..95c5780 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1317,6 +1317,7 @@ emsgsize:
 	 * sums only work when transhdrlen is set.
 	 */
 	if (transhdrlen && sk->sk_protocol == IPPROTO_UDP &&
+	    !(flags & MSG_MORE) &&
 	    length + fragheaderlen < mtu &&
 	    rt->dst.dev->features & NETIF_F_V6_CSUM &&
 	    !exthdrlen)
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-21 12:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-20 14:38 [PATCH net] ipv6: don't use CHECKSUM_PARTIAL on MSG_MORE/UDP_CORK sockets Hannes Frederic Sowa
2015-10-20 14:55 ` Vlad Yasevich
2015-10-20 21:39 ` Vlad Yasevich
2015-10-21  9:51   ` Hannes Frederic Sowa
2015-10-21 12:52   ` Hannes Frederic Sowa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).