lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y8+8fH52iqQABYs2@andrea>
Date:   Tue, 24 Jan 2023 12:09:48 +0100
From:   Andrea Parri <parri.andrea@...il.com>
To:     "Paul E. McKenney" <paulmck@...nel.org>
Cc:     Alan Stern <stern@...land.harvard.edu>,
        Jonas Oberhauser <jonas.oberhauser@...wei.com>,
        Peter Zijlstra <peterz@...radead.org>, will <will@...nel.org>,
        "boqun.feng" <boqun.feng@...il.com>, npiggin <npiggin@...il.com>,
        dhowells <dhowells@...hat.com>,
        "j.alglave" <j.alglave@....ac.uk>,
        "luc.maranget" <luc.maranget@...ia.fr>, akiyks <akiyks@...il.com>,
        dlustig <dlustig@...dia.com>, joel <joel@...lfernandes.org>,
        urezki <urezki@...il.com>,
        quic_neeraju <quic_neeraju@...cinc.com>,
        frederic <frederic@...nel.org>,
        Kernel development list <linux-kernel@...r.kernel.org>
Subject: Re: Internal vs. external barriers (was: Re: Interesting LKMM litmus
 test)

> There is the one below, but I am (1) not sure that I have it right,
> (2) not immediately certain that the Linux-kernel implementation would
> forbid it, (3) not immediately sure that it should be forbidden.
> 
> In the meantime, thoughts?

As it stands, P0 to completion, then P1 to completion, then P2 to
completion should meet the "exists" clause; I guess we want "x=1"
in the clause (or the values of the stores to "x" exchanged).

  Andrea


> ------------------------------------------------------------------------
> 
> C C-srcu-observed-3
> 
> (*
>  * Result: Sometimes
>  *)
> 
> {}
> 
> P0(int *x, int *y, int *z, struct srcu_struct *s)
> {
> 	int r1;
> 
> 	r1 = srcu_read_lock(s);
> 	WRITE_ONCE(*y, 1);
> 	WRITE_ONCE(*x, 1);
> 	srcu_read_unlock(s, r1);
> }
> 
> P1(int *x, int *y, int *z, struct srcu_struct *s)
> {
> 	int r1;
> 
> 	r1 = READ_ONCE(*y);
> 	synchronize_srcu(s);
> 	WRITE_ONCE(*z, 1);
> }
> 
> P2(int *x, int *y, int *z, struct srcu_struct *s)
> {
> 	WRITE_ONCE(*z, 2);
> 	smp_mb();
> 	WRITE_ONCE(*x, 2);
> }
> 
> exists (1:r1=1 /\ x=2 /\ z=2)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