From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39BC63A262 for ; Fri, 10 Nov 2023 19:44:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="o3I8vKDi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38C95C433C8; Fri, 10 Nov 2023 19:44:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699645451; bh=gMTNMcFdUq6GUBvKFbLUH+ZN2QErP8+dG8hYixvB3TA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=o3I8vKDiIJbvJIlfTxeM04d6iidiBy5EncXrF1n5tTzEf70QY2Mg6nol/AzqQIPCs XhKpKpuC15SU0q44aaz/keJvpj4yO+s7wburNS1Xk0IWYFMQiE5QcXGRvSVNpDQ/8O OGD1qaqKNZnjwdca6yFY3rE44LR1CrzuqLcROCO1Rjb53jmjgWowfTbyhFy1y9sIDQ VAZ/nwzggdy6J1n5dJax4v7zbTiBV2Oz+VxsMC64+6JE9g7UIhRDE3UwcN7ZJf0RcB yPWG1rznN3awtPrArA3r/gdm5FNalYwN6rv4bfjoThxcRppUN76b7pieDExFQimcaD 0W6J0IlSLHW5g== Date: Fri, 10 Nov 2023 11:44:10 -0800 From: Jakub Kicinski To: "Dae R. Jeong" Cc: borisp@nvidia.com, john.fastabend@gmail.com, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ywchoi@casys.kaist.ac.kr Subject: Re: [PATCH] tls: fix missing memory barrier in tls_init Message-ID: <20231110114410.01cd3eb3@kernel.org> In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 10 Nov 2023 19:57:23 +0900 Dae R. Jeong wrote: > + mutex_init(&ctx->tx_lock); > + ctx->sk_proto = READ_ONCE(sk->sk_prot); > + ctx->sk = sk; > ctx->tx_conf = TLS_BASE; > ctx->rx_conf = TLS_BASE; TLS_BASE is 0, so there's no strong reason to move the rcu assign after *x_conf init. It's already 0. You can replace the assignment with WARN_ON(ctx->tx_conf != TLS_BASE) to make sure, and move that into tls_ctx_create() instead of removing that function. FWIW make sure you read this before posting v2: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html