[lkml]   [2020]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] random: use correct memory barriers for crng_node_pool
Eric Biggers <> wrote:
> From: Eric Biggers <>
> When a CPU selects which CRNG to use, it accesses crng_node_pool without
> a memory barrier. That's wrong, because crng_node_pool can be set by
> another CPU concurrently. Without a memory barrier, the crng_state that
> is used might not appear to be fully initialized.

The only architecture that requires a barrier for data dependency
is Alpha. The correct primitive to ensure that barrier is present
is smp_barrier_depends, or you could just use READ_ONCE.

Email: Herbert Xu <>
Home Page:
PGP Key:

 \ /
  Last update: 2020-09-17 10:11    [W:0.103 / U:1.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site