Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751340AbdGQHvl (ORCPT ); Mon, 17 Jul 2017 03:51:41 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35080 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751268AbdGQHvk (ORCPT ); Mon, 17 Jul 2017 03:51:40 -0400 Message-ID: <1500277896.5566.10.camel@edumazet-glaptop3.roam.corp.google.com> Subject: Re: [PATCH] ipv6: initialize treq->txhash in cookie_v6_check() From: Eric Dumazet To: Alexander Potapenko Cc: dvyukov@google.com, kcc@google.com, edumazet@google.com, davem@davemloft.net, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Date: Mon, 17 Jul 2017 00:51:36 -0700 In-Reply-To: <1500277145.5566.7.camel@edumazet-glaptop3.roam.corp.google.com> References: <20170714165453.112098-1-glider@google.com> <1500277145.5566.7.camel@edumazet-glaptop3.roam.corp.google.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1209 Lines: 36 On Mon, 2017-07-17 at 00:39 -0700, Eric Dumazet wrote: > On Fri, 2017-07-14 at 18:54 +0200, Alexander Potapenko wrote: > > KMSAN reported use of uninitialized memory in skb_set_hash_from_sk(), > > which originated from the TCP request socket created in > > cookie_v6_check(): > > > ================================================================== > > > > Signed-off-by: Alexander Potapenko > > --- > > net/ipv6/syncookies.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c > > index 7b75b0620730..b4b354502c6e 100644 > > --- a/net/ipv6/syncookies.c > > +++ b/net/ipv6/syncookies.c > > @@ -216,6 +216,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) > > treq->rcv_isn = ntohl(th->seq) - 1; > > treq->snt_isn = cookie; > > treq->ts_off = 0; > > + treq->txhash = 0; > > > > /* > > * We need to lookup the dst_entry to get the correct window size. > > Please use net_tx_rndhash() instead of 0, thanks. > > ( And same fix is needed for IPv4, as Neal mentioned already ) Also please add the following tag. Fixes: 58d607d3e52f ("tcp: provide skb->hash to synack packets") Thanks again !