Revert "NetBpfLoad: gently enable mainline"
This reverts commit 231598bc92.
This is targetting mainline release M-2024-09.
Note: left the failure message in netbpfload/netbpfload.33rc
to mention 'netbpfload-failed' and not 'bpfloader-failed'.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iaf99360a215b1a74bda457ed55b7f56a5a3f2b48
This commit is contained in:
parent
4d6d7aafe8
commit
2afffc2d6a
10 changed files with 9 additions and 32 deletions
|
|
@ -76,4 +76,3 @@ DEFINE_NETD_RO_BPF_PROG("bind6/block_port", bind6_block_port, KVER_4_19)
|
|||
LICENSE("Apache 2.0");
|
||||
CRITICAL("ConnectivityNative");
|
||||
DISABLE_BTF_ON_USER_BUILDS();
|
||||
DISABLE_ON_MAINLINE_BEFORE_U_QPR3();
|
||||
|
|
|
|||
|
|
@ -431,4 +431,3 @@ DEFINE_BPF_PROG("schedcls/egress4/clat_rawip", AID_ROOT, AID_SYSTEM, sched_cls_e
|
|||
LICENSE("Apache 2.0");
|
||||
CRITICAL("Connectivity");
|
||||
DISABLE_BTF_ON_USER_BUILDS();
|
||||
DISABLE_ON_MAINLINE_BEFORE_U_QPR3();
|
||||
|
|
|
|||
|
|
@ -239,4 +239,3 @@ DEFINE_BPF_PROG_KVER("schedcls/set_dscp_ether", AID_ROOT, AID_SYSTEM, schedcls_s
|
|||
LICENSE("Apache 2.0");
|
||||
CRITICAL("Connectivity");
|
||||
DISABLE_BTF_ON_USER_BUILDS();
|
||||
DISABLE_ON_MAINLINE_BEFORE_U_QPR3();
|
||||
|
|
|
|||
|
|
@ -757,4 +757,3 @@ DEFINE_NETD_V_BPF_PROG_KVER("setsockopt/prog", AID_ROOT, AID_ROOT, setsockopt_pr
|
|||
LICENSE("Apache 2.0");
|
||||
CRITICAL("Connectivity and netd");
|
||||
DISABLE_BTF_ON_USER_BUILDS();
|
||||
DISABLE_ON_MAINLINE_BEFORE_U_QPR3();
|
||||
|
|
|
|||
|
|
@ -878,4 +878,3 @@ DEFINE_XDP_PROG("xdp/tether_upstream_rawip",
|
|||
LICENSE("Apache 2.0");
|
||||
CRITICAL("Connectivity (Tethering)");
|
||||
DISABLE_BTF_ON_USER_BUILDS();
|
||||
DISABLE_ON_MAINLINE_BEFORE_U_QPR3();
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@
|
|||
// BTF is incompatible with bpfloaders < v0.10, hence for S (v0.2) we must
|
||||
// ship a different file than for later versions, but we need bpfloader v0.25+
|
||||
// for obj@ver.o support
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_MAINLINE_T_VERSION
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_OBJ_AT_VER_VERSION
|
||||
#else /* MAINLINE */
|
||||
// The resulting .o needs to load on the Android S bpfloader
|
||||
// The resulting .o needs to load on the Android S & T bpfloaders
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_S_VERSION
|
||||
#define BPFLOADER_MAX_VER BPFLOADER_T_VERSION
|
||||
#define BPFLOADER_MAX_VER BPFLOADER_OBJ_AT_VER_VERSION
|
||||
#endif /* MAINLINE */
|
||||
|
||||
// Warning: values other than AID_ROOT don't work for map uid on BpfLoader < v0.21
|
||||
|
|
|
|||
|
|
@ -1124,20 +1124,11 @@ int loadProg(const char* const elfPath, bool* const isCritical, const unsigned i
|
|||
readSectionUint("bpfloader_max_ver", elfFile, DEFAULT_BPFLOADER_MAX_VER);
|
||||
unsigned int bpfLoaderMinRequiredVer =
|
||||
readSectionUint("bpfloader_min_required_ver", elfFile, 0);
|
||||
unsigned int netBpfLoadMinVer =
|
||||
readSectionUint("netbpfload_min_ver", elfFile, 0);
|
||||
size_t sizeOfBpfMapDef =
|
||||
readSectionUint("size_of_bpf_map_def", elfFile, DEFAULT_SIZEOF_BPF_MAP_DEF);
|
||||
size_t sizeOfBpfProgDef =
|
||||
readSectionUint("size_of_bpf_prog_def", elfFile, DEFAULT_SIZEOF_BPF_PROG_DEF);
|
||||
|
||||
// temporary hack to enable gentle enablement of mainline NetBpfLoad
|
||||
if (bpfloader_ver < netBpfLoadMinVer) {
|
||||
ALOGI("NetBpfLoad version %d ignoring ELF object %s with netbpfload min ver %d",
|
||||
bpfloader_ver, elfPath, netBpfLoadMinVer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// inclusive lower bound check
|
||||
if (bpfloader_ver < bpfLoaderMinVer) {
|
||||
ALOGI("BpfLoader version 0x%05x ignoring ELF object %s with min ver 0x%05x",
|
||||
|
|
|
|||
|
|
@ -17,5 +17,5 @@ service mdnsd_netbpfload /apex/com.android.tethering/bin/netbpfload
|
|||
file /dev/kmsg w
|
||||
rlimit memlock 1073741824 1073741824
|
||||
oneshot
|
||||
# TODO: reboot_on_failure reboot,netbpfload-failed
|
||||
reboot_on_failure reboot,netbpfload-failed
|
||||
override
|
||||
|
|
|
|||
|
|
@ -215,25 +215,19 @@ Status BpfHandler::init(const char* cg2_path) {
|
|||
android::bpf::waitForProgsLoaded();
|
||||
}
|
||||
|
||||
if (!mainlineNetBpfLoadDone()) {
|
||||
const bool enforce_mainline = false; // TODO: flip to true
|
||||
|
||||
if (false && !mainlineNetBpfLoadDone()) {
|
||||
// We're on < U QPR3 & it's the first time netd is starting up (unless crashlooping)
|
||||
//
|
||||
// On U QPR3+ netbpfload is guaranteed to run before the platform bpfloader,
|
||||
// so waitForProgsLoaded() implies mainlineNetBpfLoadDone().
|
||||
if (!base::SetProperty("ctl.start", "mdnsd_netbpfload")) {
|
||||
ALOGE("Failed to set property ctl.start=mdnsd_netbpfload, see dmesg for reason.");
|
||||
if (enforce_mainline) abort();
|
||||
abort();
|
||||
}
|
||||
|
||||
if (enforce_mainline) {
|
||||
ALOGI("Waiting for Networking BPF programs");
|
||||
waitForNetProgsLoaded();
|
||||
ALOGI("Networking BPF programs are loaded");
|
||||
} else {
|
||||
ALOGI("Started mdnsd_netbpfload asynchronously.");
|
||||
}
|
||||
ALOGI("Waiting for Networking BPF programs");
|
||||
waitForNetProgsLoaded();
|
||||
ALOGI("Networking BPF programs are loaded");
|
||||
}
|
||||
|
||||
ALOGI("BPF programs are loaded");
|
||||
|
|
|
|||
|
|
@ -117,9 +117,6 @@
|
|||
unsigned _btf_min_bpfloader_ver SECTION("btf_min_bpfloader_ver") = 39u; \
|
||||
unsigned _btf_user_min_bpfloader_ver SECTION("btf_user_min_bpfloader_ver") = 0xFFFFFFFFu
|
||||
|
||||
#define DISABLE_ON_MAINLINE_BEFORE_U_QPR3() \
|
||||
unsigned _netbpfload_min_ver SECTION("netbpfload_min_ver") = BPFLOADER_MAINLINE_U_QPR3_VERSION;
|
||||
|
||||
/* flag the resulting bpf .o file as critical to system functionality,
|
||||
* loading all kernel version appropriate programs in it must succeed
|
||||
* for bpfloader success
|
||||
|
|
|
|||
Loading…
Reference in a new issue