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]
Date:   Thu, 6 Jun 2019 21:42:33 +0800
From:   Herbert Xu <herbert@...dor.apana.org.au>
To:     "Paul E. McKenney" <paulmck@...ux.ibm.com>
Cc:     rcu@...r.kernel.org, linux-kernel@...r.kernel.org,
        mingo@...nel.org, jiangshanlai@...il.com, dipankar@...ibm.com,
        akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
        josh@...htriplett.org, tglx@...utronix.de, peterz@...radead.org,
        rostedt@...dmis.org, dhowells@...hat.com, edumazet@...gle.com,
        fweisbec@...il.com, oleg@...hat.com, joel@...lfernandes.org,
        torvalds@...ux-foundation.org
Subject: Re: [PATCH RFC tip/core/rcu] Restore barrier() to rcu_read_lock()
 and rcu_read_unlock()

On Thu, Jun 06, 2019 at 06:19:33AM -0700, Paul E. McKenney wrote:
> Commit bb73c52bad36 ("rcu: Don't disable preemption for Tiny and Tree
> RCU readers") removed the barrier() calls from rcu_read_lock() and
> rcu_write_lock() in CONFIG_PREEMPT=n&&CONFIG_PREEMPT_COUNT=n kernels.
> Within RCU, this commit was OK, but it failed to account for things like
> get_user() that can pagefault and that can be reordered by the compiler.
> Lack of the barrier() calls in rcu_read_lock() and rcu_read_unlock()
> can cause these page faults to migrate into RCU read-side critical
> sections, which in CONFIG_PREEMPT=n kernels could result in too-short
> grace periods and arbitrary misbehavior.  Please see commit 386afc91144b
> ("spinlocks and preemption points need to be at least compiler barriers")
> for more details.
> 
> This commit therefore restores the barrier() call to both rcu_read_lock()
> and rcu_read_unlock().  It also removes them from places in the RCU update
> machinery that used to need compensatory barrier() calls, effectively
> reverting commit bb73c52bad36 ("rcu: Don't disable preemption for Tiny
> and Tree RCU readers").
> 
> Reported-by: Herbert Xu <herbert@...dor.apana.org.au>
> Reported-by: Linus Torvalds <torvalds@...ux-foundation.org>
> Signed-off-by: Paul E. McKenney <paulmck@...ux.ibm.com>

Paul, Linus has already commited his patch:

commit 66be4e66a7f422128748e3c3ef6ee72b20a6197b
Author: Linus Torvalds <torvalds@...ux-foundation.org>
Date:   Mon Jun 3 13:26:20 2019 -0700

    rcu: locking and unlocking need to always be at least barriers

So you'll need to rebase this.

Thanks,
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Powered by blists - more mailing lists