Commit graph

4795 commits

Author SHA1 Message Date
William Roberts
1b4e69a734 make unix_socket_connect() for property service a warning
Encourage the use of set_prop macro by making existing
unix_socket_connect(domain, property, init) calls
warn at compile time. When encountering one of these macros,
m4 will emit a deprecated message as follows:

m4: external/sepolicy/adbd.te: 97: deprecated: unix_socket_connect(adbd, property, init) Please use set_prop(adbd, <property name>) instead.

Change-Id: I997fed75d2683933e08db8b9efeecea71523c7c3
Signed-off-by: William Roberts <william.c.roberts@linux.intel.com>
2015-05-14 13:03:12 -07:00
Than McIntosh
e5916eb67b Merge "Tweak perfprofd sepolicy to include ipc_lock self capability." 2015-05-14 19:58:06 +00:00
Than McIntosh
728fe3d491 Tweak perfprofd sepolicy to include ipc_lock self capability.
Bug: http://b/19483574
Change-Id: Id39a5aaf531d2a75a22647bdafb34a6ef18201c8
2015-05-14 15:47:36 -04:00
dcashman
bbc8ba2eef am ae696944: Fix sepolicy-analyze libc++.so loading issue w/CTS.
* commit 'ae6969440bcd1587b8df20e246d63329d17c0a75':
  Fix sepolicy-analyze libc++.so loading issue w/CTS.
2015-05-14 19:29:42 +00:00
William Roberts
62a10f810c am d1fa4d3d: neverallow transitions to shell
* commit 'd1fa4d3d92c88bde9ecd118c178d0297d0f30f9b':
  neverallow transitions to shell
2015-05-14 18:30:20 +00:00
dcashman
ae6969440b Fix sepolicy-analyze libc++.so loading issue w/CTS.
Addresses the following error when running CTS on master:
junit.framework.AssertionFailedError: The following errors were encountered when validating the SELinuxneverallow rule:
neverallow { appdomain -bluetooth } self:capability *;
/tmp/SELinuxHostTest5593810182495331783.tmp: error while loading shared libraries: libc++.so: cannot open shared object file: No such file or directory

Also indicate that none of the sepolicy tools need c++ std lib.

(cherry-pick of 28acbeab18)

Bug: 19566396
Change-Id: Ieb380d05ae896a8146b80f94fe3b3211178705bb
2015-05-14 09:07:48 -07:00
William Roberts
d1fa4d3d92 neverallow transitions to shell
Only a few daemons need transition to shell. Prevent
misuse and over-privileging of shell domain.

Change-Id: Ib1a5611e356d7a66c2e008232c565035e3fc4956
Signed-off-by: William Roberts <william.c.roberts@linux.intel.com>
2015-05-13 19:37:36 -07:00
Nick Kralevich
1f2459c95e resolved conflicts for merge of b5dc7665 to mnc-dev-plus-aosp
Change-Id: I6bab4f11d883380939fc768ec5f16ad7a525bc27
2015-05-13 17:38:15 -07:00
Nick Kralevich
b5dc766536 Merge "dontaudit untrusted_app exec_type:file getattr" into mnc-dev 2015-05-13 23:14:30 +00:00
Nick Kralevich
f6d12c6979 dontaudit untrusted_app exec_type:file getattr
Programs routinely scan through /system, looking at the files there.
Don't generate an SELinux denial when it happens.

Bug: 21120228
Change-Id: I85367406e7ffbb3e24ddab6f97448704df990603
2015-05-13 16:06:34 -07:00
Adam Lesinski
fdef906cd4 am 3526a669: Allow system_server to read/write /proc/uid_cputime/ module
* commit '3526a6696fdc2b7d3b7a8fe452ce8b287160c42b':
  Allow system_server to read/write /proc/uid_cputime/ module
2015-05-13 20:48:41 +00:00
William Roberts
5db68382d7 am 529a8634: neverallow "write ops" on system_data_file from "others"
* commit '529a8634e1d31967db2600ba27e55fc35b7d0195':
  neverallow "write ops" on system_data_file from "others"
2015-05-13 20:35:57 +00:00
William Roberts
529a8634e1 neverallow "write ops" on system_data_file from "others"
Only a few system level components should be creating and writing
these files, force a type transition for shared files.

Change-Id: Ieb8aa8a36859c9873ac8063bc5999e9468ca7533
Signed-off-by: William Roberts <william.c.roberts@linux.intel.com>
2015-05-13 11:51:33 -07:00
Chad Brubaker
617328e9d9 am 520bb816: Add keystore user_changed permission
* commit '520bb816b86fe36440767db6e2f05fb4e8a08f3e':
  Add keystore user_changed permission
