From 4e6bf2510f635fc0fb046eeda8a0a1d5a96a0412 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 4 Sep 2019 20:53:01 -0700 Subject: [PATCH] Remove the global seccomp option. Added in af1a9bfb8f4461ba9a28e4df62a55b054d1eebca, but it's never been used in practice because of the performance impact, and it's incompatible with our ability to add new system calls via a bionic module update because it defaults to disabling all unknown syscalls, and init will still be using the non-updated bootstrap libc from when it first shipped. Test: treehugger Change-Id: I8e396675fcfaf0218a92f464d15e613f43319305 --- init/Android.bp | 1 - init/Android.mk | 1 - init/init.cpp | 13 ------------- 3 files changed, 15 deletions(-) diff --git a/init/Android.bp b/init/Android.bp index 81e7dd970..db8cdcb25 100644 --- a/init/Android.bp +++ b/init/Android.bp @@ -62,7 +62,6 @@ cc_defaults { }, }, static_libs: [ - "libseccomp_policy", "libavb", "libc++fs", "libcgrouprc_format", diff --git a/init/Android.mk b/init/Android.mk index d7258a794..4e73898fe 100644 --- a/init/Android.mk +++ b/init/Android.mk @@ -92,7 +92,6 @@ LOCAL_STATIC_LIBRARIES := \ liblogwrap \ libext4_utils \ libfscrypt \ - libseccomp_policy \ libcrypto_utils \ libsparse \ libavb \ diff --git a/init/init.cpp b/init/init.cpp index e5d103640..4e5f2c18d 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -579,15 +578,6 @@ void HandleKeychord(const std::vector& keycodes) { } } -static void GlobalSeccomp() { - import_kernel_cmdline(false, [](const std::string& key, const std::string& value, - bool in_qemu) { - if (key == "androidboot.seccomp" && value == "global" && !set_global_seccomp_filter()) { - LOG(FATAL) << "Failed to globally enable seccomp!"; - } - }); -} - static void UmountDebugRamdisk() { if (umount("/debug_ramdisk") != 0) { LOG(ERROR) << "Failed to umount /debug_ramdisk"; @@ -673,9 +663,6 @@ int SecondStageMain(int argc, char** argv) { LOG(ERROR) << "Unable to write -1000 to /proc/1/oom_score_adj: " << result.error(); } - // Enable seccomp if global boot option was passed (otherwise it is enabled in zygote). - GlobalSeccomp(); - // Set up a session keyring that all processes will have access to. It // will hold things like FBE encryption keys. No process should override // its session keyring.