Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp228888ybt; Tue, 30 Jun 2020 19:23:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNOGlVLrOVp46oQQaR9dyiJw6iAG2jfQfY3KCg7hoSC5Ijs4eh/B+OtP83Np2fh70J0ZCr X-Received: by 2002:a17:906:fcb7:: with SMTP id qw23mr19696380ejb.229.1593570200507; Tue, 30 Jun 2020 19:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593570200; cv=none; d=google.com; s=arc-20160816; b=lnc0916WIh1s1AXt69sjAaVQM8oaJMh8qVBwvpord5f5k/EByA1pfuHpP+/THNs80A czIXbqt4NqLawf1+zAoBXuJHT5tU3Ntbjz6U08+knUgzISGlhejbmz2Sgh6ROx+u60mb lSqNXz4mR7rAASV8HlG3Stfxv+Xk7OQNE3rBopiiOhRfufVNtF4FYYNDvEYwx3Ru+ve6 PycW+JXXaqOGCNXQufdNogBsPDEXhvo1KIndOh2Xm3YsgRUoCFwepjVKoUy0JjrPANto 66x4POHI2oAi26Nsjr+cVNZTb4BqBUXAjIxbRXdJbW67W2W47w6U+Ie4A4YbgSUSgyqX qntg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=wLO7gv1dtrusQfkHA8KAQR7EusUz1EsgESBJTYUVMU8=; b=KcRUf7xbwF6on4ojmVx7ycHIOmdfEp+AX4QazR9FIv4gjamAfNzXif9eFAI7FREFWu X6kuRE+FLFdoRWuva0ItUHEsXqHE3l4Wm6N21IAeBTmRrLg1anU8D1ruu2z/X3q32Sgz V2dHQtRSOFtSQ9AbAES0pU+vNrBsSruui0C78cScYqu/2H9ni5FEMrI/HrCl6yKDxZsx u2QSVvPsqrOeHrNVaS4qMqaxtY+S3YJag4o8ZMAoVptzBKVEFUIjvPX6Fe87WMU5Z7Zd b3/jT3y5CGuvY04Mii9aPlP0DSDy3jWAJL/8DboANi5EyxoCEE1L9M807QzlIaNdtSpa 2gXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g14si2996134ejw.376.2020.06.30.19.22.58; Tue, 30 Jun 2020 19:23:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726756AbgGACWt (ORCPT + 99 others); Tue, 30 Jun 2020 22:22:49 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:35268 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725988AbgGACWs (ORCPT ); Tue, 30 Jun 2020 22:22:48 -0400 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.0.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1jqSOX-0005Pn-Rq; Wed, 01 Jul 2020 12:22:42 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Wed, 01 Jul 2020 12:22:41 +1000 Date: Wed, 1 Jul 2020 12:22:41 +1000 From: Herbert Xu To: Eric Dumazet Cc: Mathieu Desnoyers , David Miller , Linus Torvalds , LKML , netdev , Yuchung Cheng , Jonathan Rajotte-Julien Subject: Re: [regression] TCP_MD5SIG on established sockets Message-ID: <20200701022241.GA7167@gondor.apana.org.au> References: <20200701020211.GA6875@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 30, 2020 at 07:17:46PM -0700, Eric Dumazet wrote: > > The main issue of the prior code was the double read of key->keylen in > tcp_md5_hash_key(), not that few bytes could change under us. > > I used smp_rmb() to ease backports, since old kernels had no > READ_ONCE()/WRITE_ONCE(), but ACCESS_ONCE() instead. If it's the double-read that you're protecting against, you should just use barrier() and the comment should say so too. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt