It doesn't exist in current builds, and we have the vendor bpf loader in C++ to handle /vendor/etc/bpf anyway.
It's unclear how to handle it from rust due to platform vs vendor skew...
Test: TreeHugger
Flag: EXEMPT no-op
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I3ef707399445f91966e747d615dbf828d779a5ae
Maciej Żenczykowskicommited 2025-07-28 17:56:52 -07:00
as all are already present
(while at it add 'inheritance' from a default struct)
Test: TreeHugger
Flag: EXEMPT no-op
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I94258b8f5f8565193bfb688d50422733caf8dbf3
Maciej Żenczykowskicommited 2025-07-28 17:55:20 -07:00
(/etc is a symlink to /system/etc anyway)
Test: TreeHugger
Flag: EXEMPT no-op
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4d5b1b34066b97589779a43b8eaeed785edb611c
Maciej Żenczykowskicommited 2025-07-25 21:28:22 -07:00
(Technically a no-op, since the file doesn't exist yet)
Test: TreeHugger
Flag: EXEMPT no-op
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie72de49e452994a5dca97559d86fa2d7bb4bedcb
Maciej Żenczykowskicommited 2025-07-25 21:01:36 -07:00
since we only support skfilter/ we can simplify this
(support for any future other vendor types should be added to the rust loader)
Test: TreeHugger
Flag: EXEMPT cleanup
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I72ad38c056728ef768ee70bc38471c3e9d368f60
Maciej Żenczykowskicommited 2025-07-16 08:55:36 -07:00
Really just spurious logging code.
If you're working on a device (as opposed to looking at bugreports)
you can get this information with for example 'bpftool':
$ adb shell bpftool map show pinned '/sys/fs/bpf/map_bpfRingbufProg_test_ringbuf'
77: ringbuf name test_ringbuf flags 0x0
key 0B value 0B max_entries 4096 memlock 16696B
$ adb shell bpftool prog show pinned /sys/fs/bpf/vendor/prog_filterPowerSupplyEvents_skfilter_power_supply
82: socket_filter name skfilter_power_ tag b8b4693584760391
loaded_at 2025-07-16T08:44:56-0700 uid 0
xlated 848B jited 470B memlock 4096B
Test: TreeHugger
Flag: EXEMPT cleanup
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie7baf7cf5df9c25ad2d159767584670361e8c6eb
Maciej Żenczykowskicommited 2025-07-16 08:47:49 -07:00
This was primarily meant as a safety check for mainline,
it's not really needed in platform bpf loader.
Test: TreeHugger
Flag: EXEMPT cleanup
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I615f54f10baa75f641129507ecce9159ff31a740
Maciej Żenczykowskicommited 2025-07-16 08:39:23 -07:00
Afterwards we still have:
I BpfLoader: Platform BpfLoader loading critical for healthd ELF object /vendor/etc/bpf/filterPowerSupplyEvents.o with license Apache 2.0
W BpfLoader: No maps section could be found in elf object
D BpfLoader: prog /sys/fs/bpf/vendor/prog_filterPowerSupplyEvents_skfilter_power_supply id 82
$ adbz shell ls -lZ /sys/fs/bpf /sys/fs/bpf/vendor
/sys/fs/bpf:
total 0
...
drwxrwxrwt 2 root root u:object_r:fs_bpf_vendor:s0 0 2025-07-15 23:53 vendor
/sys/fs/bpf/vendor:
total 0
-r--r----- 1 root system u:object_r:fs_bpf_vendor:s0 0 2025-07-15 23:53 prog_filterPowerSupplyEvents_skfilter_power_supply
Test: TreeHugger
Flag: EXEMPT no-op
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I66a6fc3abf8f5c4c52f6a47476c251e97f1f6e14
Maciej Żenczykowskicommited 2025-07-15 23:57:34 -07:00
(while at it remove fuse bpf support, which isn't needed for vendor)
Test: TreeHugger
Flag: EXEMPT no-op
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic7293b94644d933a908a252ab794ae64f88b5865
Maciej Żenczykowskicommited 2025-07-15 23:50:52 -07:00
We want to read this from traced_probes, which is AID_NOBODY. And
SELinux does a far more thorough job of controlling access than Unix
permissions do.
Bug: 422976190
Test: ls -l, and checked WIP traced_probes implementation.
Change-Id: I51a6486c5d7bf85f922f79a89a7a7fbdb9bc79f2
Simon MacMullencommited 2025-06-30 08:54:29 -07:00
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>