Commit graph

2293 commits

Author SHA1 Message Date
Nick Kralevich
80e22de8c5 am 5b2ed833: Merge "system_server: bring back sdcard_type neverallow rule"
* commit '5b2ed833571ec039490d6f8359a50a03fd96e0fe':
  system_server: bring back sdcard_type neverallow rule
2014-07-07 15:37:09 +00:00
Nick Kralevich
185de52893 am be660697: Remove -unconfineddomain from neverallow rules
* commit 'be66069765b019257ed3bf1ca1285e643360a998':
  Remove -unconfineddomain from neverallow rules
2014-07-07 15:37:08 +00:00
Nick Kralevich
be66069765 Remove -unconfineddomain from neverallow rules
Many of the neverallow rules have -unconfineddomain. This was
intended to allow us to support permissive_or_unconfined(), and
ensure that all domains were enforcing at least a minimal set of
rules.

Now that all the app domains are in enforcing / confined, there's
no need to allow for these exceptions. Remove them.

Change-Id: Ieb29872dad415269f7fc2fe5be5a3d536d292d4f
2014-07-04 10:12:13 -07:00
Nick Kralevich
5b2ed83357 Merge "system_server: bring back sdcard_type neverallow rule" 2014-07-02 20:51:20 +00:00
Nick Kralevich
d00eff47fe system_server: bring back sdcard_type neverallow rule
We had disabled the neverallow rule when system_server was
in permissive_or_unconfined(), but forgot to reenable it.
Now that system_server is in enforcing/confined, bring it
back.

Change-Id: I6f74793d4889e3da783361c4d488b25f804ac8ba
2014-07-04 11:45:49 -07:00
Doug Zongker
9523f237ed am 93d849b6: recovery: allow creating and reading fuse filesystems
* commit '93d849b674d0f6783eebf554256d4c10afda3891':
  recovery: allow creating and reading fuse filesystems
2014-07-02 19:43:56 +00:00
Doug Zongker
93d849b674 recovery: allow creating and reading fuse filesystems
The new sideloading mechanism in recovery needs to create a fuse
filesystem and read files from it.

Change-Id: I22e1f7175baf401d2b75c4be6673ae4b75a0ccbf
2014-07-02 10:28:20 -07:00
Nick Kralevich
b5a39ee190 am 4be31900: Trivial change to support different SELinux policies for third party apps
* commit '4be31900a480b1c71d77cf6da02349c72a876daa':
  Trivial change to support different SELinux policies for third party apps
2014-07-01 21:20:17 +00:00
Nick Kralevich
4be31900a4 Trivial change to support different SELinux policies for third party apps
Needed to support https://android-review.googlesource.com/80871

Change-Id: Iba569c046135c0e81140faf6296c5da26a243037
2014-07-01 14:02:38 -07:00
Sharvil Nanavati
016e7f71ea am 77eb3526: Grant Bluetooth CAP_WAKE_ALARM so it can use the POSIX timer API for wake alarms.
* commit '77eb35263f40607e36fdcd85d95050a4ecedb6b8':
  Grant Bluetooth CAP_WAKE_ALARM so it can use the POSIX timer API for wake alarms.
2014-07-01 20:02:37 +00:00
Sharvil Nanavati
77eb35263f Grant Bluetooth CAP_WAKE_ALARM so it can use the POSIX timer API for wake alarms.
Change-Id: Ic7b25e79116b90378e5e89a879d8e6b87e4f052e
2014-07-01 11:58:30 -07:00
Riley Spahn
3602071c33 am 596bcc76: Remove keystore auditallow statements from system.
* commit '596bcc768758f38534a537a3fb54875225417f2c':
  Remove keystore auditallow statements from system.
2014-07-01 18:34:16 +00:00
Riley Spahn
596bcc7687 Remove keystore auditallow statements from system.
Remove the auditallow statements related to keystore
in system_app and system_server.

Change-Id: I1fc25ff475299ee020ea19f9b6b5811f8fd17c28
2014-07-01 18:25:02 +00:00
Riley Spahn
0d9cefbb77 am 22e0c414: Remove auditallow statements causing log spam.
* commit '22e0c414a50feed2f0475ab0d75301dce3488873':
  Remove auditallow statements causing log spam.
