Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AndroidSystemSEPolicy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Werner Sembach
AndroidSystemSEPolicy
Commits
ffbba62e
Commit
ffbba62e
authored
10 years ago
by
Stephen Smalley
Committed by
Android Git Automerger
10 years ago
Browse files
Options
Downloads
Plain Diff
am
e60723ab
: Create a separate recovery policy.
* commit '
e60723ab
': Create a separate recovery policy.
parents
7b601c31
e60723ab
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Android.mk
+27
-0
27 additions, 0 deletions
Android.mk
recovery.te
+27
-16
27 additions, 16 deletions
recovery.te
te_macros
+6
-0
6 additions, 0 deletions
te_macros
with
60 additions
and
16 deletions
Android.mk
+
27
−
0
View file @
ffbba62e
...
@@ -108,6 +108,33 @@ $(LOCAL_BUILT_MODULE) : $(sepolicy_policy.conf) $(HOST_OUT_EXECUTABLES)/checkpol
...
@@ -108,6 +108,33 @@ $(LOCAL_BUILT_MODULE) : $(sepolicy_policy.conf) $(HOST_OUT_EXECUTABLES)/checkpol
built_sepolicy
:=
$(
LOCAL_BUILT_MODULE
)
built_sepolicy
:=
$(
LOCAL_BUILT_MODULE
)
sepolicy_policy.conf
:=
sepolicy_policy.conf
:=
##################################
include
$(CLEAR_VARS)
LOCAL_MODULE
:=
sepolicy.recovery
LOCAL_MODULE_CLASS
:=
ETC
LOCAL_MODULE_TAGS
:=
eng
include
$(BUILD_SYSTEM)/base_rules.mk
sepolicy_policy_recovery.conf
:=
$(
intermediates
)
/policy_recovery.conf
$(sepolicy_policy_recovery.conf)
:
PRIVATE_MLS_SENS := $(MLS_SENS)
$(sepolicy_policy_recovery.conf)
:
PRIVATE_MLS_CATS := $(MLS_CATS)
$(sepolicy_policy_recovery.conf)
:
$(call build_policy
,
security_classes initial_sids access_vectors global_macros mls_macros mls policy_capabilities te_macros attributes *.te roles users initial_sid_contexts fs_use genfs_contexts port_contexts)
@
mkdir
-p
$(
dir
$@
)
$(
hide
)
m4
-D
mls_num_sens
=
$(
PRIVATE_MLS_SENS
)
-D
mls_num_cats
=
$(
PRIVATE_MLS_CATS
)
\
-D
target_build_variant
=
$(
TARGET_BUILD_VARIANT
)
\
-D
force_permissive_to_unconfined
=
$(
FORCE_PERMISSIVE_TO_UNCONFINED
)
\
-D
target_recovery
=
true
\
-s
$^
>
$@
$(LOCAL_BUILT_MODULE)
:
$(sepolicy_policy_recovery.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy
@
mkdir
-p
$(
dir
$@
)
$(
hide
)
$(
HOST_OUT_EXECUTABLES
)
/checkpolicy
-M
-c
$(
POLICYVERS
)
-o
$@
$<
built_sepolicy_recovery
:=
$(
LOCAL_BUILT_MODULE
)
sepolicy_policy_recovery.conf
:=
###################################
###################################
include
$(CLEAR_VARS)
include
$(CLEAR_VARS)
...
...
This diff is collapsed.
Click to expand it.
recovery.te
+
27
−
16
View file @
ffbba62e
# recovery console (used in recovery init.rc for /sbin/recovery)
# recovery console (used in recovery init.rc for /sbin/recovery)
# Declare the domain unconditionally so we can always reference it
# in neverallow rules.
type recovery, domain;
type recovery, domain;
allow recovery rootfs:file entrypoint;
unconfined_domain(recovery)
allow recovery self:capability2 mac_admin;
# 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;
unconfined_domain(recovery)
# Set security contexts on files that are not known to the loaded policy.
allow recovery self:capability2 mac_admin;
# Mount filesystems.
# Mount filesystems.
allow recovery fs_type:filesystem *;
allow recovery fs_type:filesystem *;
allow recovery unlabeled:filesystem *;
allow recovery unlabeled:filesystem *;
# Create and relabel files under /system.
allow recovery exec_type:{ file dir lnk_file } { create write setattr relabelfrom relabelto append unlink link rename };
allow recovery system_file:{ file dir lnk_file } { create write setattr relabelfrom relabelto append unlink link rename };
# Create and relabel files under /system.
# Required to e.g. wipe userdata/cache.
allow recovery exec_type:{ file dir lnk_file } { create write setattr relabelfrom relabelto append unlink link rename };
allow recovery dev_type:blk_file rw_file_perms;
allow recovery system_file:{ file dir lnk_file } { create write setattr relabelfrom relabelto append unlink link rename };
# Required to e.g. wipe userdata/cache.
# GUI
allow recovery dev_type:blk_file rw_file_perms;
allow recovery self:process execmem;
allow recovery ashmem_device:chr_file execute;
allow recovery self:process execmem;
# Execute /tmp/update_binary.
allow recovery ashmem_device:chr_file execute;
allow recovery tmpfs:file rx_file_perms;
allow recovery tmpfs:file rx_file_perms;
# Use setfscreatecon() to label files for OTA updates.
# Use setfscreatecon() to label files for OTA updates.
allow recovery self:process setfscreate;
allow recovery self:process setfscreate;
')
This diff is collapsed.
Click to expand it.
te_macros
+
6
−
0
View file @
ffbba62e
...
@@ -308,6 +308,12 @@ allow $1 $1_devpts:chr_file { open getattr read write ioctl };
...
@@ -308,6 +308,12 @@ allow $1 $1_devpts:chr_file { open getattr read write ioctl };
#
#
define(`non_system_app_set', `{ appdomain -system_app }')
define(`non_system_app_set', `{ appdomain -system_app }')
#####################################
# Recovery only
# SELinux rules which apply only to recovery mode
#
define(`recovery_only', ifelse(target_recovery, `true', $1, ))
#####################################
#####################################
# Userdebug or eng builds
# Userdebug or eng builds
# SELinux rules which apply only to userdebug or eng builds
# SELinux rules which apply only to userdebug or eng builds
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment