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: <CACSApvbBEfDzsY2NCK2xsCK9t4zY5mMQX14SGrtOG7vumZmufw@mail.gmail.com>
Date:   Fri, 29 Mar 2019 15:50:16 -0400
From:   Soheil Hassas Yeganeh <soheil@...gle.com>
To:     Eric Dumazet <edumazet@...gle.com>
Cc:     "David S . Miller" <davem@...emloft.net>,
        netdev <netdev@...r.kernel.org>,
        Eric Dumazet <eric.dumazet@...il.com>,
        Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH net-next] tcp: cleanup sk_tx_skb_cache before reuse

On Fri, Mar 29, 2019 at 3:46 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> TCP stack relies on the fact that a freshly allocated skb
> has skb->cb[] and skb_shinfo(skb)->tx_flags cleared.
>
> When recycling tx skb, we must ensure these fields are cleared.
>
> Fixes: 472c2e07eef0 ("tcp: add one skb cache for tx")
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: Soheil Hassas Yeganeh <soheil@...gle.com>
> Cc: Willem de Bruijn <willemb@...gle.com>

Acked-by: Soheil Hassas Yeganeh <soheil@...gle.com>

Nice catch! Thank you!

> ---
>  net/ipv4/tcp.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index 82bd707c03472f2cebb1a90d5f1c13acc821468f..603e770d59b3db96adca9602319d2f6970a56285 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -872,6 +872,8 @@ struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp,
>                         sk->sk_tx_skb_cache = NULL;
>                         pskb_trim(skb, 0);
>                         INIT_LIST_HEAD(&skb->tcp_tsorted_anchor);
> +                       skb_shinfo(skb)->tx_flags = 0;
> +                       memset(TCP_SKB_CB(skb), 0, sizeof(struct tcp_skb_cb));
>                         return skb;
>                 }
>         }
> --
> 2.21.0.392.gf8f6787159e-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