2014-07-01 17:15:16 +00:00
Riley Spahn
22e0c414a5 Remove auditallow statements causing log spam.
Remove the auditallow statements from app.te and
binderservicedomain.te which were causing log spam.

Change-Id: If1c33d1612866df9f338e6d8c19d73950ee028eb
2014-07-01 09:48:58 -07:00
Nick Kralevich
f5ad1b7977 am 40b8fb9b: Merge "Add imms service and system_app_service type."
* commit '40b8fb9bef83551363fa2ee26fbad24f058ec66a':
  Add imms service and system_app_service type.
2014-07-01 16:29:15 +00:00
Nick Kralevich
40b8fb9bef Merge "Add imms service and system_app_service type." 2014-07-01 14:58:20 +00:00
Riley Spahn
b1ec3dfacd Add imms service and system_app_service type.
Map imms to system_app_service in service_contexts and add
the system_app_service type and allow system_app to add the
system_app_service.

Bug: 16005467
Change-Id: I06ca75e2602f083297ed44960767df2e78991140
2014-07-01 16:17:59 +00:00
Riley Spahn
a0d9e493b7 am 28b71808: Remove catchall for unregistered services.
* commit '28b7180824609bd083cc3a38df4ed94ed942f395':
  Remove catchall for unregistered services.
2014-06-30 22:59:37 +00:00
Riley Spahn
28b7180824 Remove catchall for unregistered services.
Remove the allow rule for default services in
binderservicedomain.te so we will need to whitelist any
services to be registered.

Change-Id: Ibca98b96a3c3a2cbb3722dd33b5eb52cb98cb531
2014-06-30 15:21:21 -07:00
Nick Kralevich
ab925f11db am 166c09e5: Merge "Preemptively adding services for pending commits."
* commit '166c09e59d450f6a06597b9e2b8e5ed3c0ebd044':
  Preemptively adding services for pending commits.
2014-06-30 17:45:27 +00:00
Sérgio Faria
2eb73eea4d am 536ddba8: Allow setopt on bluetooth\'s unix_stream_socket.
* commit '536ddba8986a0039f77809232477485dde6995a8':
  Allow setopt on bluetooth's unix_stream_socket.
2014-06-30 17:01:05 +00:00
Sérgio Faria
536ddba898 Allow setopt on bluetooth's unix_stream_socket.
This is extremely useful as it allows timeouts on the socket.
Since ioctl is allowed, setopt shouldn't be a problem.

Resolves denials, in 3rd party apps, such as:

avc:  denied  { setopt } for  pid=18107 comm="AudioRouter-6"
scontext=u:r:untrusted_app:s0 tcontext=u:r:bluetooth:s0
tclass=unix_stream_socket

Change-Id: I6f38d7b86983c517575b735f43b62a2ed811e81c
Signed-off-by: Sérgio Faria <sergio91pt@gmail.com>
2014-06-30 15:15:12 +00:00
Nick Kralevich
66b4b0c0a0 am ad891591: isolated_app: allow app_data_file execute
* commit 'ad891591e6c5d3ffffd2633672c48ab7e263cdec':
  isolated_app: allow app_data_file execute
2014-06-28 02:51:46 +00:00
Nick Kralevich
ad891591e6 isolated_app: allow app_data_file execute
Chrome renderer processes dlopen() a shared library from
gmscore. Open and read on app data file is already allowed,
but execute isn't, so the dlopen() fails. This is a regression
from K, where the dlopen succeeded.

Longer term, there's questions about whether this is appropriate
behavior for an isolated app. For now, allow the behavior.
See the discussion in b/15902433 for details.

Addresses the following denial:

  I/auditd  ( 5087): type=1400 audit(0.0:76): avc:  denied  { execute } for  comm="CrRendererMain" path="/data/data/com.google.android.gms/files/libAppDataSearchExt_armeabi_v7a.so" dev="mmcblk0p28" ino=83196 scontext=u:r:isolated_app:s0 tcontext=u:object_r:app_data_file:s0 tclass=file

Bug: 15902433
Change-Id: Ie98605d43753be8c31a6fe510ef2dde0bdb52678
2014-06-27 15:27:24 -07:00
Nick Kralevich
d8071ca162 am 1dcc1227: Merge "Adding policies for KeyStore MAC."
* commit '1dcc12277bc7dba43cae5bf78fcdcbbba41c3257':
  Adding policies for KeyStore MAC.
