Commit graph

10517 commits

Author SHA1 Message Date
Steven Moreland
3c1a95d683 Merge "adbd: use hal_client_domain" am: 5a9410cf7a am: aa5feec9f3
am: d34c7eefda

Change-Id: Ieb708734a6578e9f7bc43731e6b297704f8f3937
2017-03-27 17:37:40 +00:00
Steven Moreland
d34c7eefda Merge "adbd: use hal_client_domain" am: 5a9410cf7a
am: aa5feec9f3

Change-Id: I3ba818c67e9134161dfd9c74d9fdb52f0bd51bef
2017-03-27 17:34:08 +00:00
Steven Moreland
aa5feec9f3 Merge "adbd: use hal_client_domain"
am: 5a9410cf7a

Change-Id: I4cf02d403a045bce6da96939406a886197f5a1a5
2017-03-27 17:31:10 +00:00
Treehugger Robot
5a9410cf7a Merge "adbd: use hal_client_domain" 2017-03-27 17:28:38 +00:00
Alex Klyubin
2746ae6822 Ban socket connections between core and vendor
On PRODUCT_FULL_TREBLE devices, non-vendor domains (coredomain) and
vendor domain are not permitted to connect to each other's sockets.
There are two main exceptions: (1) apps are permitted to talk to other
apps over Unix domain sockets (this is public API in Android
framework), and (2) domains with network access (netdomain) are
permitted to connect to netd.

This commit thus:
* adds neverallow rules restricting socket connection establishment,
* temporarily exempts the domains which are currently violating this
  rule from this restriction. These domains are grouped using the new
  "socket_between_core_and_vendor_violators" attribute. The attribute
  is needed because the types corresponding to violators are not
  exposed to the public policy where the neverallow rules are.

Test: mmm system/sepolicy
Bug: 36613996
Change-Id: I458f5a09a964b06ad2bddb52538ec3a15758b003
2017-03-27 08:49:13 -07:00
Jeff Sharkey
b16aaef36f Grant kernel access to new "virtual_disk" file. am: 3f724c95a8 am: 9222988479
am: a4960ef90f

Change-Id: Ia6fbb2aae4d5c66e868e43b279748a7a96ae3bf7
2017-03-26 23:49:29 +00:00
Jeff Sharkey
a4960ef90f Grant kernel access to new "virtual_disk" file. am: 3f724c95a8
am: 9222988479

Change-Id: Idd03a8f1a6b3a315ee6be221ea7d91b06be9477e
2017-03-26 23:46:29 +00:00
Jeff Sharkey
9222988479 Grant kernel access to new "virtual_disk" file.
am: 3f724c95a8

Change-Id: Ia390c3537b7efe897154380ee836dbb7ac0ed742
2017-03-26 23:43:58 +00:00
Jeff Sharkey
3f724c95a8 Grant kernel access to new "virtual_disk" file.
This is a special file that can be mounted as a loopback device to
exercise adoptable storage code on devices that don't have valid
physical media.  For example, they may only support storage media
through a USB OTG port that is being used for an adb connection.

avc: denied { read } for path="/data/misc/vold/virtual_disk" dev="sda35" ino=508695 scontext=u:r:kernel:s0 tcontext=u:object_r:vold_data_file:s0 tclass=file permissive=0

Bug: 34903607
Change-Id: I84721ec0e9495189a7d850461875df1839826212
2017-03-26 16:00:56 -06:00
Jeff Vander Stoep
d4a3e9dd48 Create selinux_policy phony target
Moves selinux policy build decisions to system/sepolicy/Android.mk.
This is done because the PRODUCT_FULL_TREBLE variable isn't available
in embedded.mk and TARGET_SANITIZE isn't available to dependencies of
init.

Test: Build/boot Bullhead PRODUCT_FULL_TREBLE=false
Test: Build/boot Marlin PRODUCT_FULL_TREBLE=true
Test: Build Marlin TARGET_SANITIZE=address. Verify asan rules are
      included in policy output.
Bug: 36138508
Change-Id: I20a25ffdfbe2b28e7e0f3e090a4df321e85e1235
2017-03-26 21:52:14 +00:00
Jeff Sharkey
581bd5446b Merge "Define policy for "loop-control" device." am: 2224f30a24 am: a6152592cf
am: d33a51c3fd

Change-Id: Ife99cd6fc85b77ea77ca1edc9a8c741ee0d204ee
2017-03-26 20:38:48 +00:00
Jeff Sharkey
d33a51c3fd Merge "Define policy for "loop-control" device." am: 2224f30a24
am: a6152592cf

Change-Id: I7f1ad41abd96abaef416d4cb3352fa475cffff5d
2017-03-26 20:36:18 +00:00
Jeff Sharkey
a6152592cf Merge "Define policy for "loop-control" device."
am: 2224f30a24

Change-Id: I184272269fed360807e41a1cac1fe099477685e6
2017-03-26 20:33:18 +00:00
Jeff Sharkey
2224f30a24 Merge "Define policy for "loop-control" device." 2017-03-26 20:29:19 +00:00
Steven Moreland
0f40a5dc30 Merge "Allow system_server to dump stack traces for hals." am: 133d529862 am: 5ebf197505
am: 518e14e610

Change-Id: I2b9c58cf3e7f583d8a099545696f06e741e7d2b2
2017-03-26 20:16:47 +00:00
Steven Moreland
518e14e610 Merge "Allow system_server to dump stack traces for hals." am: 133d529862
am: 5ebf197505

Change-Id: I1033e791b718bd1c374885f3a16b176994bb957f
2017-03-26 20:14:18 +00:00
Steven Moreland
5ebf197505 Merge "Allow system_server to dump stack traces for hals."
am: 133d529862

Change-Id: I934f58768bd30de9c62d33e83b6a1b60f0d0fb9b
2017-03-26 20:11:50 +00:00
Treehugger Robot
133d529862 Merge "Allow system_server to dump stack traces for hals." 2017-03-26 20:08:08 +00:00
Jeff Sharkey
a8e0f76c44 Define policy for "loop-control" device.
Per loop(4), this device is the preferred way of allocating new
loop devices since Linux 3.1.

avc: denied { read write } for name="loop-control" dev="tmpfs" ino=15221 scontext=u:r:vold:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=0

Bug: 34903607
Change-Id: I1f5f62cf0a1c24c6f6453100004812af4b8e1503
2017-03-25 21:39:03 -06:00
William Roberts
5f71c06bac build: stop generating $T/file_contexts am: 5d0c2e417b am: 72bdc353ed
am: 453537370c

Change-Id: Ifbd0f8bc238fe7ec49299b20dec36b0a07a580df
2017-03-26 00:39:40 +00:00
William Roberts
453537370c build: stop generating $T/file_contexts am: 5d0c2e417b
am: 72bdc353ed

Change-Id: I461829999d3413254a837ffb4612316d9d992acd
2017-03-26 00:37:09 +00:00
William Roberts
72bdc353ed build: stop generating $T/file_contexts
am: 5d0c2e417b

Change-Id: I30a0587f8bb4a99a97ddce7d989302f9a89a02af
2017-03-26 00:34:39 +00:00
TreeHugger Robot
e3c42d76a6 Merge "mediacodec violates "no Binder in vendor" rule" 2017-03-26 00:31:38 +00:00
William Roberts
5d0c2e417b build: stop generating $T/file_contexts
secilc is being used without -f which is causing a file_contexts
file to be generated in the root of the tree where the build tools
run:

$ stat $T/file_contexts
  File: 'file_contexts'
  Size: 0         	Blocks: 0          IO Block: 4096   regular empty file
Device: fc00h/64512d	Inode: 5508958     Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1000/wcrobert)   Gid: ( 1000/wcrobert)
Access: 2017-03-23 11:23:41.691538047 -0700
Modify: 2017-03-23 11:23:41.691538047 -0700
Change: 2017-03-23 11:23:41.691538047 -0700

Test: remove $T/file_contexts, touch a policy file and make sepolicy,
      ensure file is not regenerated. Also, ensure hikey builds and
      boots.

Change-Id: I0d15338a540dba0194c65a1436647c7d38fe3c79
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2017-03-25 22:43:24 +00:00
Steven Moreland
7bd7d417bf adbd: use hal_client_domain
Bug: 36546152
Bug: 36278706

Test: `adb shell screencap ...` and pull and visually verify image.
Change-Id: Iab2ddcfc145cb7f55104cd8f1ce0d58286bca282
2017-03-24 18:55:56 -07:00
Alex Deymo
bb0d3c50fb Merge "Allow update_engine to kill postinstall process." am: 987014c894 am: adabd898c5
am: 81e48f9724

Change-Id: I0f30763ac163bb5032d296097b346eec10ed2dc2
2017-03-25 01:50:51 +00:00
Alex Deymo
81e48f9724 Merge "Allow update_engine to kill postinstall process." am: 987014c894
am: adabd898c5

Change-Id: I1eb82bf76bfef80bbb51e636d166e55a30b234bf
2017-03-25 01:48:49 +00:00
Alex Deymo
adabd898c5 Merge "Allow update_engine to kill postinstall process."
am: 987014c894

Change-Id: I97a2e56097ca2f4a23ae682afcb86c47d9fd8749
2017-03-25 01:46:19 +00:00
Alex Deymo
987014c894 Merge "Allow update_engine to kill postinstall process." 2017-03-25 01:43:45 +00:00
Steven Moreland
fac3144b12 Allow system_server to dump stack traces for hals.
Test: `adb shell am hang --allow-restart` -> Watchdog dumps
  hal traces (eventually)
Bug: 36414311

Change-Id: I57e6875998b1f06a7deec1b8774facb75148d2c1
2017-03-24 17:48:25 -07:00
Alex Klyubin
44df5b9432 mediacodec violates "no Binder in vendor" rule
This adds mediacodec to the list of temporary exemptions from the "no
Binder in vendor" rule.

Test: mmm system/sepolicy
Bug: 35870313
Change-Id: I0f00d4bfb90d6da45ae2fed65864bb8fb0a4e78e
2017-03-24 17:22:17 -07:00
Alex Klyubin
5e6a4dd332 Merge "Mark all clients of Allocator HAL" am: 73a6f38b94 am: 5d8fcf3bb0
am: f91f369d68

Change-Id: I58593c82cd9b7b1dc7fcdfa8916f4bf55a3d9ab4
2017-03-24 22:52:37 +00:00
Alex Klyubin
f91f369d68 Merge "Mark all clients of Allocator HAL" am: 73a6f38b94
am: 5d8fcf3bb0

Change-Id: I5f88b48df906acb9381dc853d61dcd5ef8d5e4e4
2017-03-24 22:50:36 +00:00
Alex Klyubin
5d8fcf3bb0 Merge "Mark all clients of Allocator HAL"
am: 73a6f38b94

Change-Id: I24d9be712209ee22a33ae858001c4e38e0eb763a
2017-03-24 22:48:41 +00:00
Alex Klyubin
73a6f38b94 Merge "Mark all clients of Allocator HAL" 2017-03-24 22:42:35 +00:00
Alex Klyubin
882bfbbab7 su and perfprofd are coredomain too am: 6b558dcbea am: e1742ef066
am: f535a40d6e

Change-Id: I66da4d14a2388b1241b755280682f6e7d93d3830
2017-03-24 22:39:36 +00:00
Alex Klyubin
f535a40d6e su and perfprofd are coredomain too am: 6b558dcbea
am: e1742ef066

Change-Id: I007ae4064a8daf690b15bc5196131169727cbec9
2017-03-24 22:38:06 +00:00
Alex Klyubin
e1742ef066 su and perfprofd are coredomain too
am: 6b558dcbea

Change-Id: I82c412038e43bb343dc355c9d1e56a11f6da6542
2017-03-24 22:35:41 +00:00
Alex Klyubin
7cda44f49f Mark all clients of Allocator HAL
This change associates all domains which are clients of Allocator HAL
with hal_allocator_client and the, required for all HAL client
domains, halclientdomain.

This enables this commit to remove the now unnecessary hwallocator_use
macro because its binder_call(..., hal_allocator_server) is covered by
binder_call(hal_allocator_client, hal_allocator_server) added in this
commit.

Unfortunately apps, except isolated app, are clients of Allocator HAL
as well. This makes it hard to use the hal_client_domain(...,
hal_allocator) macro because it translates into "typeattribute" which
currently does not support being provided with a set of types, such as
{ appdomain -isolated_app }. As a workaround, hopefully until
typeattribute is improved, this commit expresses the necessary
association operation in CIL. private/technical_debt.cil introduced by
this commit is appended into the platform policy CIL file, thus
ensuring that the hack has effect on the final monolithic policy.

P. S. This change also removes Allocator HAL access from isolated_app.
Isolated app shouldn't have access to this HAL anyway.

