lkml.org 
[lkml]   [2023]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Missing a write memory barrier in tls_init()
On Tue, 7 Nov 2023 23:45:46 +0100 Sabrina Dubroca wrote:
> Wouldn't it be enough to just move the rcu_assign_pointer after ctx is
> fully initialized, ie just before update_sk_prot? also clearer wrt
> RCU.

I'm not sure, IIUC rcu_assign_pointer() is equivalent to
WRITE_ONCE() on any sane architecture, it depends on address
dependencies to provide ordering. Since here we care about
ctx->sk_prot being updated, when changes to sk->sk_prot
are visible there is no super-obvious address dependency.

There may be one. But to me at least it isn't an obvious
"RCU used right will handle this" case.

> (and maybe get rid of tls_ctx_create and move all that into tls_init,
> it's not much and we don't even set ctx->{tx,rx}_conf in there)

\
 
 \ /
  Last update: 2023-11-20 13:52    [W:0.087 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site