On Fri, 2015-10-23 at 15:13 +0200, Hannes Frederic Sowa wrote: > CHECKSUM_PARTIAL should only be used on plain vanilla IPv6 + UDP packets > in ip6_append_data. Some drivers don't correctly handle extension headers, > especially not ipv6 fragmentation which could result in broken checksums. > > 1) This patch improves the test for fragmentation and extension headers > in ip6_append_data, so we set the ip_summed mode as early as possible > to the correct value to compute the checksum during memory copy-in from > user space. > > 2) We always call skb_checksum_help on CHECKSUM_PARTIAL fragments in > ip6_fragment, because we don't know if the underlying hardware can deal > with ip6_fragments. > > Fixes: commit 32dce968dd987 ("ipv6: Allow for partial checksums on non-ufo > packets") > See-also: commit 72e843bb09d45 ("ipv6: ip6_fragment() should check > CHECKSUM_PARTIAL") > Cc: Eric Dumazet <eduma...@google.com> > Cc: Vlad Yasevich <vyasev...@gmail.com> > Cc: Benjamin Coddington <bcodd...@redhat.com> > Signed-off-by: Hannes Frederic Sowa <han...@stressinduktion.org> > --- > net/ipv6/ip6_output.c | 78 > ++++++++++++++++++++++++--------------------------- > 1 file changed, 37 insertions(+), 41 deletions(-) > > diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c > index 8dddb45..26d2911 100644 > --- a/net/ipv6/ip6_output.c > +++ b/net/ipv6/ip6_output.c > @@ -593,6 +593,10 @@ int ip6_fragment(struct sock *sk, struct sk_buff *skb, > frag_id = ipv6_select_ident(net, &ipv6_hdr(skb)->daddr, > &ipv6_hdr(skb)->saddr); > > + if ((skb->ip_summed == CHECKSUM_PARTIAL) && > + (err = skb_checksum_help(skb))) > + goto fail; > + > hroom = LL_RESERVED_SPACE(rt->dst.dev); > if (skb_has_frag_list(skb)) { > int first_len = skb_pagelen(skb); > @@ -721,10 +725,6 @@ slow_path_clean: > } > > slow_path: > - if ((skb->ip_summed == CHECKSUM_PARTIAL) && > - skb_checksum_help(skb)) > - goto fail; > -
It looks like this patch could be split in two, to ease future bisection maybe ? -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html