Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C07C9C28CC0 for ; Thu, 30 May 2019 18:51:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9F22526020 for ; Thu, 30 May 2019 18:51:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726355AbfE3Svz (ORCPT ); Thu, 30 May 2019 14:51:55 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:57498 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725961AbfE3Svz (ORCPT ); Thu, 30 May 2019 14:51:55 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id C8A9514D9DAB4; Thu, 30 May 2019 11:51:54 -0700 (PDT) Date: Thu, 30 May 2019 11:51:54 -0700 (PDT) Message-Id: <20190530.115154.102635044166921930.davem@davemloft.net> To: herbert@gondor.apana.org.au Cc: edumazet@google.com, netdev@vger.kernel.org, eric.dumazet@gmail.com, syzkaller@googlegroups.com Subject: Re: [PATCH] inet: frags: Remove unnecessary smp_store_release/READ_ONCE From: David Miller In-Reply-To: <20190529054026.fwcyhzt33dshma4h@gondor.apana.org.au> References: <20190528063403.ukfh37igryq4u2u6@gondor.apana.org.au> <20190529054026.fwcyhzt33dshma4h@gondor.apana.org.au> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 30 May 2019 11:51:55 -0700 (PDT) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Herbert Xu Date: Wed, 29 May 2019 13:40:26 +0800 > The smp_store_release call in fqdir_exit cannot protect the setting > of fqdir->dead as claimed because its memory barrier is only > guaranteed to be one-way and the barrier precedes the setting of > fqdir->dead. > > IOW it doesn't provide any barriers between fq->dir and the following > hash table destruction. > > In fact, the code is safe anyway because call_rcu does provide both > the memory barrier as well as a guarantee that when the destruction > work starts executing all RCU readers will see the updated value for > fqdir->dead. > > Therefore this patch removes the unnecessary smp_store_release call > as well as the corresponding READ_ONCE on the read-side in order to > not confuse future readers of this code. Comments have been added > in their places. > > Signed-off-by: Herbert Xu Applied.