aboutsummaryrefslogtreecommitdiff
path: root/scripts/bpf_doc.py
diff options
context:
space:
mode:
authorEric Biggers <[email protected]>2021-12-20 16:41:56 -0600
committerJason A. Donenfeld <[email protected]>2022-01-07 00:25:25 +0100
commit5d73d1e320c3fd94ea15ba5f79301da9a8bcc7de (patch)
tree3afcc8fcd066d926a5b358b853df7c35e3611300 /scripts/bpf_doc.py
parent5320eb42dec7a7ef3ab7da3c5c0d7f889a5181e5 (diff)
random: fix data race on crng_node_pool
extract_crng() and crng_backtrack_protect() load crng_node_pool with a plain load, which causes undefined behavior if do_numa_crng_init() modifies it concurrently. Fix this by using READ_ONCE(). Note: as per the previous discussion https://lore.kernel.org/lkml/[email protected]/T/#u, READ_ONCE() is believed to be sufficient here, and it was requested that it be used here instead of smp_load_acquire(). Also change do_numa_crng_init() to set crng_node_pool using cmpxchg_release() instead of mb() + cmpxchg(), as the former is sufficient here but is more lightweight. Fixes: 1e7f583af67b ("random: make /dev/urandom scalable for silly userspace programs") Cc: [email protected] Signed-off-by: Eric Biggers <[email protected]> Acked-by: Paul E. McKenney <[email protected]> Signed-off-by: Jason A. Donenfeld <[email protected]>
Diffstat (limited to 'scripts/bpf_doc.py')
0 files changed, 0 insertions, 0 deletions