2014-06-26 23:20:52 +00:00
Nick Kralevich
0f9721740e am c491d5c0: Merge "Add missing services to service_contexts."
* commit 'c491d5c0b5e1e86ec87e40adf2de3ee66416a70a':
  Add missing services to service_contexts.
2014-06-26 19:52:34 +00:00
Nick Kralevich
ac0216ddbe am c0d14767: dumpstate: transition into vdc domain
* commit 'c0d14767e68f90138c8b017bf47e8b3e4fd1c01e':
  dumpstate: transition into vdc domain
2014-06-26 19:48:42 +00:00
Nick Kralevich
166c09e59d Merge "Preemptively adding services for pending commits." 2014-06-26 18:33:52 +00:00
Riley Spahn
182498e8fc Preemptively adding services for pending commits.
Adding services to service_contexts for the
pending commits Icf5997dd6a6ba5e1de675cf5f4334c78c2c037f1
and Ibe79be30b80c18ec45ff69db7527c7a4adf0ee08.

Change-Id: Ie898866d1ab3abba6211943e87bcec77ba568567
2014-06-27 13:23:53 -07:00
Nick Kralevich
1dcc12277b Merge "Adding policies for KeyStore MAC." 2014-06-26 18:12:01 +00:00
Nick Kralevich
c491d5c0b5 Merge "Add missing services to service_contexts." 2014-06-26 17:56:55 +00:00
Riley Spahn
2b4c4f3941 Add missing services to service_contexts.
Add missing services related to battery, bluetooth, time,
and radio to service_contexts.

Change-Id: I8bf05feb173d49637048c779757013806837fede
2014-06-26 12:36:43 -07:00
Riley Spahn
1196d2a576 Adding policies for KeyStore MAC.
Add keystore_key class and an action for each action supported
by keystore. Add policies that replicate the access control that
already exists in keystore. Add auditallow rules for actions
not known to be used frequently. Add macro for those domains
wishing to access keystore.

Change-Id: Iddd8672b9e9b72b45ee208e6eda608cc9dc61edc
2014-06-26 08:53:10 -07:00
Nick Kralevich
c0d14767e6 dumpstate: transition into vdc domain
dumpstate uses vdc to collect asec lists and do a vold dump.
Force a transition into the vdc domain when this occurs.

Addresses the following denial:

  <4>[ 1099.623572] type=1400 audit(1403716545.565:7): avc: denied { execute } for pid=6987 comm="dumpstate" name="vdc" dev="mmcblk0p8" ino=222 scontext=u:r:dumpstate:s0 tcontext=u:object_r:vdc_exec:s0 tclass=file permissive=0

Change-Id: I4bd9f3ad83480f8c9f9843ffe136295c582f96fe
2014-06-25 14:18:51 -07:00
Nick Kralevich
67d4927f14 am 8c6552ac: Allow system_server to read all /proc files
* commit '8c6552acfba677442d565a0c7f8e44f5f2af57f2':
  Allow system_server to read all /proc files
2014-06-25 17:52:31 +00:00
Nick Kralevich
8c6552acfb Allow system_server to read all /proc files
system_server scans through /proc to keep track of process
memory and CPU usage. It needs to do this for all processes,
not just appdomain processes, to properly account for CPU and
memory usage.

Allow it.

Addresses the following errors which have been showing up
in logcat:

  W/ProcessCpuTracker(12159): Skipping unknown process pid 1
  W/ProcessCpuTracker(12159): Skipping unknown process pid 2
  W/ProcessCpuTracker(12159): Skipping unknown process pid 3

Bug: 15862412
Change-Id: I0a75314824404e060c6914c06a371f2ff2e80512
2014-06-25 09:32:08 -07:00
Stephen Smalley
9afbb4d77a am a1558be5: Allow kernel sdcard read access as well for MTP sync.
* commit 'a1558be5e2a6f50ee41cee579d1bd5db808c8325':
  Allow kernel sdcard read access as well for MTP sync.
2014-06-24 19:35:30 +00:00
Stephen Smalley
de17b24b2b am eb6b74fa: Allow kernel sdcard access for MTP sync.
* commit 'eb6b74fa6b5c39afc04b92b5dc62fa633456220c':
  Allow kernel sdcard access for MTP sync.
