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]
Message-ID: <3a081c39-7999-ac80-10bd-8dfc6e3bc814@gmail.com>
Date:   Tue, 5 Mar 2019 08:48:48 -0700
From:   David Ahern <dsahern@...il.com>
To:     Peter Oskolkov <posk@...gle.com>,
        David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
        Willem de Bruijn <willemb@...gle.com>
Cc:     Peter Oskolkov <posk@...k.io>
Subject: Re: [PATCH net-next (fix) 1/2] net: fix GSO in bpf_lwt_push_ip_encap

On 3/4/19 5:27 PM, Peter Oskolkov wrote:
> GSO needs inner headers and inner protocol set properly to work.
> 
> skb->inner_mac_header: skb_reset_inner_headers() assigns the current
> mac header value to inner_mac_header; but it is not set at the point,
> so we need to call skb_reset_inner_mac_header, otherwise gre_gso_segment
> fails: it does
> 
>     int tnl_hlen = skb_inner_mac_header(skb) - skb_transport_header(skb);
>     ...
>     if (unlikely(!pskb_may_pull(skb, tnl_hlen)))
>     ...
> 
> skb->inner_protocol should also be correctly set.
> 
> Fixes: ca78801a81e0 ("bpf: handle GSO in bpf_lwt_push_encap")
> Signed-off-by: Peter Oskolkov <posk@...gle.com>
> ---
>  net/core/lwt_bpf.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
> index cf2f8897ca19..126d31ff5ee3 100644
> --- a/net/core/lwt_bpf.c
> +++ b/net/core/lwt_bpf.c
> @@ -625,6 +625,8 @@ int bpf_lwt_push_ip_encap(struct sk_buff *skb, void *hdr, u32 len, bool ingress)
>  
>  	/* push the encap headers and fix pointers */
>  	skb_reset_inner_headers(skb);
> +	skb_reset_inner_mac_header(skb);  /* mac header is not yet set */
> +	skb_set_inner_protocol(skb, skb->protocol);

right, I should have remember that from an mpls change (48d2ab609b6bb).

Reviewed-by: David Ahern <dsahern@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