init: add LOCAL_SANITIZE := integer

Call abort() on undefined or sketchy integer behavior.
Protects against integer overflow attacks.

Change-Id: If73e6b382f2ee645fec406805739f9684ddbb5f0
This commit is contained in:
Nick Kralevich 2015-08-15 15:24:23 +00:00
parent c307b5b7f8
commit f90b653667

View file

@ -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)