Commit graph

4699 commits

Author SHA1 Message Date
Stephen Smalley
20d0ad0ed8 Remove zygote security class declaration.
All uses were removed by I1c925d7facf19b3953b5deb85d992415344c4c9f;
this is just a dead definition.

(cherry-pick of commit: a0c9d207b1)
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>

Change-Id: I2e17e522a78120c3658d81035e202aab861a3b22
2015-05-26 13:31:59 -07:00
Jim Miller
83554d2c92 Merge "Selinux: Allow system_server to create fpdata dir." into mnc-dev 2015-05-22 01:42:29 +00:00
Jim Miller
a39b131e9d Selinux: Allow system_server to create fpdata dir.
Fixes avc errors;
avc: denied { relabelto } for name="fpdata" dev="mmcblk0p28" ino=586465 scontext=u:r:system_server:s0 tcontext=u:object_r:fingerprintd_data_file:s0 tclass=dir permissive=0
avc: denied { read } for name="fpdata" dev="mmcblk0p28" ino=586409 scontext=u:r:system_server:s0 tcontext=u:object_r:fingerprintd_data_file:s0 tclass=dir permissive=0

Change-Id: I3ba16af14632d803e09ac1490af9a0b652cba3a6
2015-05-21 17:43:28 -07:00
dcashman
894911d78f Expand rtc_device label to match all rtc class drivers.
/dev/rtc0 is not the only possible rtc device node, make sure all are given the
rtc_device label.

(cherry-pick of 1b4b3b918b)

Change-Id: Iea6e1271fb054ea7f44860724e04143875867d78
2015-05-21 15:39:11 -07:00
Chad Brubaker
b3df4389f3 Merge "Rename keystore methods and delete unused permissions" into mnc-dev 2015-05-21 17:26:54 +00:00
Jim Miller
5d78c07d4a Merge "Add selinux policy for fingerprintd" into mnc-dev 2015-05-21 00:57:37 +00:00
Ruben Brunk
a983621fbc Merge "camera: Add AIDL interface for CameraServiceProxy." into mnc-dev 2015-05-20 20:44:38 +00:00
Jim Miller
264eb6566a Add selinux policy for fingerprintd
Change-Id: Ibcb714248c28abf21272986facaade376dcbd7ef
2015-05-19 18:28:45 -07:00
Ruben Brunk
e1edbe9c97 camera: Add AIDL interface for CameraServiceProxy.
- Update selinux policy for CameraServiceProxy.

Bug: 21267484
Change-Id: Ib821582794ddd1e3574b5dc6c79f7cb197b57f10
2015-05-19 17:26:31 -07:00
Jeff Sharkey
6e1f405c8b Allow MediaProvider to traverse /mnt/media_rw.
As an optimization, platform components like MediaProvider may choose
to shortcut past the FUSE daemon and return open file descriptors
directly pointing at the underlying storage device.

Now that we have a specific label for /mnt/media_rw, we need to grant
search access to untrusted apps like MediaProvider.  The actual
access control is still managed by POSIX permissions on that
directory.

avc: denied { search } for name="media_rw" dev="tmpfs" ino=4150 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:mnt_media_rw_file:s0 tclass=dir permissive=0

Bug: 21017105
Change-Id: I6d51939668b39b43b91b1f0c24c98bc2205bf511
2015-05-19 14:12:28 -07:00
dcashman
807d8d0249 Label /dev/rtc0 as rtc_device.
Grant access to system_server, as it is used by AlarmManagerService.

(cherry-pick of c7594898db)

Change-Id: I8b5795cb4739bb7fb6b2673d0b1b12be40db7a7f
2015-05-18 14:18:11 -07:00
Chad Brubaker
eaa1a1e975 Rename keystore methods and delete unused permissions
Keystore is going through an API cleanup to make names more clear and
remove unclear methods.

(cherry-picked from commit cbc8f79655)

Change-Id: I06354ccd0a9a73fd20168bfce9350c451cfaced3
2015-05-18 12:19:19 -07:00
Chad Brubaker
77a824600b Add keystore user_changed permission
user_changed will be used for state change methods around android user
creation/deletion.

(cherry-picked from commit 520bb816b8)

Change-Id: I295ca9adfc4907b5d7bcf0555f6e5a9a3379635b
2015-05-18 16:26:41 +01:00
Jeff Vander Stoep
929c85870a Merge "Allow tty and wireless extensions ioctls" into mnc-dev 2015-05-15 23:15:35 +00:00
Jeff Vander Stoep
a0fbeb97c0 Allow tty and wireless extensions ioctls
Allow tty ioctls TIOCOUTQ 0x5411 and FIOCLEX 0x5451.

Allow/audit all wireless extension ioctls.

