From aea73db1e3e06ca75509b78a8610e15bfb10d7fe Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Tue, 11 Aug 2015 16:54:45 -0700 Subject: [PATCH] init: add LOCAL_SANITIZE := integer Call abort() on undefined or sketchy integer behavior. Protects against integer overflow attacks. Change-Id: I5f542089753c8fcf7596fd70cfaa48a3caa5b140 --- init/Android.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init/Android.mk b/init/Android.mk index 6737be409..58bff5861 100644 --- a/init/Android.mk +++ b/init/Android.mk @@ -53,6 +53,7 @@ LOCAL_SRC_FILES:= \ LOCAL_STATIC_LIBRARIES := libbase LOCAL_MODULE := libinit +LOCAL_SANITIZE := integer LOCAL_CLANG := true include $(BUILD_STATIC_LIBRARY) @@ -100,6 +101,7 @@ LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \ ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \ ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd +LOCAL_SANITIZE := integer LOCAL_CLANG := true include $(BUILD_EXECUTABLE) @@ -117,5 +119,6 @@ LOCAL_SHARED_LIBRARIES += \ libbase \ LOCAL_STATIC_LIBRARIES := libinit +LOCAL_SANITIZE := integer LOCAL_CLANG := true include $(BUILD_NATIVE_TEST)