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:	Mon, 11 Jan 2016 08:39:32 -0800
From:	Alexander Duyck <alexander.duyck@...il.com>
To:	Edward Cree <ecree@...arflare.com>
Cc:	Tom Herbert <tom@...bertland.com>,
	David Miller <davem@...emloft.net>,
	Netdev <netdev@...r.kernel.org>, linux-net-drivers@...arflare.com
Subject: Re: [PATCH net-next 7/8] net: ip_tunnel: remove 'csum_help' argument
 to iptunnel_handle_offloads

On Mon, Jan 11, 2016 at 5:24 AM, Edward Cree <ecree@...arflare.com> wrote:
> On 09/01/16 02:05, Alexander Duyck wrote:
>> If we clear skb->encapsulation if we don't have CHECKSUM_PARTIAL set
>> then we don't have the issue.  Really the addition of the line
>> clearing skb->encapsulation should probably be added to the first
>> patch so that we don't leave skb->encapsulation set when we aren't
>> requesting offloads.
> Next version of series will have (in this patch)
>   if (skb->ip_summed != CHECKSUM_PARTIAL) {
>     skb->ip_summed = CHECKSUM_NONE;
>     skb->encapsulation = 0;
>   }
>
> Will that do, or does it need to be squeezed into an earlier patch in the series (which one?)

Your first patch is probably the best place for it.  Then when you
start setting false it doesn't introduce any errors.

Also I was doing a bit more work on the lco_csum function and think I
have come up with something a bit more elegant that allows for the
function to be easily used in the GSO routine for UDP tunnels.  Here
is a snippet from the patch I am working with below.  Odds are the
formatting will get trashed due to my mail client.  What I will do is
email you the full patch and the GSO patch I have as RFCs to look over
and possibly incorporate into your own.

Signed-off-by: Alexander Duyck <aduyck@...antis.com>

---

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 6b6bd42d6134..94244ab47e1b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2161,6 +2161,11 @@ static inline int
skb_checksum_start_offset(const struct sk_buff *skb)
        return skb->csum_start - skb_headroom(skb);
 }

+static inline unsigned char *skb_checksum_start(const struct sk_buff *skb)
+{
+       return skb->head + skb->csum_start;
+}
+
 static inline int skb_transport_offset(const struct sk_buff *skb)
 {
        return skb_transport_header(skb) - skb->data;
@@ -3578,6 +3583,17 @@ static inline __sum16 gso_make_checksum(struct
sk_buff *skb, __wsum res)
        return csum_fold(partial);
 }

+static inline __wsum lco_csum(struct sk_buff *skb)
+{
+       unsigned char *csum_start = skb_checksum_start(skb);
+       unsigned char *l4_hdr = skb_transport_header(skb);
+       __wsum partial;
+
+       partial = ~csum_unfold(*(__force __sum16 *)(csum_start +
+                                                   skb->csum_offset));
+       return csum_partial(l4_hdr, csum_start - l4_hdr, partial);
+}
+
 static inline bool skb_is_gso(const struct sk_buff *skb)
 {
        return skb_shinfo(skb)->gso_size;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