2014-06-24 19:35:28 +00:00
Stephen Smalley
a1558be5e2 Allow kernel sdcard read access as well for MTP sync.
Change-Id: I004ae9aee23a28cb4975fcee51d24eb1a654f0b7
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-06-24 13:55:33 -04:00
Stephen Smalley
eb6b74fa6b Allow kernel sdcard access for MTP sync.
Address denials such as:
avc: denied { write } for pid=2587 comm="kworker/u:4" path="/storage/emulated/0/Download/AllFileFormatesFromTommy/Test3GP.3gp" dev="fuse" ino=3086052592 scontext=u:r:kernel:s0 tcontext=u:object_r:sdcard_internal:s0 tclass=file permissive=0

Change-Id: I351e84b48f1b5a3361bc680b2ef379961ac2e8ea
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Bug: 15835289
2014-06-24 13:20:43 -04:00
Riley Andrews
a0114f4e10 am 9f2d3f93: Merge "Give healthd permission to write sys properties to allow quick boot from charger mode."
* commit '9f2d3f93dae6b766a8c21e81b6dc56bf7374f4ef':
  Give healthd permission to write sys properties to allow quick boot from charger mode.
2014-06-23 21:05:53 +00:00
Stephen Smalley
492312434f am fee49159: Align SELinux property policy with init property_perms.
* commit 'fee49159e760162b0e8ee5a4590c50a65b8e322f':
  Align SELinux property policy with init property_perms.
2014-06-23 20:59:38 +00:00
Nick Kralevich
cf8dc85f63 am 0db95cce: unconfined: remove internet access
* commit '0db95cce33b33259e87b41c7fa1807f562c2d7d1':
  unconfined: remove internet access
2014-06-23 19:52:45 +00:00
Stephen Smalley
fee49159e7 Align SELinux property policy with init property_perms.
Introduce a net_radio_prop type for net. properties that can be
set by radio or system.
Introduce a system_radio_prop type for sys. properties that can be
set by radio or system.
Introduce a dhcp_prop type for properties that can be set by dhcp or system.
Drop the rild_prop vs radio_prop distinction; this was an early
experiment to see if we could separate properties settable by rild
versus other radio UID processes but it did not pan out.

Remove the ability to set properties from unconfineddomain.
Allow init to set any property.  Allow recovery to set ctl_default_prop
to restart adbd.

Change-Id: I5ccafcb31ec4004dfefcec8718907f6b6f3e0dfd
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-06-23 15:45:55 -04:00
Nick Kralevich
0db95cce33 unconfined: remove internet access
Don't allow unconfined domains to access the internet. Restrict
internet functionality to domains which explicitly declare their
use. Removing internet access from unconfined domains helps
protect daemons from network level attacks.

In unconfined.te, expand out socket_class_set, and explicitly remove
tcp_socket, udp_socket, rawip_socket, packet_socket, and
appletalk_socket. Remove name_bind, node_bind and name_connect rules,
since they only apply to internet accessible rules.

Add limited udp support to init.te. This is needed to bring up
the loopback interface at boot.

Change-Id: If756f3fed857f11e63a6c3a1a13263c57fdf930a
2014-06-23 11:28:30 -07:00
Stephen Smalley
f173a510fb am a893edae: Remove execmod access to system_file and exec_type.
* commit 'a893edae3716b33be62edf1b5f3336e6f6bb251b':
  Remove execmod access to system_file and exec_type.
2014-06-23 17:04:39 +00:00
Stephen Smalley
a893edae37 Remove execmod access to system_file and exec_type.
execmod is checked on attempts to make executable a file mapping
that has been modified.  Typically this indicates a text relocation
attempt.  As we do not ever allow this for any confined domain to
system_file or exec_type, we should not need it for unconfineddomain
either.

Change-Id: I8fdc858f836ae0d2aa56da2abd7797fba9c258b1
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-06-23 12:50:57 -04:00
Nick Kralevich
f55d145997 am bb75dd73: Merge "Create vdc domain"
* commit 'bb75dd732bd690c9bc6017679a3630a123266161':
  Create vdc domain
2014-06-23 15:54:47 +00:00
Nick Kralevich
b9540299d7 am 2e14164c: Merge "Allow init to relabel rootfs files."
* commit '2e14164cf3d92e00ca6b56f87db11ab1766e6c77':
  Allow init to relabel rootfs files.
2014-06-23 15:42:09 +00:00