Commit graph

1481 commits

Author SHA1 Message Date
Maciej Żenczykowski
b0f95435d6 Merge "use mapRetrieveRO() instead of bpf_obj_get()" am: 81329bd9e9 am: ced7df1d56
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2143733

Change-Id: If8186dd7e94baca7f8c6909871a140e740ffb3f4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-01 20:42:03 +00:00
Maciej Żenczykowski
ced7df1d56 Merge "use mapRetrieveRO() instead of bpf_obj_get()" am: 81329bd9e9
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2143733

Change-Id: I665496a41ad47f083234b98f747f5adb6cadd9f0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-01 20:16:31 +00:00
Maciej Żenczykowski
c1e51cfe15 add missing logging for bpf_obj_pin operation am: d8259aa1e4 am: febb48d501
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2143113

Change-Id: I8f7b6fec1cb7b638c803c3b67308ffd6f22a3331
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-01 20:09:25 +00:00
Maciej Żenczykowski
81329bd9e9 Merge "use mapRetrieveRO() instead of bpf_obj_get()" 2022-07-01 20:01:30 +00:00
Maciej Żenczykowski
febb48d501 add missing logging for bpf_obj_pin operation am: d8259aa1e4
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2143113

Change-Id: I90c8d55f4468f88a2d583efeeffe5f2cc0a9b8c1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-01 19:34:08 +00:00
Maciej Żenczykowski
d8259aa1e4 add missing logging for bpf_obj_pin operation
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ica8c15366c4db12fae1ac14c50fb46a5ab40acff
2022-07-01 17:49:20 +00:00
Maciej Żenczykowski
eb199dd748 use mapRetrieveRO() instead of bpf_obj_get()
bpf_obj_get(path) is entirely equivalent to mapRetrieveRW(path)

See implementation in frameworks/libs/net common/native/bpf_syscall_wrappers/include/BpfSyscallWrappers.h:

inline int bpfFdGet(const char* pathname, uint32_t flag) {
    return bpf(BPF_OBJ_GET, {
                                    .pathname = ptr_to_u64(pathname),
                                    .file_flags = flag,
                            });
}

inline int mapRetrieve(const char* pathname, uint32_t flag) { return bpfFdGet(pathname, flag); }
inline int mapRetrieveRW(const char* pathname) { return mapRetrieve(pathname, 0); }
inline int mapRetrieveRO(const char* pathname) { return mapRetrieve(pathname, BPF_F_RDONLY); }
inline int mapRetrieveWO(const char* pathname) { return mapRetrieve(pathname, BPF_F_WRONLY); }
inline int retrieveProgram(const char* pathname) { return bpfFdGet(pathname, BPF_F_RDONLY); }

However, this requires selinux file:write access which bpfloader
currently lacks, ie. we would need:

system/sepolicy private/bpfloader.te:
  -allow bpfloader bpffs_type:file { create read rename setattr };
  +allow bpfloader bpffs_type:file { create read rename setattr write };

Switching from mapRetrieveRW() to mapRetrieveRO() eliminates this problem.

BpfLoader itself does not need to write to the maps, while bpf program write
access is controlled by a different bit (it is independent of the r/w access
bits of the file descriptor itself).

Verified by re-opening the maps after pinning them.

Bug: 218408035
Bug: 237716689
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ica7ac8ee48d4a73e5f92dbf47cd441c3bfba38cf
2022-07-01 15:56:21 +00:00
Xin Li
724ee6d812 [automerger skipped] DO NOT MERGE - Empty merge of tm-dev-plus-aosp-without-vendor@8763363 am: 29032ee592 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/19090162

Change-Id: I049a1817552932642590974176e300c84f28d099
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-28 01:48:14 +00:00
Xin Li
29032ee592 DO NOT MERGE - Empty merge of tm-dev-plus-aosp-without-vendor@8763363
Merged-In: I553e90e0414453f8f3aaca8cf05d5decc8b911a2
Change-Id: I04571c678c93b87147d7de763b61e36abc679620
2022-06-27 23:25:47 +00:00
Maciej Żenczykowski
83868d22e9 [automerger skipped] bpfloader: add ability to disable btfloader am: bbab818687 am: 8b6b108865 -s ours
am skip reason: Merged-In I553e90e0414453f8f3aaca8cf05d5decc8b911a2 with SHA-1 37b3d06333 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2133348

