Add hidesu program.

This is a test program, this will probably be integrated into su daemon.
This hides su by bind-mounting something (/system) over /sbin, so that
there is no /sbin/su binary.
Usage:
hidesu /proc/<one pid of the namespace>/ns/mnt

This uses the fact that when a program wants access to /sdcard, zygote
does this using mount namespaces, so every program accessing /sdcard
will be in a custom mount namespace, that can be modified.
This commit is contained in:
Pierre-Hugues Husson
2016-09-27 00:08:18 +02:00
committed by topjohnwu
parent 2d6fb1c45e
commit e1279c29c2
2 changed files with 31 additions and 0 deletions

View File

@@ -2,6 +2,15 @@ my_path := $(call my-dir)
LOCAL_PATH := $(my_path)
include $(CLEAR_VARS)
LOCAL_MODULE := hidesu
LOCAL_MODULE_TAGS := optional
LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_LDFLAGS := -static
LOCAL_STATIC_LIBRARIES := libc libcutils
LOCAL_SRC_FILES := hidesu.c
include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
LOCAL_MODULE := bootimgtools
LOCAL_MODULE_TAGS := optional