Commit graph

10613 commits

Author SHA1 Message Date
Fyodor Kupolov
b1e3910a21 Merge "Split preloads into media_file and data_file" am: 2d22fd814f
am: 82d5e46eaf

Change-Id: Iaa6cf10a53062f2dfaad603b68c0956805743db2
2017-03-15 17:19:31 +00:00
Fyodor Kupolov
82d5e46eaf Merge "Split preloads into media_file and data_file"
am: 2d22fd814f

Change-Id: Ideb1e0e24cab235ea209d7b5d675793df00b726e
2017-03-15 17:14:38 +00:00
Fyodor Kupolov
2d22fd814f Merge "Split preloads into media_file and data_file" 2017-03-15 17:07:43 +00:00
Alex Klyubin
e8243518a7 Remove unused /selinux_version
This file is no longer needed because it was needed for supporting
reloadable/dynamic SELinux policy which is no longer supported.

Test: Clean build, flash, device boots without additional denials.
      Reboot to recovery works, no additional denials.
Bug: 33642277
Change-Id: I7fffe2fd12f586ed9b3ae54e35d17abdebbe7bce
2017-03-15 09:48:14 -07:00
Xin Li
6f2c6b23dc Merge "Fix build under GitC client." am: 9c5d9e65e5 am: 389a59ea76
am: 7ce5cce05f

Change-Id: I50a1b567678e38d32acdce4253222ddba8e05833
2017-03-15 02:18:38 +00:00
Xin Li
7ce5cce05f Merge "Fix build under GitC client." am: 9c5d9e65e5
am: 389a59ea76

Change-Id: I487d9f0b44594489f789e4ec76f5a9fdca88596b
2017-03-15 02:13:08 +00:00
Xin Li
389a59ea76 Merge "Fix build under GitC client."
am: 9c5d9e65e5

Change-Id: Idcecaa9727358b2fc7c08526587012f9375affe5
2017-03-15 02:08:07 +00:00
Treehugger Robot
9c5d9e65e5 Merge "Fix build under GitC client." 2017-03-15 01:58:41 +00:00
Nick Kralevich
398e3f2c36 allow run-as to carry unix_stream_sockets am: 3b97552ffb am: b2726c6161
am: 4cf3c97269

Change-Id: I482a6c14f4420c69073373e39cd09c66ca8d4c4f
2017-03-15 01:38:35 +00:00
Nick Kralevich
4cf3c97269 allow run-as to carry unix_stream_sockets am: 3b97552ffb
am: b2726c6161

Change-Id: Id4a44a6bd7b40fc5ab68ef9e92c0e8c827b7907b
2017-03-15 01:33:05 +00:00
Nick Kralevich
b2726c6161 allow run-as to carry unix_stream_sockets
am: 3b97552ffb

Change-Id: I32ca6642f29a75d572961e86e6be9ef45b277af7
2017-03-15 01:28:05 +00:00
Fyodor Kupolov
b238fe6662 Split preloads into media_file and data_file
Untrusted apps should only access /data/preloads/media and demo directory.

Bug: 36197686
Test: Verified retail mode.
      Checked non-privileged APK cannot access /data/preloads
Change-Id: I8e9c21ff6aba799aa31bf06893cdf60dafc04446
2017-03-15 00:49:37 +00:00
Xin Li
ec6f393d07 Fix build under GitC client.
Test: build
Bug: 36229129
Change-Id: I0654ce44f344729b0bb1f8716afa151e134fdc6a
2017-03-14 17:23:54 -07:00
Nick Kralevich
3b97552ffb allow run-as to carry unix_stream_sockets
Allow run-as to transmit unix_stream_sockets from the shell user to
Android apps. This is needed for Android Studio's profiling tool to
allow communcation between apps and debugging tools which run as the
shell user.

Bug: 35672396
Test: Functionality was tested by shukang
Test: policy compiles.
Change-Id: I2cc2e4cd5b9071cbc7d6f6b5b0b71595fecb455e
2017-03-14 16:25:07 -07:00
Alex Klyubin
c2d6acfe5e Switch Sensors HAL policy to _client/_server am: 41518bec25 am: 6a0ba6c580
am: 37ec9b0a86

Change-Id: Iab8c116dc92313a7d987fd3c4b370da6d9483772
2017-03-14 22:10:57 +00:00
Alex Klyubin
37ec9b0a86 Switch Sensors HAL policy to _client/_server am: 41518bec25
am: 6a0ba6c580

