Use kernel sys/fs/fuse/features/fuse_bpf flag to enable fuse_bpf
Bug: 262887267
Test: ro.fuse.bpf.is_running is true
Ignore-AOSP-First: This breaks multiple tests because the rest of
fuse_bpf is not in aosp
Change-Id: I3c41c7a0992803a100a1a7eeecd2c5f57e6085fd
diff --git a/Utils.cpp b/Utils.cpp
index 157b839..bcde4d2 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -1772,15 +1772,18 @@
}
bool IsFuseBpfEnabled() {
- // TODO Once kernel supports flag, trigger off kernel flag unless
- // ro.fuse.bpf.enabled is explicitly set to false
bool enabled;
+ std::string contents;
+
if (base::GetProperty("ro.fuse.bpf.is_running", "") != "")
enabled = base::GetBoolProperty("ro.fuse.bpf.is_running", false);
else if (base::GetProperty("persist.sys.fuse.bpf.override", "") != "")
enabled = base::GetBoolProperty("persist.sys.fuse.bpf.override", false);
- else
+ else if (base::GetProperty("ro.fuse.bpf.enabled", "") != "")
enabled = base::GetBoolProperty("ro.fuse.bpf.enabled", false);
+ else
+ enabled = base::ReadFileToString("/sys/fs/fuse/features/fuse_bpf", &contents) &&
+ contents == "supported\n";
if (enabled) {
base::SetProperty("ro.fuse.bpf.is_running", "true");