Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp964523rwb; Wed, 9 Nov 2022 10:50:16 -0800 (PST) X-Google-Smtp-Source: AMsMyM7ONwq7p6KPMY0Y6Xc6i9snC08DYaGDWBGqu5xLE4x0+QMr4LIcln3b+lcXBp5A0NgdwO2w X-Received: by 2002:a17:903:1c2:b0:187:10f1:9f87 with SMTP id e2-20020a17090301c200b0018710f19f87mr57316234plh.46.1668019816084; Wed, 09 Nov 2022 10:50:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668019816; cv=none; d=google.com; s=arc-20160816; b=Izuae9l6NxvgG5744FH6fnyupPY/5WYvQ1/8goI3WPEiA/BXSFqmu4Kg/sh+jHsnEf w14MAAAJkwZXSD6hCP4MMn3s5MK9AdQMDJYQ83YQ3wgg+VFxq1/3eimyjLEK26tH4/BA aAUL3olKp9LtsduQZMYhG220DbosZUaT9xEv8qo6NKulc2O7MVmFffZz9dQecWO9AdnE PuubvQJvQDzoNMc6u4Hi6DtAYLbOVJkgamNPyOgtqgvoqRCodQ90gSxZT+VxvBl1eOBs y4gfinQuFiQM4ZYrWMOnsgG82mmu2kNFND1BotgaJIBQfCN0TCExGO82hADYeAQvnsGy OvnQ== 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=ItPYV5MGpbYz06RqDDjMdGXegBDTGE0hY2ixKMRRix8=; b=xbZ1oJlUtjmL72TOp0zWCBiCnvkel3zebthcnFqi/fb1d/g1/F3tD17hFOfJaVgl66 Xc+aBGPClXX2C22EMTPHT7Y7C2/ODeTae70YoH6mV+kTC+9g6NvwzwhoRgFG7Lw3DJrw R4QLSbIAHPzLewcXkvCu8Jfye3WOysFGJKwEq8FV5eJ1qlHecyIKuyBD6iPM/iDUOFRI reRTwqg6hErq6+oQmUKA9c/mRGUTNJgx6duay+DJahVyZ6iE/5y7H91dB9l3UvcU3DF6 WoRo6mgF+oKsupmpXGLBf9nlmpzuc57T+szKAvIR1Bt2fuyVwIUF7rjyaXyJRqqra2hc +bhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j62-20020a638041000000b004429ecbda9fsi17718268pgd.39.2022.11.09.10.50.03; Wed, 09 Nov 2022 10:50:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229806AbiKISJL (ORCPT + 92 others); Wed, 9 Nov 2022 13:09:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbiKISJK (ORCPT ); Wed, 9 Nov 2022 13:09:10 -0500 X-Greylist: delayed 1797 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 09 Nov 2022 10:09:09 PST Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:237:300::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D2C81F9C1; Wed, 9 Nov 2022 10:09:08 -0800 (PST) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1osoXb-0004MN-Gj; Wed, 09 Nov 2022 18:07:07 +0100 Date: Wed, 9 Nov 2022 18:07:07 +0100 From: Florian Westphal To: Daniel Xu Cc: pablo@netfilter.org, fw@strlen.de, kadlec@netfilter.org, netfilter-devel@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] netfilter: ctmark: Fix data-races around ctmark Message-ID: <20221109170707.GA18993@breakpoint.cc> References: <22e34710c6e22acc1139b8f8d0a8bd78cf5b64e5.1668012222.git.dxu@dxuuu.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <22e34710c6e22acc1139b8f8d0a8bd78cf5b64e5.1668012222.git.dxu@dxuuu.xyz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Daniel Xu wrote: > index f97bda06d2a9..669561fb73bd 100644 > --- a/net/netfilter/nf_conntrack_core.c > +++ b/net/netfilter/nf_conntrack_core.c > @@ -1781,7 +1781,7 @@ init_conntrack(struct net *net, struct nf_conn *tmpl, > } > > #ifdef CONFIG_NF_CONNTRACK_MARK > - ct->mark = exp->master->mark; > + WRITE_ONCE(ct->mark, READ_ONCE(exp->master->mark)); *ct is owned by the current cpu at this point, so WRITE_ONCE is not needed. Rest looks fine.