angler-fishThe Vulnerability History Project

bpf: Implement BPF ring buffer and verifier support for it

      This commit adds a new MPSC ring buffer implementation into BPF ecosystem,
which allows multiple CPUs to submit data to a single shared ring buffer. On
the consumption side, only single consumer is assumed.

Motivation
----------
There are two distinctive motivators for this work, which are not satisfied by
existing perf buffer, which prompted creation of a new ring buffer
implementation.
  - more efficient memory utilization by sharing ring buffer across CPUs;
  - preserving ordering of events that happen sequentially in time, even
  across multiple CPUs (e.g., fork/exec/exit events for a task).

These two problems are independent, but perf buffer fails to satisfy both.
Both are a result of a choice to have per-CPU perf ring buffer.  Both can be
also solved by having an MPSC implementation of ring buffer. The ordering
problem could technically be solved for perf buffer with some in-kernel
counting, but given the first one requ
    
commit 457f44363a8894135c85b7a9afd2bd8196db24ab
+13
+1
+4
+83 -1
+1 -1
+10
+501
+12
+146 -49
+10
+83 -1
+2 -2
+2 -2
+3 -3
+1 -1
+2 -2
+1 -1
+3 -3
+4 -4
expand_less