Change-Id: I1fa112613b2fc0229c58bf145a3b678e84d76873
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-24 19:35:02 +00:00
Maciej Żenczykowski
38b068d821 const-ify mapMatchesExpectations arguments am: 1a7fff3568 am: 9cfd5090df
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2132835

Change-Id: If412c2dd71b58c29c8c00209c3c78e9067ccb573
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-24 19:33:06 +00:00
Maciej Żenczykowski
0333e18c2e Revert "disable bpfloader selinux_context support" am: 687849e52e am: 5fe153224c
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2132534

Change-Id: Ic939e69eca6e8d350eac7fa50071d1555d8eaffa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-24 19:32:51 +00:00
Maciej Żenczykowski
8b6b108865 bpfloader: add ability to disable btfloader am: bbab818687
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2133348

Change-Id: Ifd9eb2b1db1b2c7791847f1609c51b0b335d9b63
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-24 19:15:42 +00:00
Maciej Żenczykowski
9cfd5090df const-ify mapMatchesExpectations arguments am: 1a7fff3568
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2132835

Change-Id: I6f3f19dcd603dc691d597337aa3493d2fb201876
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-24 19:10:13 +00:00
Maciej Żenczykowski
5fe153224c Revert "disable bpfloader selinux_context support" am: 687849e52e
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2132534

Change-Id: Id23888b14b7003775e6dc469fee8b9510b81ad6a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-24 19:08:30 +00:00
Maciej Żenczykowski
bbab818687 bpfloader: add ability to disable btfloader
BTF support was added to bpfloader during Android T dev cycle.

As it causes bpfloader boot time process to shell out to a new
btfloader subprocess for every bpf.o file with BTF debugging
information compiled in, I'm worried this might have unforeseen
consequences - things like crashes or boot time bpfloader cpu
regressions.

However, BTF is exceedingly useful for debugging,
and it would be a huge pity if we were forced to disable it
and keep it disabled in mainline tethering module just to support
Android T devices for the next 5+ years.

It would also be a pity if the bpf.o files in prebuilt mainline
tethering apex in dev branches (like tm-dev) did not include
BTF debug information simply due to compatibility with older
kernels or OSes, since this would require rebuilding the module
everytime BTF information could be of use.

One of the things functioning BTF enables is 'cat /sys/fs/bpf/map_*'
as root on a userdebug build.  Among other things this can be
used to verify that in kernel bpf map state matches that dumped
by the mainline module's pretty dump code.

Even if there's issues wrt. BTF in Android T (or on older kernels),
we can always fix them in Android U or later (for example build
btfloader into bpfloader to avoid exec overhead, etc...).

Bug: 218408035
Bug: 230585250
Bug: 235559605
Test: TreeHugger, cuttlefish devices boots, and:
  adb root && adb shell cat /sys/fs/bpf/map_time_in_state_cpu_last_pid_map
  continues to show information which is available due to BTF debug provided
  in /system/etc/bpf/time_in_state.o file (due to "btf: true" in Android.bp)
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I553e90e0414453f8f3aaca8cf05d5decc8b911a2
(cherry picked from commit 37b3d06333)
Merged-In: I553e90e0414453f8f3aaca8cf05d5decc8b911a2
2022-06-23 16:56:49 -07:00
Maciej Żenczykowski
6571031de6 bpfloader: add ability to disable btfloader am: 37b3d06333
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/19048272

Change-Id: I44542df80cbac47f9dd6080cdfab32da0d792986
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-23 22:43:29 +00:00
Maciej Żenczykowski
1a7fff3568 const-ify mapMatchesExpectations arguments
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1364f7d0426c148e7daeb7df0bbfff7ea12c450e
2022-06-23 13:20:45 +00:00
Maciej Żenczykowski
37b3d06333 bpfloader: add ability to disable btfloader
BTF support was added to bpfloader during Android T dev cycle.

As it causes bpfloader boot time process to shell out to a new
btfloader subprocess for every bpf.o file with BTF debugging
information compiled in, I'm worried this might have unforeseen
consequences - things like crashes or boot time bpfloader cpu
regressions.

