Skip to content
Snippets Groups Projects
Commit 10f9a372 authored by Jean-Baptiste Queru's avatar Jean-Baptiste Queru
Browse files

Merge upstream sepolicy into AOSP

Change-Id: If3ed9998033378de5b47472315444f5b8bd4743e
parents 0c2e5705 1148bc2a
No related branches found
No related tags found
No related merge requests found
ifeq ($(HAVE_SELINUX),true) ifeq ($(HAVE_SELINUX),true)
LOCAL_PATH:= $(call my-dir) LOCAL_PATH:= $(call my-dir)
include $(call all-makefiles-under,$(LOCAL_PATH))
include $(CLEAR_VARS) include $(CLEAR_VARS)
# SELinux policy version. # SELinux policy version.
...@@ -20,6 +23,7 @@ LOCAL_POLICY_FS_USE := $(wildcard $(addsuffix sepolicy.fs_use, $(LOCAL_POLICY_DI ...@@ -20,6 +23,7 @@ LOCAL_POLICY_FS_USE := $(wildcard $(addsuffix sepolicy.fs_use, $(LOCAL_POLICY_DI
LOCAL_POLICY_PORT_CONTEXTS := $(wildcard $(addsuffix sepolicy.port_contexts, $(LOCAL_POLICY_DIRS))) LOCAL_POLICY_PORT_CONTEXTS := $(wildcard $(addsuffix sepolicy.port_contexts, $(LOCAL_POLICY_DIRS)))
LOCAL_POLICY_GENFS_CONTEXTS := $(wildcard $(addsuffix sepolicy.genfs_contexts, $(LOCAL_POLICY_DIRS))) LOCAL_POLICY_GENFS_CONTEXTS := $(wildcard $(addsuffix sepolicy.genfs_contexts, $(LOCAL_POLICY_DIRS)))
LOCAL_POLICY_INITIAL_SID_CONTEXTS := $(wildcard $(addsuffix sepolicy.initial_sid_contexts, $(LOCAL_POLICY_DIRS))) LOCAL_POLICY_INITIAL_SID_CONTEXTS := $(wildcard $(addsuffix sepolicy.initial_sid_contexts, $(LOCAL_POLICY_DIRS)))
LOCAL_POLICY_SC := $(wildcard $(addsuffix seapp_contexts, $(LOCAL_POLICY_DIRS)))
################################## ##################################
include $(CLEAR_VARS) include $(CLEAR_VARS)
...@@ -60,17 +64,26 @@ $(file_contexts): $(LOCAL_PATH)/file_contexts $(LOCAL_POLICY_FC) ...@@ -60,17 +64,26 @@ $(file_contexts): $(LOCAL_PATH)/file_contexts $(LOCAL_POLICY_FC)
$(hide) m4 -s $^ > $@ $(hide) m4 -s $^ > $@
file_contexts := file_contexts :=
################################## ##################################
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := seapp_contexts LOCAL_MODULE := seapp_contexts
LOCAL_SRC_FILES := $(LOCAL_MODULE)
LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_TAGS := optional LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
include $(BUILD_PREBUILT) include $(BUILD_SYSTEM)/base_rules.mk
seapp_contexts.tmp := $(intermediates)/seapp_contexts.tmp
$(seapp_contexts.tmp): $(LOCAL_PATH)/seapp_contexts $(LOCAL_POLICY_SC)
@mkdir -p $(dir $@)
$(hide) m4 -s $^ > $@
$(LOCAL_BUILT_MODULE) : $(seapp_contexts.tmp) $(TARGET_ROOT_OUT)/sepolicy.$(POLICYVERS) $(HOST_OUT_EXECUTABLES)/checkseapp
@mkdir -p $(dir $@)
$(HOST_OUT_EXECUTABLES)/checkseapp -p $(TARGET_ROOT_OUT)/sepolicy.24 -o $@ $<
seapp_contexts.tmp :=
################################## ##################################
include $(CLEAR_VARS) include $(CLEAR_VARS)
......
##
# checkseapp
#
include $(CLEAR_VARS)
LOCAL_MODULE := checkseapp
LOCAL_MODULE_TAGS := optional
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../libsepol/include/
LOCAL_CFLAGS := -DLINK_SEPOL_STATIC
LOCAL_SRC_FILES := check_seapp/check_seapp.c
LOCAL_STATIC_LIBRARIES := libsepol
LOCAL_MODULE_CLASS := EXECUTABLES
include $(BUILD_HOST_EXECUTABLE)
This diff is collapsed.
dhcp.te 0 → 100644
type dhcp, domain;
type dhcp_exec, exec_type, file_type;
type dhcp_data_file, file_type, data_file_type;
type dhcp_system_file, file_type, data_file_type;
init_daemon_domain(dhcp)
allow dhcp cgroup:dir { create add_name };
allow dhcp self:capability { setgid setuid net_admin net_raw };
allow dhcp self:packet_socket { create setopt bind write read };
allow dhcp self:netlink_route_socket { write nlmsg_write read create bind };
allow dhcp self:udp_socket { create ioctl };
allow dhcp shell_exec:file { read open execute };
allow dhcp proc:file write;
allow dhcp property_socket:sock_file write ;
allow dhcp system_prop:property_service set ;
allow dhcp dhcp_system_file:file rx_file_perms;
allow dhcp dhcp_system_file:dir r_dir_perms;
unix_socket_connect(dhcp, property, init)
type_transition dhcp system_data_file:{ dir file } dhcp_data_file;
allow dhcp dhcp_data_file:dir { write add_name search };
...@@ -18,3 +18,4 @@ allow drmserver sdcard:dir search; ...@@ -18,3 +18,4 @@ allow drmserver sdcard:dir search;
allow drmserver drm_data_file:dir create_dir_perms; allow drmserver drm_data_file:dir create_dir_perms;
allow drmserver drm_data_file:file create_file_perms; allow drmserver drm_data_file:file create_file_perms;
allow drmserver self:{ tcp_socket udp_socket } *; allow drmserver self:{ tcp_socket udp_socket } *;
allow drmserver tee_device:chr_file rw_file_perms;
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
/dev/mtd/mtd5ro u:object_r:radio_device:s0 /dev/mtd/mtd5ro u:object_r:radio_device:s0
/dev/mtp_usb u:object_r:mtp_device:s0 /dev/mtp_usb u:object_r:mtp_device:s0
/dev/pn544 u:object_r:nfc_device:s0 /dev/pn544 u:object_r:nfc_device:s0
/dev/ppp u:object_r:ppp_device:s0
/dev/ptmx u:object_r:ptmx_device:s0 /dev/ptmx u:object_r:ptmx_device:s0
/dev/pvrsrvkm u:object_r:powervr_device:s0 /dev/pvrsrvkm u:object_r:powervr_device:s0
/dev/qemu_.* u:object_r:qemu_device:s0 /dev/qemu_.* u:object_r:qemu_device:s0
...@@ -71,6 +72,7 @@ ...@@ -71,6 +72,7 @@
/dev/socket/zygote u:object_r:zygote_socket:s0 /dev/socket/zygote u:object_r:zygote_socket:s0
/dev/spdif_out.* u:object_r:audio_device:s0 /dev/spdif_out.* u:object_r:audio_device:s0
/dev/tegra.* u:object_r:video_device:s0 /dev/tegra.* u:object_r:video_device:s0
/dev/tf_driver u:object_r:tee_device:s0
/dev/tty[0-9]* u:object_r:tty_device:s0 /dev/tty[0-9]* u:object_r:tty_device:s0
/dev/ttyS[0-9]* u:object_r:serial_device:s0 /dev/ttyS[0-9]* u:object_r:serial_device:s0
/dev/uinput u:object_r:input_device:s0 /dev/uinput u:object_r:input_device:s0
...@@ -102,6 +104,12 @@ ...@@ -102,6 +104,12 @@
/system/bin/wpa_supplicant u:object_r:wpa_exec:s0 /system/bin/wpa_supplicant u:object_r:wpa_exec:s0
/system/bin/qemud u:object_r:qemud_exec:s0 /system/bin/qemud u:object_r:qemud_exec:s0
/system/bin/sdcard u:object_r:sdcardd_exec:s0 /system/bin/sdcard u:object_r:sdcardd_exec:s0
/system/bin/dhcpcd u:object_r:dhcp_exec:s0
/system/bin/mtpd u:object_r:mtp_exec:s0
/system/bin/pppd u:object_r:ppp_exec:s0
/system/bin/tf_daemon u:object_r:tee_exec:s0
/system/etc/ppp(/.*)? u:object_r:ppp_system_file:s0
/system/etc/dhcpcd(/.*)? u:object_r:dhcp_system_file:s0
/system/xbin/su u:object_r:su_exec:s0 /system/xbin/su u:object_r:su_exec:s0
/system/vendor/bin/gpsd u:object_r:gpsd_exec:s0 /system/vendor/bin/gpsd u:object_r:gpsd_exec:s0
############################# #############################
...@@ -124,6 +132,7 @@ ...@@ -124,6 +132,7 @@
/data/misc/systemkeys(/.*)? u:object_r:systemkeys_data_file:s0 /data/misc/systemkeys(/.*)? u:object_r:systemkeys_data_file:s0
/data/misc/wifi(/.*)? u:object_r:wifi_data_file:s0 /data/misc/wifi(/.*)? u:object_r:wifi_data_file:s0
/data/misc/camera(/.*)? u:object_r:camera_calibration_file:s0 /data/misc/camera(/.*)? u:object_r:camera_calibration_file:s0
/data/misc/dhcp(/.*)? u:object_r:dhcp_data_file:s0
# App sandboxes # App sandboxes
/data/data/.* u:object_r:app_data_file:s0 /data/data/.* u:object_r:app_data_file:s0
# Wallpaper file. # Wallpaper file.
......
...@@ -12,3 +12,5 @@ type_transition gpsd gps_data_file:sock_file gps_socket; ...@@ -12,3 +12,5 @@ type_transition gpsd gps_data_file:sock_file gps_socket;
allow gpsd gps_socket:sock_file create_file_perms; allow gpsd gps_socket:sock_file create_file_perms;
# XXX Label sysfs files with a specific type? # XXX Label sysfs files with a specific type?
allow gpsd sysfs:file rw_file_perms; allow gpsd sysfs:file rw_file_perms;
allow gpsd gps_device:chr_file rw_file_perms;
...@@ -6,3 +6,4 @@ init_daemon_domain(keystore) ...@@ -6,3 +6,4 @@ init_daemon_domain(keystore)
allow keystore keystore_data_file:dir create_dir_perms; allow keystore keystore_data_file:dir create_dir_perms;
allow keystore keystore_data_file:notdevfile_class_set create_file_perms; allow keystore keystore_data_file:notdevfile_class_set create_file_perms;
allow keystore keystore_exec:file { getattr }; allow keystore keystore_exec:file { getattr };
allow keystore tee_device:chr_file rw_file_perms;
...@@ -42,3 +42,5 @@ allow mediaserver qtaguid_proc:file rw_file_perms; ...@@ -42,3 +42,5 @@ allow mediaserver qtaguid_proc:file rw_file_perms;
allow mediaserver qtaguid_device:chr_file r_file_perms; allow mediaserver qtaguid_device:chr_file r_file_perms;
# Allow abstract socket connection # Allow abstract socket connection
allow mediaserver rild:unix_stream_socket connectto; allow mediaserver rild:unix_stream_socket connectto;
allow mediaserver tee_device:chr_file rw_file_perms;
mtp.te 0 → 100644
# vpn tunneling protocol manager
type mtp, domain;
type mtp_exec, exec_type, file_type;
init_daemon_domain(mtp)
# pptp policy
allow mtp self:tcp_socket { create setopt connect write read };
allow mtp self:socket { create connect };
allow mtp self:rawip_socket create;
allow mtp self:capability net_raw;
allow mtp ppp:process signal;
allow mtp port:tcp_socket name_connect;
ppp.te 0 → 100644
# Point to Point Protocol daemon
type ppp, domain;
type ppp_device, dev_type;
type ppp_exec, exec_type, file_type;
type ppp_system_file, file_type;
domain_auto_trans(mtp, ppp_exec, ppp)
allow ppp mtp:socket { read write ioctl };
allow ppp ppp_device:chr_file rw_file_perms;
allow ppp self:capability net_admin;
allow ppp self:udp_socket { create ioctl };
allow ppp ppp_system_file:dir search;
allow ppp ppp_system_file:file rx_file_perms;
allow ppp vpn_data_file:dir w_dir_perms;
allow ppp vpn_data_file:file create_file_perms;
allow ppp mtp:fd use;
...@@ -206,3 +206,6 @@ allow system gps_control:file rw_file_perms; ...@@ -206,3 +206,6 @@ allow system gps_control:file rw_file_perms;
allow system appdomain:udp_socket { read write }; allow system appdomain:udp_socket { read write };
# Allow abstract socket connection # Allow abstract socket connection
allow system rild:unix_stream_socket connectto; allow system rild:unix_stream_socket connectto;
# connect to vpn tunnel
allow system mtp:unix_stream_socket { connectto };
tee.te 0 → 100644
##
# trusted execution environment (tee) daemon
#
type tee, domain;
type tee_exec, exec_type, file_type;
type tee_device, dev_type;
type tee_data_file, file_type, data_file_type;
init_daemon_domain(tee)
allow tee self:capability { dac_override };
allow tee tee_device:chr_file rw_file_perms;
allow tee tee_data_file:dir { getattr write add_name };
allow tee tee_data_file:file create_file_perms;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment