Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
reconcile aosp (a7c04dc) after branching. Please do not merge.
Browse files Browse the repository at this point in the history
Change-Id: I35be7a7df73325fba921b8a354659b2b2a3e06e7
  • Loading branch information
Ed Heyl committed Jul 15, 2014
1 parent e9c90bd commit 7563a6f
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 34 deletions.
2 changes: 0 additions & 2 deletions adbd.te
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ userdebug_or_eng(`
')

domain_auto_trans(adbd, shell_exec, shell)
# this is an entrypoint
allow adbd rootfs:file entrypoint;

# Do not sanitize the environment or open fds of the shell.
allow adbd shell:process noatsecure;
Expand Down
1 change: 0 additions & 1 deletion healthd.te
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# it lives in the rootfs and has no unique file type.
type healthd, domain;

allow healthd rootfs:file { read entrypoint };
write_klog(healthd)
# /dev/__null__ created by init prior to policy load,
# open fd inherited by healthd.
Expand Down
27 changes: 21 additions & 6 deletions init.te
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,23 @@ allow init usermodehelper:file rw_file_perms;
allow init proc_security:file rw_file_perms;

# Transitions to seclabel processes in init.rc
allow init adbd:process transition;
allow init healthd:process transition;
allow init recovery:process transition;
allow init shell:process transition;
allow init ueventd:process transition;
allow init watchdogd:process transition;
domain_trans(init, rootfs, adbd)
domain_trans(init, rootfs, healthd)
recovery_only(`
domain_trans(init, rootfs, recovery)
')
domain_trans(init, shell_exec, shell)
domain_trans(init, rootfs, ueventd)
domain_trans(init, rootfs, watchdogd)

# Certain domains need LD_PRELOAD passed from init.
# https://android-review.googlesource.com/94851
# For now, allow it to all domains.
# TODO: scope this down.
allow init domain:process noatsecure;

# Support "adb shell stop"
allow init domain:process sigkill;

# Init creates keystore's directory on boot, and walks through
# the directory as part of a recursive restorecon.
Expand All @@ -92,6 +103,10 @@ allow init property_type:property_service set;
# Run "ifup lo" to bring up the localhost interface
allow init self:udp_socket { create ioctl };

# This line seems suspect, as it should not really need to
# set scheduling parameters for a kernel domain task.
allow init kernel:process setsched;

###
### neverallow rules
###
Expand Down
2 changes: 0 additions & 2 deletions recovery.te
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ type recovery, domain;
# But the allow rules are only included in the recovery policy.
# Otherwise recovery is only allowed the domain rules.
recovery_only(`
allow recovery rootfs:file { entrypoint execute };

allow recovery self:capability { chown dac_override fowner fsetid setfcap setuid setgid sys_admin sys_tty_config };

# Set security contexts on files that are not known to the loaded policy.
Expand Down
1 change: 0 additions & 1 deletion ueventd.te
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ type ueventd, domain;
tmpfs_domain(ueventd)
write_klog(ueventd)
security_access_policy(ueventd)
allow ueventd rootfs:file entrypoint;
allow ueventd init:process sigchld;
allow ueventd self:capability { chown mknod net_admin setgid fsetid sys_rawio dac_override fowner };
allow ueventd device:file create_file_perms;
Expand Down
21 changes: 0 additions & 21 deletions unconfined.te
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,6 @@ allow unconfineddomain self:capability ~{ sys_ptrace sys_rawio mknod sys_module
allow unconfineddomain self:capability2 ~{ mac_override mac_admin };
allow unconfineddomain kernel:security ~{ load_policy setenforce setcheckreqprot setbool setsecparam };
allow unconfineddomain kernel:system ~{ syslog_read syslog_mod syslog_console };
allow unconfineddomain domain:process {
fork
sigchld
sigkill
sigstop
signull
signal
getsched
setsched
getsession
getpgid
setpgid
getcap
setcap
share
getattr
noatsecure
siginh
setrlimit
rlimitinh
};
allow unconfineddomain domain:fd *;
allow unconfineddomain domain:dir r_dir_perms;
allow unconfineddomain domain:lnk_file r_file_perms;
Expand Down
1 change: 0 additions & 1 deletion watchdogd.te
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# watchdogd seclabel is specified in init.<board>.rc
type watchdogd, domain;
allow watchdogd rootfs:file { entrypoint r_file_perms };
allow watchdogd self:capability mknod;
allow watchdogd device:dir { add_name write remove_name };
allow watchdogd watchdog_device:chr_file rw_file_perms;
Expand Down

0 comments on commit 7563a6f

Please sign in to comment.