Re: [RFC] Add BPF_SYNCHRONIZE bpf(2) command

From: Daniel Colascione
Date: Fri Jul 27 2018 - 15:17:43 EST


On Sat, Jul 14, 2018 at 11:18 AM, Joel Fernandes <joel@xxxxxxxxxxxxxxxxx> wrote:
By the way just curious I was briefly going through kernel/bpf/arraymap.c.
How are you protecting against load-store tearing of values of array map
updates/lookups?

For example, if userspace reads an array map at a particular index, while
another CPU is updating it, then userspace can read partial values /
half-updated values right? Since rcu_read_lock is in use, I was hoping to
find something like rcu_assign_pointer there to protect readers against
concurrent updates. Thanks for any clarification.

I'm also curious about the answer to this question.Â