Bug: 21120188
Change-Id: Icd447ee40351c615c236f041931d210751e0f0c3
2015-05-15 22:59:34 +00:00
Jeff Sharkey
e5acc38f09 Merge "drop_caches label, vold scratch space on expanded." into mnc-dev 2015-05-15 21:56:03 +00:00
Than McIntosh
aee12c3722 Tweak perfprofd sepolicy to include ipc_lock self capability.
Bug: http://b/19483574
Change-Id: Id39a5aaf531d2a75a22647bdafb34a6ef18201c8
(cherry picked from commit 728fe3d491)
2015-05-15 12:59:05 -04:00
Jeff Sharkey
c960596cc3 drop_caches label, vold scratch space on expanded.
Define an explicit label for /proc/sys/vm/drop_caches and grant to
the various people who need it, including vold which uses it when
performing storage benchmarks.

Also let vold create new directories under it's private storage area
where the benchmarks will be carried out.  Mirror the definition of
the private storage area on expanded media.

avc: denied { write } for name="drop_caches" dev="proc" ino=20524 scontext=u:r:vold:s0 tcontext=u:object_r:proc:s0 tclass=file permissive=0

Bug: 21172095
Change-Id: I300b1cdbd235ff60e64064d3ba6e5ea783baf23f
2015-05-14 20:55:33 -07: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
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
3526a6696f Allow system_server to read/write /proc/uid_cputime/ module
Bug:20182139
Change-Id: I1829a83c7d8e2698715e424a688a2753d65de868
2015-05-13 04:47:32 +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
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
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
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
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
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
dcashman
4286019c38 Merge "Allow system_app to list all services." into mnc-dev 2015-05-05 00:11:55 +00:00
dcashman
c6290ac2a2 Allow system_app to list all services.
The Settings app contains a SystemPropPoker class which notifies every service
on the system that a property has changed.

Address the following denial:
avc:  denied  { list } for service=NULL scontext=u:r:system_app:s0 tcontext=u:r:servicemanager:s0 tclass=service_manager

Cherry-pick of Change-Id: I81926e8833c1abcb17a4d49687fc89619b416d6c

Bug: 20762975
Change-Id: I665a460f30a1ef57b513da9166aad60097dd4886
2015-05-04 15:30:36 -07:00
Jeff Vander Stoep
64b01c6165 Update policy version to enable ioctl whitelisting
Bug: 20756547
Bug: 18087110
Change-Id: I9ff76f1cf359e38c19d7b50a5b7236fd673d937e
2015-05-04 11:14:23 -07:00
Jeff Sharkey
ecc82e0f05 Allow installd to move APKs.
As an optimization, installd is now moving previously-installed
applications between attached storage volumes.  This is effectively
copying to the new location, then deleting the old location.

Since OAT files can now live under /data/app directories, we also
need the ability to relabel those files.

avc: denied { create } for name="base.apk" scontext=u:r:installd:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=1
avc: denied { write } for path="/data/app/com.example.playground-2/base.apk" dev="mmcblk0p16" ino=40570 scontext=u:r:installd:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=1
avc: denied { setattr } for name="base.apk" dev="mmcblk0p16" ino=40570 scontext=u:r:installd:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=1
avc: denied { relabelfrom } for name="base.odex" dev="mmcblk0p16" ino=40574 scontext=u:r:installd:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=1
avc: denied { relabelto } for name="base.odex" dev="mmcblk0p16" ino=40574 scontext=u:r:installd:s0 tcontext=u:object_r:dalvikcache_data_file:s0 tclass=file permissive=1

(Cherry-pick of 8f821db783)

Bug: 19993667, 20275578
Change-Id: I52bb29ed9f57b3216657eb757d78b06eeaf53458
2015-05-01 09:21:28 -07:00
Stephen Smalley
3c242caffd Ensure that domain and appdomain attributes are assigned.
Prevent defining any process types without the domain attribute
so that all allow and neverallow rules written on domain are
applied to all processes.

Prevent defining any app process types without the appdomain
attribute so that all allow and neverallow rules written on
appdomain are applied to all app processes.

Change-Id: I4cb565314fd40e1e82c4360efb671b175a1ee389
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2015-05-01 09:01:44 -07:00
dcashman
37137dafb1 Merge "Make deviceidle accessible as system_api_service." into mnc-dev 2015-04-29 19:39:45 +00:00
dcashman
31548db0f4 Make deviceidle accessible as system_api_service.
deviceidle service should be accessible to all non third-party apps.

Cherry-pick of commit: 7c1dced7d5