Change-Id: I5cc4c5694ce4dc08b9e9db63e8ec2bde47ab7f12
2017-03-14 22:05:27 +00:00
Alex Klyubin
6a0ba6c580 Switch Sensors HAL policy to _client/_server
am: 41518bec25

Change-Id: I1dab4e9ed558ac04fdf78b03d0d4e753687a6ee2
2017-03-14 22:00:28 +00:00
Alex Klyubin
41518bec25 Switch Sensors HAL policy to _client/_server
This switches Sensors HAL policy to the design which enables us to
conditionally remove unnecessary rules from domains which are clients
of Sensors HAL.

Domains which are clients of Sensors HAL, such as system_server, are
granted rules targeting hal_sensors only when the Sensors HAL runs in
passthrough mode (i.e., inside the client's process). When the HAL
runs in binderized mode (i.e., in another process/domain, with clients
talking to the HAL over HwBinder IPC), rules targeting hal_sensors are
not granted to client domains.

Domains which offer a binderized implementation of Sensors HAL, such
as hal_sensors_default domain, are always granted rules targeting
hal_sensors.

P. S. This commit also removes
  allow system_server sensors_device:chr_file rw_file_perms
because this is device-specific and thus not needed in device-agnostic
policy. The device-specific policy of the affected devices already has
this rule.

Test: Device boots, no new denials
Test: adb shell dumpsys sensorservice
      lists tons of sensors
Test: Proprietary sensors test app indicates that there are sensors
      and that the app can register to listen for updates for sensors
      and that such updates arrive to the app.
Bug: 34170079
Change-Id: I61bf779070eabcb64ae73724d62b6e837319a668
2017-03-14 12:43:29 -07:00
Jeff Vander Stoep
04909edb4b Merge "Restrict HAL network access to HALS that manage network hardware" am: b9b6370640 am: 3b89662367
am: 5002eb06fc

Change-Id: Idbfdfca9be49e476fe50cc1834f652e8e00ec862
2017-03-14 13:23:57 +00:00
Jeff Vander Stoep
e0c8c89f54 Enforce separation of privilege for HAL driver access am: 7fa59c819c am: fa633e527c
am: a023a9e525

Change-Id: I5eff6e6bc209f4da83602e3a5501d5c081525e24
2017-03-14 13:23:47 +00:00
Jeff Vander Stoep
5002eb06fc Merge "Restrict HAL network access to HALS that manage network hardware" am: b9b6370640
am: 3b89662367

Change-Id: Ieb3e865a15ecb790b9abb4095d16934615ff411d
2017-03-14 13:18:56 +00:00
Jeff Vander Stoep
a023a9e525 Enforce separation of privilege for HAL driver access am: 7fa59c819c
am: fa633e527c

Change-Id: I990ad43e82c565f3962059170e1b34e857d6b278
2017-03-14 13:18:46 +00:00
Jeff Vander Stoep
3b89662367 Merge "Restrict HAL network access to HALS that manage network hardware"
am: b9b6370640

Change-Id: I32c85f2ba81e8be3b0065ac0d8e737cd323f86a1
2017-03-14 13:13:57 +00:00
Jeff Vander Stoep
fa633e527c Enforce separation of privilege for HAL driver access
am: 7fa59c819c

Change-Id: Ie8b09c70a4bcaadf6794386af17db9c8a67de6ba
2017-03-14 13:13:46 +00:00
Treehugger Robot
b9b6370640 Merge "Restrict HAL network access to HALS that manage network hardware" 2017-03-14 13:08:49 +00:00
Jeff Vander Stoep
7fa59c819c Enforce separation of privilege for HAL driver access
Only audio HAL may access audio driver.
Only camera HAL may access camera driver.

Test: aosp_marlin and aosp_bullhead policy builds. Note: neverallow
      rules are compile time assertions and do not change the
      on-device policy.
Bug: 36185625
Change-Id: I1c9edf528080374f5f0d90d3c14d6c3b162484a3
2017-03-13 22:40:01 -07:00
Jeff Vander Stoep
f9be765d66 Restrict HAL network access to HALS that manage network hardware
Only HALs that manage networks need network capabilities and network
sockets.

Test: aosp_marlin and aosp_bullhead policy builds. Note: neverallow
      rules are compile time assertions and do not change the
      on-device policy.
Bug: 36185625

Change-Id: Id64846eac24cf72ed91ce775cecb2c75f11b78df
2017-03-13 21:35:48 -07:00
Alex Klyubin
c2c9782a19 Correct location of property_contexts for TREBLE devices am: 9d59041f63 am: f8b119831e
am: 947be7db3a

Change-Id: Icd14c5c6c0b93d71c5c74e575f71ceb68e8fa212
2017-03-13 22:05:22 +00:00
Alex Klyubin
947be7db3a Correct location of property_contexts for TREBLE devices am: 9d59041f63
am: f8b119831e

Change-Id: I977bd021c529c3daa20c9c561ca0cb817116e99c
2017-03-13 21:59:23 +00:00
Alex Klyubin
f8b119831e Correct location of property_contexts for TREBLE devices
am: 9d59041f63

Change-Id: I3c8cb8b54038aae30c3e7dd3c22d171f7db90f0b
2017-03-13 21:54:51 +00:00
Alex Klyubin
9d59041f63 Correct location of property_contexts for TREBLE devices
This makes the build system, for TREBLE devices only, place
plat_property_contexts under /system/etc/selinux and
nonplat_property_contexts under /vendor/etc/selinux. For other devices
these files are placed under /, same as before.

This change was previously reverted because it affected the location
of property_contexts in recovery. Now that we have separate tagets for
recovery (see ec78c377c0), this change
no longer affects is recovery.

Test: *_property_contexts in correct locations when
      PRODUCT_FULL_TREBLE is set to true and when it is set to false.

Test: cts-tradefed run singleCommand cts --skip-device-info \
      --skip-preconditions --skip-connectivity-check \
      --abi arm64-v8a --module CtsSecurityHostTestCases \
      -t android.security.cts.SELinuxHostTest#testAospPropertyContexts

      This test was performed on bullhead (non A/B device) and sailfish
      (A/B device).

Test: Clean build, flash, device boots with no additional denials.
      Rebooting to recovery, recovery boots fine with no denials.
      This test was performed on bullhead (non A/B device) and sailfish
      (A/B device).
Bug: 36002573

(cherry picked from commit 4cb628a3be)

Change-Id: I0b145c58669fb31bc39d57f36eef1190425a8328
2017-03-13 11:37:26 -07:00
Alex Klyubin
ceced8d243 Targets for artifacts needed by recovery am: ec78c377c0 am: bd56a3d73b
am: 06556bd787

Change-Id: I2bb47416f8427033b525aadee07d446571c1f95d
2017-03-13 18:33:48 +00:00
Alex Klyubin
06556bd787 Targets for artifacts needed by recovery am: ec78c377c0
am: bd56a3d73b

Change-Id: I1f6980eefbc1f6233710015987a03095f36cfaaa
2017-03-13 18:29:16 +00:00
Alex Klyubin
bd56a3d73b Targets for artifacts needed by recovery
am: ec78c377c0

Change-Id: I7abad16dd46c5a8e836037d2db8f698168daec23
2017-03-13 18:24:47 +00:00
Alex Klyubin
ec78c377c0 Targets for artifacts needed by recovery
This ensures that SELinux policy artifact needed by recovery at
runtime have targets in this build script. This is to make
recoveryimage/bootimage targets depend on these artifacts explicitly,
which reduces the element of surprise. Moreover, this enables us to
move non-recovery artifacts around without affecting recovery
artifacts.

Test: Clean build, flash, device boots just fine, no new denials.
      Reboot to recovery, recovery boots just fine, no denials.
      This was tested on bullhead (non A/B device) and sailfish (A/B
      device).
Bug: 33642277
Change-Id: I3c494d9d7fec5c4f487d38964e572757fcf67f57
2017-03-13 08:42:52 -07:00
Josh Gao
155484e683 Allow writing to tombstone files in crash_dump_fallback. am: a10008c797 am: 3e6e473339
am: 43343dc17b

Change-Id: I1973c68b7ee8230f73be7de4913ecbae84d68fac
2017-03-13 03:53:51 +00:00
Josh Gao
43343dc17b Allow writing to tombstone files in crash_dump_fallback. am: a10008c797
am: 3e6e473339

Change-Id: I31df73b3af41b35e535a4d04a86ebde2acb4ba76
2017-03-13 03:49:52 +00:00
Josh Gao
3e6e473339 Allow writing to tombstone files in crash_dump_fallback.
am: a10008c797

Change-Id: If51ebd6bd1bb1f910a43ef16572a1ccf1929d445
2017-03-13 03:45:21 +00:00
Josh Gao
a10008c797 Allow writing to tombstone files in crash_dump_fallback.
Allows the following denials:
     avc: denied { use } for pid=9099 comm="mediacodec" path="/data/tombstones/tombstone_08" dev="sda35" ino=877473 scontext=u:r:mediacodec:s0 tcontext=u:r:tombstoned:s0 tclass=fd permissive=1
     avc: denied { append } for pid=9099 comm="mediacodec" path="/data/tombstones/tombstone_08" dev="sda35" ino=877473 scontext=u:r:mediacodec:s0 tcontext=u:object_r:tombstone_data_file:s0 tclass=file permissive=1

Bug: http://b/36156624
Test: killall -ABRT media.codec
Test: killall -ABRT media.extractor
Change-Id: I3dde1879b44e3e63c747a3ff8dd4bf213cb8afb6
2017-03-12 19:03:29 -07:00
Jeff Vander Stoep
302895b808 Split mac_permissions.xml to /system and /vendor am: bba9e7b92d am: 54d72c5c92
am: b7a91d710a

Change-Id: I80d0b7e02ebb36b1360e0c87c996fa27ed82be5a
2017-03-11 23:40:03 +00:00
Jeff Vander Stoep
b7a91d710a Split mac_permissions.xml to /system and /vendor am: bba9e7b92d
am: 54d72c5c92

Change-Id: Idb48b52f929d1f7940da4d28c41dacfd4089a1c2
2017-03-11 23:36:14 +00:00
Jeff Vander Stoep
54d72c5c92 Split mac_permissions.xml to /system and /vendor
am: bba9e7b92d

Change-Id: I4d8dcc67d688f889dd8e891cdc9c67cd2b69e14a
2017-03-11 23:29:00 +00:00
Jeff Vander Stoep
bba9e7b92d Split mac_permissions.xml to /system and /vendor
Test: Build and boot Marlin
Test: See the following in the logs:
01-01 02:10:28.756  1345  1345 D SELinuxMMAC: Using policy file /system/etc/selinux/plat_mac_permissions.xml
01-01 02:10:28.787  1345  1345 D SELinuxMMAC: Using policy file /vendor/etc/selinux/nonplat_mac_permissions.xml
Bug: 36003167

Change-Id: If17490a2a5d94bfea1fa6d282282d45d67e207e9
2017-03-11 00:08:37 +00:00
Jeff Vander Stoep
9b3e6d324e Move split file_contexts to /system and /vendor am: 0cb417a639 am: f8acce2d3f
am: 5e77ac3189

Change-Id: I126f12836f1fda78e308b9020dddc1ecd83d362d
2017-03-11 00:06:59 +00:00
Jeff Vander Stoep
5e77ac3189 Move split file_contexts to /system and /vendor am: 0cb417a639
am: f8acce2d3f

Change-Id: I014b4e7ef060f69f0a9fbea506956e81687adf0a
2017-03-11 00:03:23 +00:00
Jeff Vander Stoep
f8acce2d3f Move split file_contexts to /system and /vendor
am: 0cb417a639

Change-Id: Ib9ed9bbbe00a406d8477c4f20496761e73bea1ca
2017-03-10 23:59:51 +00:00
Jeff Vander Stoep
0cb417a639 Move split file_contexts to /system and /vendor
Build file_contexts.bin on legacy builds.
Test: Marlin and Bullhead build and boot with no new denials.
Test: Marlin and Bullhead recovery boots with no new denials.
Test: Bullhead boots with file_contexts.bin in /
Test: Marlin boot with /system/etc/selinux/plat_file_contexts and
      /vendor/etc/selinux/nonplat_file_contexts.
Bug: 36002414

Change-Id: Ide8498b3c86234d2f93bb22a7514d132c33067d6
2017-03-10 22:11:35 +00:00
Alex Klyubin
ab05ad89af Remove unnecessary recovery-related targets am: 84aa742184 am: 1dc74d1670
am: e02334f7cf

Change-Id: Iffe4ef9db7989f789aef8154be9252e2db649991
2017-03-10 19:48:16 +00:00
Alex Klyubin
e02334f7cf Remove unnecessary recovery-related targets am: 84aa742184
am: 1dc74d1670

Change-Id: I17b25652a55ccfe8cbce8e03cfef930e1368946c
2017-03-10 19:45:16 +00:00
Alex Klyubin
1dc74d1670 Remove unnecessary recovery-related targets
am: 84aa742184

Change-Id: Id00256c203466ea6e67147b2cf7a3fe6cebf8059
2017-03-10 19:42:16 +00:00