Commit graph

3153 commits

Author SHA1 Message Date
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
7622d50a35 am 66b4b0c0: am ad891591: isolated_app: allow app_data_file execute
* commit '66b4b0c0a057ca6b7e604753daeb9a43ef50849f':
  isolated_app: allow app_data_file execute
2014-06-29 03:24:49 +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
76ad64e6ea am d8071ca1: am 1dcc1227: Merge "Adding policies for KeyStore MAC."
* commit 'd8071ca162bea010788f355d60576a95d0250892':
  Adding policies for KeyStore MAC.
2014-06-26 23:24:04 +00: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
6982f3ecfb am 0f972174: am c491d5c0: Merge "Add missing services to service_contexts."
* commit '0f9721740e71aef941a42a8ed641896611173e55':
  Add missing services to service_contexts.
2014-06-26 19:57:59 +00:00
Nick Kralevich
014272f5b7 am ac0216dd: am c0d14767: dumpstate: transition into vdc domain
* commit 'ac0216ddbec3dc891b2fde928619d920a2c20938':
  dumpstate: transition into vdc domain
2014-06-26 19:54:14 +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
Riley Spahn
c9febc7baa Add fingerprint to service_contexts.
Add fingerprint to map to system_server_service.

Change-Id: I8fbb13df981794d52d30b963eeea2df36fb09a42
2014-06-25 19:48:45 +00:00
Nick Kralevich
120d5b81d9 am 67d4927f: am 8c6552ac: Allow system_server to read all /proc files
* commit '67d4927f1484030e4fcda3ffdbd909d1ae81d724':
  Allow system_server to read all /proc files
2014-06-25 18:47:01 +00: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
15b40c08e1 am 9afbb4d7: am a1558be5: Allow kernel sdcard read access as well for MTP sync.
* commit '9afbb4d77a55c35e84cb2d996d37c96dcecb8158':
  Allow kernel sdcard read access as well for MTP sync.
2014-06-24 19:42:38 +00:00
Stephen Smalley
e0b7cbc40f am de17b24b: am eb6b74fa: Allow kernel sdcard access for MTP sync.
* commit 'de17b24b2b4e6dfec11762871b7c5ae94db645c2':
  Allow kernel sdcard access for MTP sync.
2014-06-24 19:42:38 +00: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
6d4f1e05d4 am a0114f4e: am 9f2d3f93: Merge "Give healthd permission to write sys properties to allow quick boot from charger mode."
* commit 'a0114f4e10165b263c951d3f19225745e8f83767':
  Give healthd permission to write sys properties to allow quick boot from charger mode.
2014-06-23 21:12:07 +00: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
d9dc1f978a am 49231243: am fee49159: Align SELinux property policy with init property_perms.
* commit '492312434fcd34e0158955ed34cea029bbb2a33e':
  Align SELinux property policy with init property_perms.
2014-06-23 21:04:52 +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
525c2af73a am cf8dc85f: am 0db95cce: unconfined: remove internet access
* commit 'cf8dc85f631154c09bee6a33a322e0dd7aa172c5':
  unconfined: remove internet access
2014-06-23 19:58:28 +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
85d454a23d am f173a510: am a893edae: Remove execmod access to system_file and exec_type.
* commit 'f173a510fbbd306a32383af8b4e962caf2783b00':
  Remove execmod access to system_file and exec_type.
2014-06-23 17:08:35 +00: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
9ec24a796d am f55d1459: am bb75dd73: Merge "Create vdc domain"
* commit 'f55d145997230fe1ae645e4fd93a4dcd1c35021a':
  Create vdc domain
2014-06-23 15:58:33 +00: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
d4ab8bd781 am b9540299: am 2e14164c: Merge "Allow init to relabel rootfs files."
* commit 'b9540299d75381834aa14ab36dec002ca8db9ba7':
  Allow init to relabel rootfs files.
2014-06-23 15:45:40 +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
Nick Kralevich
bb75dd732b Merge "Create vdc domain" 2014-06-23 14:50:49 +00:00
Nick Kralevich
2e14164cf3 Merge "Allow init to relabel rootfs files." 2014-06-23 14:50:49 +00:00
Nick Kralevich
fb2063843d am 1afd62d3: am 67d1f1ec: Allow dumpsys from serial console
* commit '1afd62d38fe1433e353a8ee43afac804a982c589':
  Allow dumpsys from serial console
2014-06-23 14:16:35 +00:00
Nick Kralevich
1afd62d38f am 67d1f1ec: Allow dumpsys from serial console
* commit '67d1f1ecf544d981a16fe8b780986f22b00add3d':
  Allow dumpsys from serial console
2014-06-23 14:12:32 +00:00
Stephen Smalley
c626a882f5 Allow init to relabel rootfs files.
This is required for the restorecon /adb_keys in init.rc or
for any other relabeling of rootfs files to more specific types on
kernels that support setting security contexts on rootfs inodes.

Addresses denials such as:
  avc: denied { relabelfrom } for comm="init" name="adb_keys" dev="rootfs" ino=1917 scontext=u:r:init:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
We do not need to prohibit relabelfrom of such files because our goal
is to prevent writing to executable files, while relabeling the file
to another type will take it to a non-executable (or non-writable) type.
In contrast, relabelto must be prohibited by neverallow so that a
modified file in a writable type cannot be made executable.

Change-Id: I7595f615beaaa6fa524f3c32041918e197bfbebe
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-06-23 09:17:51 -04:00
Nick Kralevich
67d1f1ecf5 Allow dumpsys from serial console
Trying to run dumpsys from the serial console generates the
following errors:

  shell@device:/ # dumpsys power
  [ 3244.099015] binder: 2259:2259 transaction failed 29201, size 28-8
  [ 3244.099291] type=1400 audit(1403313679.642:12): avc: denied { read write } for pid=2259 comm="dumpsys" path="/dev/console" dev="tmpfs" ino=6188 scontext=u:r:system_server:s0 tcontext=u:object_r:console_device:s0 tclass=chr_file permissive=0
  Error dumping service info: (Unknown error -2147483646) power

and the operation fails. Allow binderservicedomains to perform
writes to /dev/console.

Bug: 15779131
Change-Id: Iff55ab09c3a4d40e12d49ff2308bf147f9cb6937
2014-06-21 01:53:22 +00:00
Nick Kralevich
bf8a37b8eb Create vdc domain
The init.rc one-shot services "defaultcrypto" and "encrypt" call
out to the /system/bin/vdc command line to ask vold to perform
encryption operations. Create a new domain for these one-shot
services. Allow the vdc domain to talk to vold.

Change-Id: I73dc2ee4cc265bc16056b27307c254254940fd9f
2014-06-21 01:40:54 +00:00