Change-Id: Ia410fe0027f212009cc2abeaabc64c7c87841daa
2015-04-29 12:36:13 -07:00
Alex Klyubin
ab5cf66873 Expand access to gatekeeperd.
This enables access to gatekeeperd for anybody who invokes Android
framework APIs. This is necessary because the AndroidKeyStore
abstraction offered by the framework API occasionally communicates
with gatekeeperd from the calling process.

(cherry picked from commit effcac7d7e)

Bug: 20526234
Change-Id: I450242cd085259b3f82f36f359ee65ff27bebd13
2015-04-29 10:28:53 -07:00
Nick Kralevich
320a7cac8e am aeb110ce: am e05487ac: init.te: Don\'t allow mounting on top of /proc
* commit 'aeb110ce39e8aa7917979927fad56b828701e797':
  init.te: Don't allow mounting on top of /proc
2015-04-25 23:59:49 +00:00
Nick Kralevich
aeb110ce39 am e05487ac: init.te: Don\'t allow mounting on top of /proc
* commit 'e05487acc37875cd2f9e1648063ec8d6f9eade89':
  init.te: Don't allow mounting on top of /proc
2015-04-25 23:38:48 +00:00
Nick Kralevich
e05487acc3 init.te: Don't allow mounting on top of /proc
Don't allow init to mount on top of /proc. See
https://android-review.googlesource.com/148295 for details.

Change-Id: I65f66b39f3a5bfb72facb9f716f4537ac2237af1
2015-04-25 15:54:11 -07:00
Jeff Sharkey
fd1c6e7539 am 20f38b98: am 90c64542: Allow vold to move FUSE backing files directly.
* commit '20f38b983368ae9590e39b1f24658fe0c87d7fd2':
  Allow vold to move FUSE backing files directly.
2015-04-24 23:09:44 +00:00
Jeff Sharkey
20f38b9833 am 90c64542: Allow vold to move FUSE backing files directly.
* commit '90c64542a20b23180c36b9bb07b78c1ff06350a1':
  Allow vold to move FUSE backing files directly.
2015-04-24 22:48:12 +00:00
Jeff Vander Stoep
c49d0c52a5 am d2aa96c5: am c2e31a77: Create context for ctl.console
* commit 'd2aa96c522183a11b693aa1d02f7d052b14edd0a':
  Create context for ctl.console
2015-04-24 22:29:18 +00:00
Jeff Sharkey
90c64542a2 Allow vold to move FUSE backing files directly.
This enables an optimization of bypassing the FUSE overhead when
migrating emulated storage between volumes.

avc: denied { write } for path="/mnt/expand/6cba9b95-4fc8-4096-b51f-bdb2c007d059/media/obb/.nomedia" dev="dm-0" ino=387843 scontext=u:r:vold:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=1

Bug: 19993667
Change-Id: I2bb9aaca50ed988ded6afec6d7fbe190903707e0
2015-04-24 15:24:15 -07:00
Jeff Vander Stoep
d2aa96c522 am c2e31a77: Create context for ctl.console
* commit 'c2e31a77825b4b404549396f5bcf1834d6ab0d3a':
  Create context for ctl.console
2015-04-24 22:10:55 +00:00
Jeff Vander Stoep
8b015f9df4 Create context for ctl.console
(cherry picked from commit c2e31a7782)

Change-Id: I92218709fa8cdb71c0369aca8fdd7922df45f7d0
2015-04-24 14:47:31 -07:00
Jeffrey Vander Stoep
067bf0b793 am bf162a2a: am eb953648: Revert "Create context for ctl.console"
* commit 'bf162a2a329cc63aec27bee40c786dd5214c4bc4':
  Revert "Create context for ctl.console"
2015-04-24 21:43:07 +00:00
Jeff Vander Stoep
c2e31a7782 Create context for ctl.console
Change-Id: I1c9fa4da442aa47ae4b7341eab6f788f0329d2d2
2015-04-24 14:39:16 -07:00
Jeff Vander Stoep
91975b7dc3 am 1bd407a0: am bbd56b71: Create context for ctl.console
* commit '1bd407a0a7fa48e1a9a2899df57a5e1b937cf130':
  Create context for ctl.console
2015-04-24 21:27:34 +00:00
Jeffrey Vander Stoep
bf162a2a32 am eb953648: Revert "Create context for ctl.console"
* commit 'eb9536488c9c5b246b1a7c830a36ad430002517e':
  Revert "Create context for ctl.console"
2015-04-24 21:20:23 +00:00
Elliott Hughes
9b8505b1e7 am a331c593: am 5aac86dc: Revert "Revert "SELinux policy changes for re-execing init.""
* commit 'a331c593d1ed9ad5da8e68626a59b3a33a225531':
  Revert "Revert "SELinux policy changes for re-execing init.""
2015-04-24 21:09:36 +00:00