aboutsummaryrefslogtreecommitdiffstats
path: root/mls
diff options
context:
space:
mode:
authordcashman <dcashman@google.com>2015-03-04 09:50:34 -0800
committerdcashman <dcashman@google.com>2015-03-04 16:39:58 -0800
commit60cfe79f1807c2dd1897cc026f342946ed92ee65 (patch)
treecc32fb247e50ec678fb78fc082ce9568a039ca9b /mls
parent23f336156daf61ba07c024af2fe96994605f46eb (diff)
downloadandroid_external_sepolicy-60cfe79f1807c2dd1897cc026f342946ed92ee65.tar.gz
android_external_sepolicy-60cfe79f1807c2dd1897cc026f342946ed92ee65.tar.bz2
android_external_sepolicy-60cfe79f1807c2dd1897cc026f342946ed92ee65.zip
Revert "Drop special handling of app_data_file in mls constraints."
This reverts commit 27042f6da110b8bef9ff291f724351464958da86. Managed profiles are represented by new android users which have the ability to communicate across profiles as governed by an IntentFilter provisioned by the DevicePolicyManager. This communication includes reading and writing content URIs, which is currently obstructed by the mls separation between an owning user and its managed profile. Bug: 19444116 Bug: 19525465 Bug: 19540297 Bug: 19592525 Change-Id: Id9a97f24081902bceab5a96ddffd9276d751775b
Diffstat (limited to 'mls')
-rw-r--r--mls26
1 files changed, 21 insertions, 5 deletions
diff --git a/mls b/mls
index 06a9d09..474bd72 100644
--- a/mls
+++ b/mls
@@ -59,21 +59,37 @@ mlsconstrain unix_stream_socket { connectto }
mlsconstrain dir_file_class_set { create relabelfrom relabelto }
(l2 eq h2 and (l1 eq l2 or t1 == mlstrustedsubject));
+#
+# Constraints for app data files only.
+#
+
+# Only constrain open, not read/write.
+# Also constrain other forms of manipulation, e.g. chmod/chown, unlink, rename, etc.
+# Subject must be equivalent to object unless the subject is trusted.
+mlsconstrain dir { open search setattr rename add_name remove_name reparent rmdir }
+ (t2 != app_data_file or l1 eq l2 or t1 == mlstrustedsubject);
+mlsconstrain { file lnk_file sock_file } { open setattr unlink link rename }
+ (t2 != app_data_file or l1 eq l2 or t1 == mlstrustedsubject);
+
+#
+# Constraints for file types other than app data files.
+#
+
# Read operations: Subject must dominate object unless the subject
# or the object is trusted.
mlsconstrain dir { read getattr search }
- (l1 dom l2 or t1 == mlstrustedsubject or t2 == mlstrustedobject);
+ (t2 == app_data_file or l1 dom l2 or t1 == mlstrustedsubject or t2 == mlstrustedobject);
-mlsconstrain { file lnk_file sock_file chr_file blk_file } { open execute }
- (l1 dom l2 or t1 == mlstrustedsubject or t2 == mlstrustedobject);
+mlsconstrain { file lnk_file sock_file chr_file blk_file } { read getattr execute }
+ (t2 == app_data_file or l1 dom l2 or t1 == mlstrustedsubject or t2 == mlstrustedobject);
# Write operations: Subject must be dominated by the object unless the
# subject or the object is trusted.
mlsconstrain dir { write setattr rename add_name remove_name reparent rmdir }
- (l1 domby l2 or t1 == mlstrustedsubject or t2 == mlstrustedobject);
+ (t2 == app_data_file or l1 domby l2 or t1 == mlstrustedsubject or t2 == mlstrustedobject);
mlsconstrain { file lnk_file sock_file chr_file blk_file } { write setattr append unlink link rename }
- (l1 domby l2 or t1 == mlstrustedsubject or t2 == mlstrustedobject);
+ (t2 == app_data_file or l1 domby l2 or t1 == mlstrustedsubject or t2 == mlstrustedobject);
# Special case for FIFOs.
# These can be unnamed pipes, in which case they will be labeled with the