Test: Google Play Music plays back radios
Test: Google Camera records video with sound and that video is then
      successfully played back with sound
Test: YouTube app plays back clips with sound
Test: YouTube in Chrome plays back clips with sound
Bug: 34170079
Change-Id: Id00bba6fde83e7cf04fb58bc1c353c2f66333f92
2017-03-24 13:54:43 -07:00
Alex Klyubin
6b558dcbea su and perfprofd are coredomain too
This is a follow-up to f5446eb148 where
I forgot to associate su and perfprofd domains with coredomain.

Test: mmm system/sepolicy
      sepolicy-analyze $OUT/root/sepolicy attribute coredomain
Bug: 35870313
Change-Id: I13f90693843f7c6fe9fea8e5332aa6dd9558478a
2017-03-24 09:31:50 -07:00
Alex Klyubin
d9ff859704 Mark vr_wm as coredomain
This couldn't be done in earlier because this domain does not yet exist
in AOSP master.

Test: mmm system/sepolicy -- no errors
Bug: 35870313
Change-Id: I323e5c22e471cd1900b88d0d1d4edfb5973a33d7
2017-03-24 08:06:28 -07:00
Alex Klyubin
68e6109d4a Vendor domains must not use Binder am: f5446eb148 am: 2fe065d708
am: 49ce439425

Change-Id: I1b38d903e61188594d0de80be479e7d9e045fb26
2017-03-24 15:03:44 +00:00
Alex Klyubin
49ce439425 Vendor domains must not use Binder am: f5446eb148
am: 2fe065d708

Change-Id: Ieefcec5619fc2b941a675b473661dc561864ffc9
2017-03-24 15:02:11 +00:00
Alex Klyubin
2fe065d708 Vendor domains must not use Binder
am: f5446eb148

Change-Id: I23d5d274ae05a9b0bdac6872be86c3f56aec734e
2017-03-24 15:00:10 +00:00
Alex Klyubin
f5446eb148 Vendor domains must not use Binder
On PRODUCT_FULL_TREBLE devices, non-vendor domains (except vendor
apps) are not permitted to use Binder. This commit thus:
* groups non-vendor domains using the new "coredomain" attribute,
* adds neverallow rules restricting Binder use to coredomain and
  appdomain only, and
* temporarily exempts the domains which are currently violating this
  rule from this restriction. These domains are grouped using the new
  "binder_in_vendor_violators" attribute. The attribute is needed
  because the types corresponding to violators are not exposed to the
  public policy where the neverallow rules are.

Test: mmm system/sepolicy
Test: Device boots, no new denials
Test: In Chrome, navigate to ip6.me, play a YouTube video
Test: YouTube: play a video
Test: Netflix: play a movie
Test: Google Camera: take a photo, take an HDR+ photo, record video with
      sound, record slow motion video with sound. Confirm videos play
      back fine and with sound.
Bug: 35870313
Change-Id: I0cd1a80b60bcbde358ce0f7a47b90f4435a45c95
2017-03-24 07:54:00 -07:00
Alex Klyubin
463f9a491c Merge "Remove unnecessary rules from NFC HAL clients" am: 93f99cb1d9 am: 3d12305d42
am: da6c88c93c

Change-Id: I9b2c1457c7c8cf3a6c8edde11e4dad8883bbf34c
2017-03-24 05:29:32 +00:00
Alex Klyubin
da6c88c93c Merge "Remove unnecessary rules from NFC HAL clients" am: 93f99cb1d9
am: 3d12305d42

Change-Id: Id45b1a26067b7525feabb029d5c98270d0c5994b
2017-03-24 05:26:32 +00:00
Alex Klyubin
3d12305d42 Merge "Remove unnecessary rules from NFC HAL clients"
am: 93f99cb1d9

Change-Id: I877e23910bc424a2026bab1d9669bc6537ea5c31
2017-03-24 05:25:03 +00:00
Treehugger Robot
93f99cb1d9 Merge "Remove unnecessary rules from NFC HAL clients" 2017-03-24 05:20:12 +00:00
Steven Moreland
cd525cdaeb Merge "Allow bugreport to dump some HAL processes." am: 45afc7a68a am: 1ecff6facd
am: 165c37017b

Change-Id: I76b85c42d2a24810de78e56d6f9624eb8df04c90
2017-03-23 21:00:56 +00:00