Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1268930pxb; Thu, 4 Mar 2021 07:25:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJFueIKwcrzPpZTfrv28ht5R/Yfl07nyuMNAHw1NV1Oxy/sNjlJwcWzE8X1tugusbhMoYb X-Received: by 2002:a17:906:52d0:: with SMTP id w16mr4818825ejn.172.1614871554127; Thu, 04 Mar 2021 07:25:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614871554; cv=none; d=google.com; s=arc-20160816; b=K3TgV7XfpmkE3ivbZlfBeMAntVJPT/WGsUWlcP8cTUdabncP03Emx1c5UinRvC1Pd/ 6yYH40KBeAhQybms1YbDzGKOxsYy2p8kS4iMQrEiOSUDH1br7WrqwMTwHjUjQy1Oj/X9 vVf5mqM047ZR3Kx6I5GjU27WIkHpk4i7AlkgZKoQbHMd33isI7QWAcwVYvj9uYIhE7Gt fEFYr/xwKRxrb4IgQnTehhUly2VuWKnJLTlP+KHRfuiR2nsTUepgI1+wmdugOSGe8jV/ ihzJgk9ULSlQThwyORdCqw8FHzk3lFcyagxn/iM0xd8cxJf6Bc4+SDJfyn0TJnGCKh9n gcQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=1qu41zztfFkduGt4jX0jxD2IZQDkZawfB0HHOQogLe8=; b=GsabEtuT9KtGZnlkBFiNnUb4yXyujhmGqJ3wXZoI9tSOvzWw0YQATHAVteYY4n4YAg B3TF96/AOF7BuPK9N7QxcSJkHwoaY0R5/RG1rxYJQuI6NK5hmGs7y4d2qbxV8QKW0CMP W6QdUv/bkxws3KrxBmPyLOLqTLN2YfZ6OdnwPXqhBsXoNoCci9BLtOlbsZHtjBu16rn6 H+RNQlxe3SHrs3VAp0dAJcTqrq3xqDKWY251hBaiYc2OpPXF7SQK71sWyXbRHNs7m2fO kgqx7QAs89KvlAvQkKSdlSYVJ5A5krJFxDeJyIeXRXI8xF47+OUjyXIh643nHy1gZopA 2plQ== 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 q17si17525443ejy.390.2021.03.04.07.25.30; Thu, 04 Mar 2021 07:25:54 -0800 (PST) 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 S233885AbhCDHrl (ORCPT + 99 others); Thu, 4 Mar 2021 02:47:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233888AbhCDHrb (ORCPT ); Thu, 4 Mar 2021 02:47:31 -0500 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:12e:520::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ACC4C061574; Wed, 3 Mar 2021 23:46:51 -0800 (PST) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1lHih6-0007VN-FI; Thu, 04 Mar 2021 08:46:48 +0100 Date: Thu, 4 Mar 2021 08:46:48 +0100 From: Florian Westphal To: Mark Tomlinson Cc: pablo@netfilter.org, kadlec@netfilter.org, fw@strlen.de, netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] netfilter: x_tables: Use correct memory barriers. Message-ID: <20210304074648.GJ17911@breakpoint.cc> References: <20210304013116.8420-1-mark.tomlinson@alliedtelesis.co.nz> <20210304013116.8420-4-mark.tomlinson@alliedtelesis.co.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210304013116.8420-4-mark.tomlinson@alliedtelesis.co.nz> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mark Tomlinson wrote: > When a new table value was assigned, it was followed by a write memory > barrier. This ensured that all writes before this point would complete > before any writes after this point. However, to determine whether the > rules are unused, the sequence counter is read. To ensure that all > writes have been done before these reads, a full memory barrier is > needed, not just a write memory barrier. The same argument applies when > incrementing the counter, before the rules are read. > > Changing to using smp_mb() instead of smp_wmb() fixes the kernel panic > reported in cc00bcaa5899, Can you reproduce the crashes without this change? > while still maintaining the same speed of replacing tables. How much of an impact is the MB change on the packet path? Please also CC authors of the patches you want reverted when reposting.