2015-05-13 16:32:18 +00:00
dcashman
50704c43ac am b8943b15: Merge "Fix sepolicy-analyze libc++.so loading issue w/CTS."
* commit 'b8943b15810d402e93acf22a626a2b4603d9adb0':
  Fix sepolicy-analyze libc++.so loading issue w/CTS.
2015-05-13 15:42:03 +00:00
Paul Crowley
b91c08845e am 421dadbc: Allow vold to create subdirectories within its private area.
* commit '421dadbc9dc4e5fdd7544a7ecc3343101644a9c3':
  Allow vold to create subdirectories within its private area.
2015-05-13 15:21:41 +00:00
Adam Lesinski
3526a6696f Allow system_server to read/write /proc/uid_cputime/ module
Bug:20182139
Change-Id: I1829a83c7d8e2698715e424a688a2753d65de868
2015-05-13 04:47:32 +00:00
Chad Brubaker
520bb816b8 Add keystore user_changed permission
user_changed will be used for state change methods around android user
creation/deletion.

Change-Id: I295ca9adfc4907b5d7bcf0555f6e5a9a3379635b
2015-05-12 13:24:43 -07:00
dcashman
b8943b1581 Merge "Fix sepolicy-analyze libc++.so loading issue w/CTS." 2015-05-12 18:10:13 +00:00
dcashman
28acbeab18 Fix sepolicy-analyze libc++.so loading issue w/CTS.
Addresses the following error when running CTS on master:
junit.framework.AssertionFailedError: The following errors were encountered when validating the SELinuxneverallow rule:
neverallow { appdomain -bluetooth } self:capability *;
/tmp/SELinuxHostTest5593810182495331783.tmp: error while loading shared libraries: libc++.so: cannot open shared object file: No such file or directory

Also indicate that none of the sepolicy tools need c++ std lib.

(cherry-pick of 0cdb0517be696c0dc6882d289eedd45bf2da918c now made possible by
addition of commit: 28b72eddd54cb1287dd7daae853e8e4b78fa17eb)

Bug: 19617220
Change-Id: I2c5b7ab1ddeb0e02cbaad2b7d5430a0974524a89
2015-05-12 11:06:44 -07:00
Paul Crowley
421dadbc9d Allow vold to create subdirectories within its private area.
AVC message we get without this change creating
/data/misc/vold/user_keys

05-12 08:57:54.839   189   189 W vold    : type=1400 audit(0.0:176):
avc: denied { create } for name="user_keys" scontext=u:r:vold:s0
tcontext=u:object_r:vold_data_file:s0 tclass=dir permissive=0

Bug: 19704432
Change-Id: I10fc90c64c7c10fa9811133a4289663ae8617607
2015-05-12 10:00:41 +01:00
Nick Kralevich
3ac5ff9460 am 415f0ba7: Label /oem files
* commit '415f0ba73c645c9b53ba701931d9ba041b967f75':
  Label /oem files
2015-05-07 21:16:27 +00:00
Nick Kralevich
8cc7ea7216 am 540be83b: Merge "Label /oem files"
* commit '540be83b82a395147388b54a8c8197d84cd255ab':
  Label /oem files
2015-05-07 21:10:25 +00:00
Nick Kralevich
415f0ba73c Label /oem files
Files on the /oem partition are weird. The /oem partition is an ext4
partition, built in the Android tree using the "oem_image" build target
added in build/ commit b8888432f0bc0706d5e00e971dde3ac2e986f2af. Since
it's an ext4 image, it requires SELinux labels to be defined at build
time. However, the partition is mounted using context=u:object_r:oemfs:s0,
which ignores the labels on the filesystem.

Assign all the files on the /oem image to be oemfs, which is consistent
with how they'll be mounted when /oem is mounted.

Other options would be to use an "unlabeled" label, or try to fix the
build system to not require SELinux labels for /oem images.

(cherrypicked from commit 2025fd1476)

Bug: 20816563
Change-Id: Ibe8d9ff626eace8a2d5d02c3f06290105baa59fe
2015-05-07 13:49:42 -07:00
Nick Kralevich
540be83b82 Merge "Label /oem files" 2015-05-07 20:49:01 +00:00
William Roberts
1b6e32b070 am 2f5a6a96: Replace unix_socket_connect() and explicit property sets with macro
* commit '2f5a6a96bdc284dc070a2c222243dd8e19edb9ef':
  Replace unix_socket_connect() and explicit property sets with macro
2015-05-07 19:11:35 +00:00
William Roberts
2f5a6a96bd Replace unix_socket_connect() and explicit property sets with macro
A common source of mistakes when authoring sepolicy is properly
setting up property sets. This is a 3 part step of:
1. Allowing the unix domain connection to the init/property service
2. Allowing write on the property_socket file
3. Allowing the set on class property_service

