Merge changes I60250d10,I08effe32 into oc-mr1-dev

* changes:
  init: fix type of 2nd argument passed to prctl
  init: only use signed-integer-overflow sanitizer
This commit is contained in:
TreeHugger Robot 2017-07-28 00:47:54 +00:00 committed by Android (Google) Code Review
commit 8e5c465ee7
3 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@ cc_defaults {
name: "init_defaults",
cpp_std: "experimental",
sanitize: {
misc_undefined: ["integer"],
misc_undefined: ["signed-integer-overflow"],
},
cppflags: [
"-DLOG_UEVENTS=0",

View File

@ -96,6 +96,6 @@ 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_SANITIZE := signed-integer-overflow
LOCAL_CLANG := true
include $(BUILD_EXECUTABLE)

View File

@ -245,8 +245,8 @@ void Service::SetProcessAttributes() {
if (capabilities_.any() && uid_) {
// If Android is running in a container, some securebits might already
// be locked, so don't change those.
int64_t securebits = prctl(PR_GET_SECUREBITS);
if (securebits == -1) {
unsigned long securebits = prctl(PR_GET_SECUREBITS);
if (securebits == -1UL) {
PLOG(FATAL) << "prctl(PR_GET_SECUREBITS) failed for " << name_;
}
securebits |= SECBIT_KEEP_CAPS | SECBIT_KEEP_CAPS_LOCKED;