However, BTF is exceedingly useful for debugging,
and it would be a huge pity if we were forced to disable it
and keep it disabled in mainline tethering module just to support
Android T devices for the next 5+ years.

It would also be a pity if the bpf.o files in prebuilt mainline
tethering apex in dev branches (like tm-dev) did not include
BTF debug information simply due to compatibility with older
kernels or OSes, since this would require rebuilding the module
everytime BTF information could be of use.

One of the things functioning BTF enables is 'cat /sys/fs/bpf/map_*'
as root on a userdebug build.  Among other things this can be
used to verify that in kernel bpf map state matches that dumped
by the mainline module's pretty dump code.

Even if there's issues wrt. BTF in Android T (or on older kernels),
we can always fix them in Android U or later (for example build
btfloader into bpfloader to avoid exec overhead, etc...).

Bug: 218408035
Bug: 230585250
Bug: 235559605
Test: TreeHugger, cuttlefish devices boots, and:
  adb root && adb shell cat /sys/fs/bpf/map_time_in_state_cpu_last_pid_map
  continues to show information which is available due to BTF debug provided
  in /system/etc/bpf/time_in_state.o file (due to "btf: true" in Android.bp)
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I553e90e0414453f8f3aaca8cf05d5decc8b911a2
2022-06-23 13:08:38 +00:00
Maciej Żenczykowski
0a4fb56218 Revert "disable bpfloader selinux_context support" am: 98ec8cf05b
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/19039232

Change-Id: Ibef2442d3b01614a8ee313485877a7c2b259391d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-23 11:15:50 +00:00
Maciej Żenczykowski
98ec8cf05b Revert "disable bpfloader selinux_context support"
This reverts commit 8e5e239dd0a7856e486a9e2d772ef3a9e38021eb.

No longer required now that selinux change has landed.

(while we're at it bump the bpfloader version to v0.19 just
 to make sure we can tell these apart in the future)

This is a cherrypick to tm-dev of reviewed/approved but unsubmitted:
  https://android-review.googlesource.com/c/platform/system/bpf/+/2132534

Ignore-AOSP-First: will be cherrypicked to aosp master

Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0b3349ef908bbfd225b8b7f83b2a4a8870c1e409
2022-06-22 14:51:58 -07:00
Maciej Żenczykowski
687849e52e Revert "disable bpfloader selinux_context support"
This reverts commit 8e5e239dd0a7856e486a9e2d772ef3a9e38021eb.

No longer required now that selinux change has landed.

(while we're at it bump the bpfloader version to v0.19 just
 to make sure we can tell these apart in the future)

Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0b3349ef908bbfd225b8b7f83b2a4a8870c1e409
2022-06-22 19:15:41 +00:00
Maciej Żenczykowski
8342a26a24 [automerger skipped] disable bpfloader selinux_context support am: a529b323af -s ours
am skip reason: Merged-In Ic27d0e5f3c6b78db39c6742fe9e1955f65d2b1f5 with SHA-1 a7a11bda00 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/19019684

Change-Id: Icd767e7c94cd65478dd8c1856582cde40b3497f5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-22 02:43:52 +00:00
Maciej Żenczykowski
005e8a84e7 [automerger skipped] bpfloader: support 'shared' maps and per-map/program selinux context am: 5ed96f4a1a -s ours
am skip reason: Merged-In I9d7449e477c371053a34191a2a9a935ba927d4b3 with SHA-1 4181713963 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/19019683

Change-Id: I7c5e4f6b29e948ca02df4c77ed3e427a4e3c8043
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-22 02:43:46 +00:00
Maciej Żenczykowski
a529b323af disable bpfloader selinux_context support
(it requires bpfloader to be granted rename priv by selinux)

Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic27d0e5f3c6b78db39c6742fe9e1955f65d2b1f5
(cherry picked from commit a7a11bda00)
Merged-In: Ic27d0e5f3c6b78db39c6742fe9e1955f65d2b1f5
2022-06-21 19:58:42 +00:00
Maciej Żenczykowski
5ed96f4a1a bpfloader: support 'shared' maps and per-map/program selinux context
allow bpf .o files to specify desired selinux context

Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9d7449e477c371053a34191a2a9a935ba927d4b3
(cherry picked from commit 4181713963)
Merged-In: I9d7449e477c371053a34191a2a9a935ba927d4b3
2022-06-21 19:58:41 +00:00
Maciej Żenczykowski
171d699563 disable bpfloader selinux_context support am: a7a11bda00 am: e4fae2c26e
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2132533

