The following commit is only in 4.15:
commit cb4d2b3f03d8eed90be3a194e5b54b734ec4bbe9
Author: Martin KaFai Lau <kafai@fb.com>
Date: Wed Sep 27 14:37:52 2017 -0700
bpf: Add name, load_time, uid and map_ids to bpf_prog_info
$ git describe cb4d2b3f03d8eed90be3a194e5b54b734ec4bbe9
v4.14-rc1-661-gcb4d2b3f03d8
Bug: 335390828
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I246a7a8640bea1e939f12f3ffd3fedc25a0a6422
instead of using 'NetBpfLoad' from NetBpfLoad.cpp
and 'NetBpfLoader' from loader.cpp
This will make it easier to filter logcat.
Test: N/A
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibd4e0b04592e8b41cde651c5596ce84bd8893c19
r.android.com/3005052 changed the user id of the bpfloader service to
system, which cut off its access to /dev/kmsg, resulting in its logs
silently being dropped. Give back its access to /dev/kmsg.
See //system/core/init/README.md:
file <path> <type>
Open a file path and pass its fd to the launched process. type must be "r", "w" or "rw". For native executables see libcutils android_get_control_file().
and //system/libbase/logging.cpp's OpenKmsg()
Test: boot sdk_phone64_x86_64, check logs
Change-Id: I65f00545400140983737f3ff92e2c912eebce1fd
(for now for better testing we don't make V special)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id2835bd393c0ec9e1710644681bc5aab0d7d2aae
Note:
2 == BPFLOADER_S_VERSION
19 == BPFLOADER_T_VERSION
25 == BPFLOADER_OBJ_AT_VER_VERSION
33 == BPFLOADER_IGNORED_ON_VERSION
37 == BPFLOADER_U_VERSION [*]
41 == BPFLOADER_V_VERSION [**]
and currently we have:
42 == BPFLOADER_MAINLINE_VERSION
43 == BPFLOADER_MAINLINE_T_VERSION
44 == BPFLOADER_MAINLINE_U_VERSION
45 == BPFLOADER_MAINLINE_V_VERSION
[*] udc-dev/udc-release are actually 38, as 37 was some earlier
udc beta2 (2.1 ifirc), and beta3+ switched to 38
[**] 24Q{1,2}-release (ie. U QPR2+) are technically actually 41,
but their platform bpfloader no longer even looks in /apex/com.android.tethering/etc/bpf/...
so it doesn't really matter (although 24Q1's platform
netbpfload still does, however that is obsoleted by
this change)
Thus we need to (as minimum for NetBpfLoad):
BPFLOADER_T_VERSION -> BPFLOADER_MAINLINE_T_VERSION
BPFLOADER_IGNORED_ON_VERSION -> BPFLOADER_MAINLINE_U_VERSION
to cause these to load appropriately from mainline.
One would perhaps also expect (as minimum for NetBpfLoad):
BPFLOADER_OBJ_AT_VERSION -> BPFLOADER_MAINLINE_U_VERSION
but (as maximum for platform bpfloader):
BPFLOADER_OBJ_AT_VERSION -> BPFLOADER_MAINLINE_U_VERSION
However, since the goal is actually for those to load via mainline on T+,
(with the 'old' version of the .o's loading on S via platform bpfloader)
thus one actually needs (as minimum for NetBpfLoad):
BPFLOADER_OBJ_AT_VERSION -> BPFLOADER_MAINLINE_T_VERSION
and (as maximum for platform bpfloader):
BPFLOADER_OBJ_AT_VERSION -> BPFLOADER_T_VERSION
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4b688692ffca0db7ead20cefd9e7e892ca92c70a
(in preparation for this being run-time dynamic)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Icac8d1afdd3d55b80c232dd5a124a79a9063f350
cannot happen as it only loads mainline code
that it was built (and tested) along side of.
ie. a failure here would cause a TH boot failure.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia350deb10b4e40c9f4f01ea140a0bf97db508086
(instead of going via platform symlink to it)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5ae8105525733788b62f2866fc4eedcce3f51085
(this may well be the last version bump ever)
To get mainline version > any existing platform version.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I20c5dc515b0f94fae2c2fb6f45b6b8907fe7506e
since there is no longer a platform netbpfload...
hence we can simplify
Now:
git grep 'platformNetBpfLoad|apexNetBpfLoad|is_mainline|is_platform'
comes up empty
Test: TreeHugger, manual
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I834656bc4860386b6463db3f6a898d249a05e3a4
This reverts commit e636c61fd7.
Reason for revert: main is now building mainline modules from source
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0fc96a9eda10deed8f2d014fcb6f12a71ba73571
This reverts commit 7f3d748cef.
Reason for revert: Potential cause for Build failures: b/328408957
Change-Id: I2a1e2375429ce1556362d369a97724c829b5aeb6
(since the platform one just execs the apex one anyway)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ied0b890040ad9f6d77042f37cef82ddc47bff936
this is to provide a convenient target for netd to depend on
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5ceda32dbcbe4c0d1b420cc79880f9fe226ac458
(instead of in platform bpfloader)
Better to do it earlier so we can use it for
auto/permanently pinned/attached networking programs.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I202e150e6d48e63ba643c1bd2247cefcdebc07a5
should never fail, since we now have M-2024-1 module prebuilts:
$ adb shell ls -d /apex/com.android.tethering*
/apex/com.android.tethering
/apex/com.android.tethering@341310230
Test: TreeHugger, manually on a Pixel device
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ib145fba8e3c47bc300f4589723d9c80749770a19
(this will land in M-2024-05 ie. May mainline tethering module)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I250b691eb03751da05ce10d41d6721f4964dd1d5
(super useful for debugging)
Sample output:
I NetBpfLoad: NetBpfLoad '/apex/com.android.tethering/bin/netbpfload' starting...
I NetBpfLoad: NetBpfLoad api:10000/34 kver:6010019 platform:0 mainline:1
D NetBpfLoad: Found Tethering Apex mounted from blockdev /dev/block/dm-55
I NetBpfLoad: Tethering APEX version 340090000
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iaf1bc22b02913ea21ff9368abd9933e6ef4017f1
netbpfload.mainline.rc is derived from:
initrc-doc/bpfloader-sdk34-14-U.rc,
except that it is 'override' instead of 'updatable' and uses
the apex netbpfload instead of the platform bpfloader.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1ecf14e3d927ece136a0669a9b209be7112e55b5
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.
For more details please refer to the link below,
<add g3 doc link>
Bug: 304529413
Test: N/A
Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5
proc file writes were only moved from .rc into bpfloader binary in U.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I20eda71d4f4e16130401d1cfff239c7cd8ea9bf6
I think it's better to just put this in bpfloader.rc,
where we can guarantee the correct ordering.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie2c5ab1cb1de015397ac54867ae6bb0c4321d207
No need for this, as we simply only support those selinux
contexts (and directories) which are available to networking.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I35b134c57411f82514b9f7148411f83d3aee1927
(it's already created by the platform bpfloader)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie22f585cab17fd2bded3d97a9cfe1019b792b69d
No need for this, as we simply only support network
program types in the first place.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I163e21fd4d4089882cf37fc68bc4299003b514d7
We are unlikely to ever be willing to load these
program types from mainline, as it is simply too dangerous.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1b0943d39b8131699f4606e8d165f3c944d453ed