This will allow us to use a genfscon SELinux rule to get finer grained access control.
Bug: 422976190
Test: Recorded a Perfetto trace with statsd atom CPU_CYCLES_PER_UID_CLUSTER, tested manually with go/atomtester.
Change-Id: Ic16da605b9d7150d42176c428f0e1ecaf4a9472f
Simon MacMullencommited 2025-06-26 16:31:52 +00:00
These are now generated by the build system when needed.
Bug: 421990777
Test: m
Change-Id: I961ba203989325e58428a7b3068326fc89debaa8
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Convert readme to markdown; refactor existing descriptions;
add instructions on how to add vmlinux.h for new kernels.
Bug: 421990777
Test: N/A
Change-Id: Idc61221e729d034c5fedb458bd18db02fade713a
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
no need for the complexity, as it is only for vendor now
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia807f7ee8aeca25d92e60e46f180ffe536eef87c
Maciej Żenczykowskicommited 2025-06-17 04:18:41 -07:00
Due to b/424439549, Soong wasn't enforcing that vendor modules could only link against
other vendor modules. Add vendor_available to any modules that are being used by
vendor modules in order to allow re-enabling the error in Soong.
Bug: 424439549
Flag: EXEMPT build only fix
Test: builds
Change-Id: I3aff720d743bc63d4a9f13505b39c55fde90116d
These directories are not populated on real devices
and are not part of the test suite.
This change removes them from the BPF loader.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I719d0feb9ef1a6f0a1e41265af47916410590ac7
Maciej Żenczykowskicommited 2025-06-16 01:28:45 -07:00
Platform BPF programs rely on platform bpf_helpers.h and bpf_map_def.h.
To ensure consistency and correctness, the loader must use these platform
headers instead of those from p/m/Connectivity.
Bug: 424341374
Test: TH
Change-Id: Id5f1bc8fdd29e54c28a3ec9e01f6a9292f6bb9e1
Don't include <linux/bpf.h> if using vmlinux; as this causes
double inclusions.
Bug: 419635765
Test: manual; build and load a CO-RE BPF program
Change-Id: I4419778ea71b65ce46ac5e0e6358c33d7f78b82e
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
(the test is being removed as it tests the obsolete C++
platform bpf loader)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ica990e6fcc0f34374d32946298ae85f86d664dcc
Maciej Żenczykowskicommited 2025-05-23 03:00:08 -07:00
C/C++ platform bpf loader is being replaced by rust version.
This test never had much value, and additional relies on
a sepolicy violation being allowed by su.
The bpf ring buf test is far better.
Test: TreeHugger
Flag: EXEMPT test code removal
Signed-off-by: Maciej Żenczykowski maze@google.com>
Change-Id: I448cc543aa9a0c161515ae2189020bf98db7bca3
Maciej Żenczykowskicommited 2025-05-22 14:10:18 -07:00
Before this CL, the kernel version check occurred after all programs
were loaded by `open_file.load()`.
This CL moves the check before `open_file.load()`. It calls
`prog.set_autoload(false)` for programs incompatible with the current
kernel, preventing their auto-load by libbpf.
Test: Verify the program is not loaded if the kver is out of range
Bug: 410982483
Change-Id: Ifacd9dd8696a7bb4fd186ad1faf01fba9f021c6d
Before this CL, the kernel version check occurred after all maps
were loaded by `open_file.load()`.
This CL moves the check before `open_file.load()`. It calls
`map.set_autocreate(false)` for maps incompatible with the current
kernel, preventing their auto-creation by libbpf.
Test: Verify the map is not loaded if the kver is out of range
Bug: 410982483
Change-Id: I7a102dd2ef4b24f87c6efa5a105848fddc08d501
libbpf creates an array map for the .rodata section to allow BPF
programs to access its data. However, the loader does not need
to pin this map as userspace processes do not require access to it.
This does not break existing code as the legacy bpfloader did not
create a map for .rodata.
Bug: 410982483
Test: TH
Change-Id: I036c93849731c25e8d1b6a2c1778ffc60935bbe2