The macro unix_socket_connect() handled 1 and 2, but could be
confusing for first time policy authors. 3 had to be explicitly
added.

To correct this, we introduce a new macros:
set_prop(sourcedomain, targetprop)

This macro handles steps 1, 2 and 3.

No difference in sediff is expected.

(cherrypicked from commit 625a3526f1)

Change-Id: I630ba0178439c935d08062892990d43a3cc1239e
Signed-off-by: William Roberts <william.c.roberts@linux.intel.com>
2015-05-07 10:32:06 -07:00
Nick Kralevich
b4807fe1a8 am 82966219: Merge "Replace unix_socket_connect() and explicit property sets with macro"
* commit '82966219e6962502fbda5a1c911cde06776ccf35':
  Replace unix_socket_connect() and explicit property sets with macro
2015-05-07 16:15:51 +00:00
Nick Kralevich
15b68e7281 am 1212235f: Don\'t label simpleperf system_file
* commit '1212235ff4693f2140a9724bc52032e25afcabef':
  Don't label simpleperf system_file
2015-05-07 16:15:26 +00:00
Nick Kralevich
9fc7607cb7 resolved conflicts for merge of cfd49516 to mnc-dev-plus-aosp
Change-Id: I24fec247217aef4c9c1c2a7947bb07d91554ee45
2015-05-07 09:10:33 -07:00
Dehao Chen
d3cfe48ac7 am 34a468fa: Update sepolicy to add label for /data/misc/perfprofd.
* commit '34a468fad2c0b624b0cf383671384d0452dd83e6':
  Update sepolicy to add label for /data/misc/perfprofd.
2015-05-07 05:27:08 +00:00
Than McIntosh
7f005d2b89 am 38d0247d: New sepolicy for perfprofd, simpleperf.
* commit '38d0247da007fda16a30c34d48a551387f7b01c2':
  New sepolicy for perfprofd, simpleperf.
2015-05-07 05:27:04 +00:00
Nick Kralevich
82966219e6 Merge "Replace unix_socket_connect() and explicit property sets with macro" 2015-05-07 00:06:23 +00:00
William Roberts
625a3526f1 Replace unix_socket_connect() and explicit property sets with macro
A common source of mistakes when authoring sepolicy is properly
setting up property sets. This is a 3 part step of:
1. Allowing the unix domain connection to the init/property service
2. Allowing write on the property_socket file
3. Allowing the set on class property_service

The macro unix_socket_connect() handled 1 and 2, but could be
confusing for first time policy authors. 3 had to be explicitly
added.

To correct this, we introduce a new macros:
set_prop(sourcedomain, targetprop)

This macro handles steps 1, 2 and 3.

No difference in sediff is expected.

Change-Id: I630ba0178439c935d08062892990d43a3cc1239e
Signed-off-by: William Roberts <william.c.roberts@linux.intel.com>
2015-05-07 00:02:59 +00:00
Nick Kralevich
42b1b17819 am e550e79c: kernel: allow rebooting, and writing to /dev/__kmsg__
* commit 'e550e79c763bbee969ea87d5f236a9f7f67c2a5f':
  kernel: allow rebooting, and writing to /dev/__kmsg__
2015-05-06 23:48:25 +00:00
Nick Kralevich
2025fd1476 Label /oem files
Files on the /oem partition are weird. The /oem partition is an ext4
partition, built in the Android tree using the "oem_image" build target
added in build/ commit b8888432f0bc0706d5e00e971dde3ac2e986f2af. Since
it's an ext4 image, it requires SELinux labels to be defined at build
time. However, the partition is mounted using context=u:object_r:oemfs:s0,
which ignores the labels on the filesystem.

Assign all the files on the /oem image to be oemfs, which is consistent
with how they'll be mounted when /oem is mounted.

Other options would be to use an "unlabeled" label, or try to fix the
build system to not require SELinux labels for /oem images.

Bug: 20816563
Change-Id: Ibe8d9ff626eace8a2d5d02c3f06290105baa59fe
2015-05-06 16:33:56 -07:00
Than McIntosh
fa35328779 am ccc8608c: Merge "New sepolicy for perfprofd, simpleperf."
* commit 'ccc8608cc6dedb256f4a2c92018fed720bc104d2':
  New sepolicy for perfprofd, simpleperf.
2015-05-06 22:44:56 +00:00
dcashman
111306edf3 am 6780dfee: Allow system_app to list all services.
* commit '6780dfeeabc8dc8f3456a0813939cd79fda795f8':
  Allow system_app to list all services.