Change-Id: I2b934cc11d1fa74e85c444fed92ade972a306038
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-21 18:26:12 +00:00
Maciej Żenczykowski
9cbabeebf9 bpfloader: support 'shared' maps and per-map/program selinux context am: 4181713963 am: cf56c97382
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2115562

Change-Id: Ia2b152d95b5ed42e8ef5cd7db0801c6f211230a3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-21 18:26:10 +00:00
Maciej Żenczykowski
e4fae2c26e disable bpfloader selinux_context support am: a7a11bda00
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2132533

Change-Id: I757e645cb774520d3279fbfd3044e67d7bec3db8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-21 18:07:07 +00:00
Maciej Żenczykowski
cf56c97382 bpfloader: support 'shared' maps and per-map/program selinux context am: 4181713963
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2115562

Change-Id: I4c5dbb9113b661865726b3373c5dbefe02ab0b08
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-21 18:07:06 +00:00
Maciej Żenczykowski
a7a11bda00 disable bpfloader selinux_context support
(it requires bpfloader to be granted rename priv by selinux)

Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic27d0e5f3c6b78db39c6742fe9e1955f65d2b1f5
2022-06-21 09:42:48 -07:00
Maciej Żenczykowski
4181713963 bpfloader: support 'shared' maps and per-map/program selinux context
allow bpf .o files to specify desired selinux context

Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9d7449e477c371053a34191a2a9a935ba927d4b3
2022-06-21 02:23:09 -07:00
Maciej Żenczykowski
f75bcf8283 [automerger skipped] bpfLoader: verify that reused maps are the right type & shape am: 8482e88f9e -s ours
am skip reason: Merged-In I9e8a5893ed4f91354f6544be587b10a97d179de6 with SHA-1 12bb520707 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/18992185

Change-Id: Ifcf82330e5977f9981ef920cad0e590d73a38503
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-21 02:40:06 +00:00
Maciej Żenczykowski
8873ef491d [automerger skipped] add support for 'netd_readonly' am: 14fdd0a4a9 -s ours
am skip reason: Merged-In I72b106692a25077ff54252fd93db81f46b52125d with SHA-1 32c0b8f46e is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/18992184

Change-Id: I8e52450e3619792dc7ababbe04eaee544fb975af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-20 21:02:49 +00:00
Maciej Żenczykowski
04b51e9d64 [automerger skipped] remove spurious newlines in ALOG lines am: 72c3298572 -s ours
am skip reason: Merged-In I2d75f1702c02b72c298642beb62c5df1c2629367 with SHA-1 e626a95e2f is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/18992183

Change-Id: I12eea3bc4bc931d6f1b14489ff4327d96d2ef325
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-20 21:00:30 +00:00
Maciej Żenczykowski
81f88cfc8f [automerger skipped] bpfloader: add support for perf_event program type am: 1d018c1655 -s ours
am skip reason: Merged-In I79a5b084b80a1c423d555d9b63b08f9cd00fa684 with SHA-1 e092e0bbfe is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/18992182

Change-Id: I4a9e6c40b5a90459009c15cc16ee5ae5f687a37f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-20 21:00:27 +00:00
Maciej Żenczykowski
8482e88f9e bpfLoader: verify that reused maps are the right type & shape
This is needed to make it safe to share maps across different .o's.

Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9e8a5893ed4f91354f6544be587b10a97d179de6
(cherry picked from commit 12bb520707)
Merged-In: I9e8a5893ed4f91354f6544be587b10a97d179de6
2022-06-20 17:46:48 +00:00
Maciej Żenczykowski
14fdd0a4a9 add support for 'netd_readonly'
For use by:
- maps netd should have read but not write access to
  (needed due to netd being root with DAC_OVERRIDE,
   and thus not obeying standard unix permissions)
