commit | 717b44749a54149f2ef55e4f78301dfb997a2e40 | [log] [tgz] |
---|---|---|
author | Kalesh Singh <kaleshsingh@google.com> | Wed Oct 30 14:31:49 2024 -0700 |
committer | Kalesh Singh <kaleshsingh@google.com> | Tue Nov 12 20:47:47 2024 +0000 |
tree | 9ad524128fc90a313c2ac49ea9fc2b71d6d0e9d4 | |
parent | 2f6d6421adf382f7ffcae8769e14c0141bbc2e40 [diff] |
bpf: Ringbuf: Ensure we acquire load the length for the ring buf entry The kernel updates the length with xchg() which does a memory barrier, on the kernel side when the data is actually committed to the ring buffer [1]. On the user space side the volatile is not sufficient to prevent the data read from being reordered before the load of length. [1]https://github.com/torvalds/linux/blob/a20971c187522f5a7cd8e961e7e9c88f31ea2bed/kernel/bpf/ringbuf.c#L484 Bug: 374722456 Bug: 368624834 Bug: 376536942 Change-Id: I75eee3deee2afce83c1b760e6df383375f926ebb Signed-off-by: Kalesh Singh <kaleshsingh@google.com>