Merge "Make seccomp honor setenforce"
This commit is contained in:
@ -218,6 +218,8 @@ LOCAL_C_INCLUDES += \
|
|||||||
|
|
||||||
LOCAL_STATIC_LIBRARIES := \
|
LOCAL_STATIC_LIBRARIES := \
|
||||||
libseccomp_policy \
|
libseccomp_policy \
|
||||||
|
libselinux \
|
||||||
|
libcrypto \
|
||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES := \
|
LOCAL_SHARED_LIBRARIES := \
|
||||||
libmemtrack \
|
libmemtrack \
|
||||||
|
@ -17,9 +17,16 @@
|
|||||||
#include "core_jni_helpers.h"
|
#include "core_jni_helpers.h"
|
||||||
#include "JniConstants.h"
|
#include "JniConstants.h"
|
||||||
#include "utils/Log.h"
|
#include "utils/Log.h"
|
||||||
|
#include <selinux/selinux.h>
|
||||||
|
|
||||||
#include "seccomp_policy.h"
|
#include "seccomp_policy.h"
|
||||||
|
|
||||||
static void Seccomp_setPolicy(JNIEnv* /*env*/) {
|
static void Seccomp_setPolicy(JNIEnv* /*env*/) {
|
||||||
|
if (security_getenforce() == 0) {
|
||||||
|
ALOGI("seccomp disabled by setenforce 0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!set_seccomp_filter()) {
|
if (!set_seccomp_filter()) {
|
||||||
ALOGE("Failed to set seccomp policy - killing");
|
ALOGE("Failed to set seccomp policy - killing");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Reference in New Issue
Block a user