- programs that netd should have access to but
  not netutils_wrappers (which due to being able to
  run iptables, needs access to xt_bpf programs)

Bug: 218408035
Test: booted on cuttlefish
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I72b106692a25077ff54252fd93db81f46b52125d
(cherry picked from commit 32c0b8f46e)
Merged-In: I72b106692a25077ff54252fd93db81f46b52125d
2022-06-20 16:32:18 +00:00
Maciej Żenczykowski
72c3298572 remove spurious newlines in ALOG lines
eliminates empty lines visible in cuttlefish kernel.log

Bug: 218408035
Test: booted on cuttlefish
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2d75f1702c02b72c298642beb62c5df1c2629367
(cherry picked from commit e626a95e2f)
Merged-In: I2d75f1702c02b72c298642beb62c5df1c2629367
2022-06-20 16:27:40 +00:00
Maciej Żenczykowski
1d018c1655 bpfloader: add support for perf_event program type
Based on
  https://android-review.googlesource.com/c/platform/system/bpf/+/2104448

Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I79a5b084b80a1c423d555d9b63b08f9cd00fa684
(cherry picked from commit e092e0bbfe)
Merged-In: I79a5b084b80a1c423d555d9b63b08f9cd00fa684
2022-06-20 16:26:47 +00:00
Maciej Żenczykowski
7d3192bae4 bpfLoader: verify that reused maps are the right type & shape am: 12bb520707 am: efd19a30fd
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2127664

Change-Id: Ica67e807eb419f182122231c97175210b5888c97
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-18 10:10:17 +00:00
Maciej Żenczykowski
efd19a30fd bpfLoader: verify that reused maps are the right type & shape am: 12bb520707
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2127664

Change-Id: Ia3aba46329f94083a5f7660159526075264c89ae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-18 09:48:55 +00:00
Maciej Żenczykowski
ad3780016d add support for 'netd_readonly' am: 32c0b8f46e am: de19a0d3fe
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2127666

Change-Id: I54e1d186564bad92f19a5b246574ce0950495057
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-18 08:27:08 +00:00
Maciej Żenczykowski
55d6c92fa4 remove spurious newlines in ALOG lines am: e626a95e2f am: b9f573a9ec
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2127667

Change-Id: Ie19c931885f39d6f93cfe566c3d1fe56989653e7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-18 08:26:59 +00:00
Maciej Żenczykowski
de19a0d3fe add support for 'netd_readonly' am: 32c0b8f46e
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2127666

Change-Id: I506eb93db0741343b307713f016733be38796d71
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-18 08:09:37 +00:00
Maciej Żenczykowski
b9f573a9ec remove spurious newlines in ALOG lines am: e626a95e2f
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2127667

Change-Id: I75d6ab98035f6f8f9acd12582f9b0119e400c66b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-18 08:09:13 +00:00
Maciej Żenczykowski
12bb520707 bpfLoader: verify that reused maps are the right type & shape
This is needed to make it safe to share maps across different .o's.

Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9e8a5893ed4f91354f6544be587b10a97d179de6
2022-06-18 00:33:31 -07:00
Maciej Żenczykowski
32c0b8f46e add support for 'netd_readonly'
For use by:
- maps netd should have read but not write access to
  (needed due to netd being root with DAC_OVERRIDE,
   and thus not obeying standard unix permissions)
- programs that netd should have access to but
  not netutils_wrappers (which due to being able to
  run iptables, needs access to xt_bpf programs)

Bug: 218408035
Test: booted on cuttlefish
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I72b106692a25077ff54252fd93db81f46b52125d
2022-06-17 18:08:00 -07:00
Maciej Żenczykowski
e626a95e2f remove spurious newlines in ALOG lines
eliminates empty lines visible in cuttlefish kernel.log

Bug: 218408035
Test: booted on cuttlefish
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2d75f1702c02b72c298642beb62c5df1c2629367
2022-06-17 18:07:00 -07:00
Maciej Żenczykowski
fe11460f0d bpfloader: add support for perf_event program type am: e092e0bbfe am: 37a08f76db
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2104864

Change-Id: I66c285c812a5ec267d468a6ca630c6abf2a2f858
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 05:19:58 +00:00