Re: [syzbot] [bpf?] KCSAN: data-race in bpf_percpu_array_update / bpf_percpu_array_update (2)
From: Daniel Borkmann
Date: Tue Aug 29 2023 - 16:55:44 EST
On 8/29/23 10:36 PM, Marco Elver wrote:
[...]
In this case, maybe data_race(*ldst++ = *lsrc++) would be more
appropriate and efficient. Unlikely that READ_ONCE()/WRITE_ONCE() here
helps make this any safer, i.e. the memcpy is still not atomic and if
it's a bug on the user's side, it'll corrupt data either way.
I wasn't aware of data_race(), thanks for the suggestion! Just flushed out
a small patch.
Thanks,
Daniel