2015-05-06 22:44:21 +00:00
Dehao Chen
34a468fad2 Update sepolicy to add label for /data/misc/perfprofd.
Bug: 19483574
(cherry picked from commit 7d66f783c2)

Change-Id: If617e29b6fd36c88c157941bc9e11cf41329da48
2015-05-06 15:26:03 -07:00
Nick Kralevich
1212235ff4 Don't label simpleperf system_file
The default label for files on /system is already system_file. No
need to explicitly specify it.

Change-Id: If0c92a0da4119a0d8f83b4a3e05101cfcdb9a82d
2015-05-06 15:19:52 -07:00
Than McIntosh
38d0247da0 New sepolicy for perfprofd, simpleperf.
Bug: http://b/19483574

(cherry picked from commit 0fdd364e89)

Change-Id: If29946a5d7f92522f3bbb807cea5f9f1b42a6513
2015-05-06 15:16:42 -07:00
Nick Kralevich
cfd49516f9 Merge "Update sepolicy to add label for /data/misc/perfprofd." 2015-05-06 21:57:07 +00:00
Dehao Chen
7d66f783c2 Update sepolicy to add label for /data/misc/perfprofd.
Bug: 19483574
Change-Id: I7e4c0cf748d2b216dcb3aede3803883552b58b64
2015-05-06 14:45:44 -07:00
Nick Kralevich
f53a99a35d am 618efe8c: kernel: allow rebooting, and writing to /dev/__kmsg__
* commit '618efe8cd368f372f69dd369f99c309b9232cbed':
  kernel: allow rebooting, and writing to /dev/__kmsg__
2015-05-06 18:16:38 +00:00
Nick Kralevich
618efe8cd3 kernel: allow rebooting, and writing to /dev/__kmsg__
Addresses the following denials:

  avc:  denied  { write } for  pid=1 comm="init" path=2F6465762F5F5F6B6D73675F5F202864656C6574656429 dev="tmpfs" ino=7214 scontext=u:r:kernel:s0 tcontext=u:object_r:tmpfs:s0 tclass=chr_file permissive=0
  avc:  denied  { write } for  pid=1 comm="init" name="sysrq-trigger" dev="proc" ino=4026534153 scontext=u:r:kernel:s0 tcontext=u:object_r:proc_sysrq:s0 tclass=file permissive=0
  avc:  denied  { sys_boot } for  pid=1 comm="init" capability=22  scontext=u:r:kernel:s0 tcontext=u:r:kernel:s0 tclass=capability permissive=0

(cherrypicked from commit e550e79c76)

Change-Id: I46be370d520c4492d97c6ed7ccdc55cc20b22c49
2015-05-06 10:46:29 -07:00
Nick Kralevich
e550e79c76 kernel: allow rebooting, and writing to /dev/__kmsg__
Addresses the following denials:

  avc:  denied  { write } for  pid=1 comm="init" path=2F6465762F5F5F6B6D73675F5F202864656C6574656429 dev="tmpfs" ino=7214 scontext=u:r:kernel:s0 tcontext=u:object_r:tmpfs:s0 tclass=chr_file permissive=0
  avc:  denied  { write } for  pid=1 comm="init" name="sysrq-trigger" dev="proc" ino=4026534153 scontext=u:r:kernel:s0 tcontext=u:object_r:proc_sysrq:s0 tclass=file permissive=0
  avc:  denied  { sys_boot } for  pid=1 comm="init" capability=22  scontext=u:r:kernel:s0 tcontext=u:r:kernel:s0 tclass=capability permissive=0

Change-Id: I46be370d520c4492d97c6ed7ccdc55cc20b22c49
2015-05-05 17:40:07 -07:00
Jeff Vander Stoep
932691ac1e am 86f30cb1: Deny untrusted app ioctl access to MAC addr
* commit '86f30cb16a8aa2ea337b1c36071bfa833f798c96':
  Deny untrusted app ioctl access to MAC addr
2015-05-05 23:39:49 +00:00
Jeff Vander Stoep
86f30cb16a Deny untrusted app ioctl access to MAC addr
MAC address access is no longer allowed via the java API. Deny access
from native code.

Bug: 17787238
Change-Id: Ia337317d5927349b243bbbd5c2cf393911771cdf
2015-05-05 16:08:54 -07:00
Than McIntosh
ccc8608cc6 Merge "New sepolicy for perfprofd, simpleperf." 2015-05-05 13:38:29 +00:00
dcashman
de7dae6956 am 4286019c: Merge "Allow system_app to list all services." into mnc-dev
* commit '4286019c38f1e8e3e85664533679a2aede879f9b':
  Allow system_app to list all services.
2015-05-05 01:24:36 +00:00