summaryrefslogtreecommitdiff
path: root/bpfloader
diff options
context:
space:
mode:
authorChenbo Feng <fengc@google.com>2019-04-17 14:33:02 -0700
committerMaciej Żenczykowski <maze@google.com>2019-04-17 21:40:39 +0000
commitb20d28df6a1f49da7038522674c5356fea2bcacf (patch)
tree4ef38413aa7f54910c9a9db9f8dbb9b1655ac669 /bpfloader
parent0a1a9a11d96d937e7563659f92edf04fafa766c9 (diff)
downloadbpf-b20d28df6a1f49da7038522674c5356fea2bcacf.tar.gz
Skip bpf object loading on unsupported devices
The bpfloader should not try to load bpf objects on unsupported devices since devices with 4.4 kernel can have bpf maps but not bpf pogram support. Creating bpf maps on those devices would mislead the framework code to use an unsupported code path and crash system server. Bug: 130687855 Test: cuttlefish boot test for 4.4 kernel. Change-Id: I43ffc01e1099ee3effaa6ba30aa78080d5bec72f
Diffstat (limited to 'bpfloader')
-rw-r--r--bpfloader/BpfLoader.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/bpfloader/BpfLoader.cpp b/bpfloader/BpfLoader.cpp
index 35b84de..01c02cc 100644
--- a/bpfloader/BpfLoader.cpp
+++ b/bpfloader/BpfLoader.cpp
@@ -92,8 +92,10 @@ int main() {
return 0;
}
- // Load all ELF objects, create programs and maps, and pin them
- loadAllElfObjects();
+ if (android::bpf::getBpfSupportLevel() != android::bpf::BpfLevel::NONE) {
+ // Load all ELF objects, create programs and maps, and pin them
+ loadAllElfObjects();
+ }
if (android::base::SetProperty("bpf.progs_loaded", "1") == false) {
ALOGE("Failed to set bpf.progs_loaded property\n");