Commit graph

10613 commits

Author SHA1 Message Date
Janis Danisevskis
dfded77d42 Merge "Fix sepolicy for Gatekeeper HAL"
am: 9d5f97b381

Change-Id: Ic75010f7e11129e879a7eea1605969f2511f6fc9
2017-03-22 00:12:11 +00:00
Alex Klyubin
fbd2227977 Merge "Remove unused hal_impl_domain macro"
am: 6de0d9a756

Change-Id: I7f971d6f1a9fe4247490070f2f00bede2b828494
2017-03-22 00:10:26 +00:00
Treehugger Robot
9d5f97b381 Merge "Fix sepolicy for Gatekeeper HAL" 2017-03-22 00:10:21 +00:00
Alex Klyubin
6de0d9a756 Merge "Remove unused hal_impl_domain macro" 2017-03-21 23:57:55 +00:00
Chad Brubaker
d86b3d7c1a Merge "Disallow access to proc_net for ephemeral_app" am: 2e7fa9d82f am: 98c4f82e18
am: 1c4472a943

Change-Id: I6b0ccf590d69dc2f23e3af5387e53bdc6de624be
2017-03-21 22:50:07 +00:00
Josh Gao
3d3d370bbb Mark system_ndebug_socket as mlstrustedobject.
Address the following denial:

    audit(0.0:644): avc: denied { write } for name="ndebugsocket" dev="dm-2" ino=654091 scontext=u:r:crash_dump:s0:c512,c768 tcontext=u:object_r:system_ndebug_socket:s0 tclass=sock_file permissive=0

Bug: http://b/36278094
Test: mm
Change-Id: I0df115a3682385cee72adbfc4687221cd7c51a4d
2017-03-21 15:44:11 -07:00
Chad Brubaker
1c4472a943 Merge "Disallow access to proc_net for ephemeral_app" am: 2e7fa9d82f
am: 98c4f82e18

Change-Id: Ib55c8c4accd5a25aa0908ca9e496e0b1bce3d97a
2017-03-21 22:33:58 +00:00
Chad Brubaker
98c4f82e18 Merge "Disallow access to proc_net for ephemeral_app"
am: 2e7fa9d82f

Change-Id: I85d2895bb6f44bf3461214e4c679954a79b30cee
2017-03-21 22:28:51 +00:00
Chad Brubaker
2e7fa9d82f Merge "Disallow access to proc_net for ephemeral_app" 2017-03-21 22:24:31 +00:00
Jeff Vander Stoep
0a7b8e59f0 Merge "Enforce one HAL per domain." am: d32665584b am: 35823ad03e
am: 5499a78f82

Change-Id: I20831e2a0b70e7fa45f21e128a23c81bf978a191
2017-03-21 21:44:40 +00:00
Jeff Vander Stoep
5499a78f82 Merge "Enforce one HAL per domain." am: d32665584b
am: 35823ad03e

Change-Id: I53b1c43e6ca7c4978c082092a9015313e2c53eea
2017-03-21 21:34:33 +00:00
Jeff Vander Stoep
35823ad03e Merge "Enforce one HAL per domain."
am: d32665584b

Change-Id: I626cbb06628b9df635efdd4d3a9cc4fb46c7bcc3
2017-03-21 21:30:39 +00:00
Treehugger Robot
d32665584b Merge "Enforce one HAL per domain." 2017-03-21 21:23:06 +00:00
Alex Klyubin
57ab001530 Remove unnecessary binder_call from cameraserver
This is a follow-up to 9339168688
which added both
hal_client_domain(cameraserver, hal_graphics_allocator) and
binder_call(cameraserver, hal_graphics_allocator). The latter
binder_call rule is no longer needed because it is automatically
granted by virtue of cameraserver being marked as a client of
Graphics Allocator HAL --
see 49274721b3.

Test: Take a photo (both HDR and conventional) using Google Camera
Test: Record video using Google Camera
Test: Record slow motion video using Google Camera
Test: No denials to do with cameraserver and hal_graphics_allocator*
Bug: 34170079
Change-Id: If93fe310fa62923b5107a7e78d158f6e4b4d0b3a
2017-03-21 12:39:13 -07:00
Chad Brubaker
c4a938e75b Disallow access to proc_net for ephemeral_app
Test: Boots, runs
Bug: 32713782
Change-Id: Ia58db3c4c0159482f08e72ef638f3e1736095918
2017-03-21 12:28:49 -07:00
Jeff Vander Stoep
84b96a6b68 Enforce one HAL per domain.
HALs are intended to be limited responsibility and thus limited
permission. In order to enforce this, place limitations on:
1. What processes may transition into a HAL - currently only init
2. What methods may be used to transition into a HAL - no using
   seclabel
3. When HALs exec - only allow exec with a domain transition.

Bug: 36376258
Test: Build aosp_marlin, aosp_bullhead, aosp_dragon. Neverallow rules
      are compile time assertions, so building is a sufficient test.

Change-Id: If4df19ced730324cf1079f7a86ceba7c71374131
2017-03-21 12:16:31 -07:00
Yin-Chia Yeh
b41ff1e4ed Merge "Camera: allow cameraserver access hal_graphics_allocator" am: 1222ece97a am: c4eea0f115
am: 5f4f0333cd

Change-Id: I6c81f00f683d4c56007f6fe61bd104d4604e5904
2017-03-21 17:33:42 +00:00
Yin-Chia Yeh
5f4f0333cd Merge "Camera: allow cameraserver access hal_graphics_allocator" am: 1222ece97a
am: c4eea0f115

Change-Id: I8ca53d161314199fac112bad41ffb196d6073de5
2017-03-21 17:29:11 +00:00
Yin-Chia Yeh
c4eea0f115 Merge "Camera: allow cameraserver access hal_graphics_allocator"
am: 1222ece97a

Change-Id: I981e6081451d4a26eabcce1473f39681de952a69
2017-03-21 17:25:12 +00:00
Yin-Chia Yeh
1222ece97a Merge "Camera: allow cameraserver access hal_graphics_allocator" 2017-03-21 17:18:38 +00:00
Alex Klyubin
cb839c64db Remove unused hal_impl_domain macro
All previous users of this macro have been switched to
hal_server_domain macro.

Test: no hal_impl_domain in system/sepolicy/ and device/**/sepolicy
Test: mmm system/sepolicy
Bug: 34170079
Change-Id: I4a71b3fd5046c0d215b056f1cae25fe6bda0fb45
2017-03-21 09:50:53 -07:00
Jiyong Park
529a9f4338 Merge "Allow app to access configstore HAL" am: cc87732443 am: 14d792d7ba
am: 46695b7332

Change-Id: I2ec74670d8b61cf7fea34d8f6937a477b58ed689
2017-03-21 06:27:19 +00:00
Jiyong Park
46695b7332 Merge "Allow app to access configstore HAL" am: cc87732443
am: 14d792d7ba

Change-Id: I3ca172822c6db5361637f90b5619afb2a87689e9
2017-03-21 06:23:49 +00:00
Jiyong Park
14d792d7ba Merge "Allow app to access configstore HAL"
am: cc87732443

Change-Id: I41b9754e467918d04aa97fe68bf93790062fc66d
2017-03-21 06:20:19 +00:00
Treehugger Robot
cc87732443 Merge "Allow app to access configstore HAL" 2017-03-21 06:16:32 +00:00
Jiyong Park
ed4625f353 Allow app to access configstore HAL
Apps should be able to access the configstore HAL since framework
libraries which are loaded into app process can call configstore.

Letting apps have direct access to this HAL is OK because: 

(1) the API of this HAL does not make clients provide any sensitive 
information to the HAL, which makes it impossible for the HAL to 
disclose sensitive information of its clients when the HAL is 
compromised, 

(2) we will require that this HAL is binderized (i.e., does not run 
inside the process of its clients), 

(3) we will require that this HAL runs in a tight seccomp sandbox 
(this HAL doesn't need much access, if at all) and,

(4) we'll restrict the HALs powers via neverallows.

Test: apps can use configstore hal.

Change-Id: I04836b7318fbc6ef78deff770a22c68ce7745fa9
2017-03-21 06:10:23 +00:00
Alex Klyubin
2fbc9b6c32 Merge "Move Graphics Allocator HAL IPC rules to proper location" am: 10184efa95 am: c4ec1e0010
am: a25d90224c

Change-Id: Iee58e7c59dd2c0da041aba7083b70a8a9d6de715
2017-03-21 02:27:07 +00:00
Alex Klyubin
a25d90224c Merge "Move Graphics Allocator HAL IPC rules to proper location" am: 10184efa95
am: c4ec1e0010

Change-Id: Ia201d24b1edbf5ac2ea4d6e7b24b23b2a9d37f35
2017-03-21 02:23:33 +00:00
Alex Klyubin
c4ec1e0010 Merge "Move Graphics Allocator HAL IPC rules to proper location"
am: 10184efa95

Change-Id: I57d847a050217c8564d1b9f64e35aab276d27e40
2017-03-21 02:19:33 +00:00
Alex Klyubin
10184efa95 Merge "Move Graphics Allocator HAL IPC rules to proper location" 2017-03-21 02:15:46 +00:00
Pawin Vongmasa
96a5b4a75a Move mediacodec to vendor partition.
Test: Camera, Photos, YouTube and Play Movies apps.
Bug: 35328855
Change-Id: I3643b668817a7336f7ccda781734920fbbcc2c63
2017-03-20 18:52:24 -07:00
Alex Klyubin
c65005ed20 resolve merge conflicts of 8988daa5 to master
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Id4353e38c8e79037801875280f4ad2ee2160405d
2017-03-20 16:46:35 -07:00
Alex Klyubin
8988daa510 Switch Allocator HAL policy to _client/_server am: 08d6f56649
am: 453f6400f8

Change-Id: I99bb53c1376dca0072609e68d3b9c3bd2fa963f5
2017-03-20 23:28:21 +00:00
Alex Klyubin
453f6400f8 Switch Allocator HAL policy to _client/_server
am: 08d6f56649

Change-Id: Ib9a4687273a0aa6f43fb4c15ce499d5c41db3d4d
2017-03-20 23:25:12 +00:00
Yin-Chia Yeh
9339168688 Camera: allow cameraserver access hal_graphics_allocator
Test: Google camera app snapshot/record/
      slow motion recording
Bug: 36383997
Change-Id: I565fb441aec529464474e0dd0e01dbfe0b167c82
2017-03-20 15:51:08 -07:00
Alex Klyubin
0f993703eb Recovery can use HALs only in passthrough mode am: 00a03d424f am: 0fd07767bc
am: 7e26fe4a1d

Change-Id: I72b534b55324ce3dc8df9a46b5c205e4e76f5509
2017-03-20 22:29:10 +00:00
Alex Klyubin
7e26fe4a1d Recovery can use HALs only in passthrough mode am: 00a03d424f
am: 0fd07767bc

Change-Id: I519288986e98f95591722e7ed1982a0467fc4501
2017-03-20 22:26:05 +00:00
Alex Klyubin
0fd07767bc Recovery can use HALs only in passthrough mode
am: 00a03d424f

Change-Id: I0d66b07b8fa3f1a992fd2b3a864dafb3c9c7eb0c
2017-03-20 22:22:23 +00:00
Alex Klyubin
08d6f56649 Switch Allocator HAL policy to _client/_server
This switches Allocator HAL policy to the design which enables us to
identify all SELinux domains which host HALs and all domains which are
clients of HALs.

Allocator HAL is special in the sense that it's assumed to be always
binderized. As a result, rules in Camera HAL target hal_allocator_server
rather than hal_allocator (which would be the server and any client, if
the Allocator HAL runs in passthrough mode).

Test: Device boots up, no new denials
Test: YouTube video plays back
Test: Take photo using Google Camera app, recover a video, record a slow
      motion video
Bug: 34170079
Change-Id: Ifbbca554ec221712361ee6cda94c82f254d84936
2017-03-20 22:18:12 +00:00
Alex Klyubin
49274721b3 Move Graphics Allocator HAL IPC rules to proper location
Every client of Graphics Allocator HAL needs permission to (Hw)Binder
IPC into the HAL.

Test: Device boots, no denials to do with hal_graphics_allocator
      (also, removing the binder_call(hal_graphics_allocator_client,
      hal_graphics_allocator_server) leads to denials)
Test: GUI works, YouTube works
Bug: 34170079

Change-Id: I5c64d966862a125994dab903c2eda5815e336a94
2017-03-20 15:02:20 -07:00
Alex Klyubin
00a03d424f Recovery can use HALs only in passthrough mode
This adjusts the grants for recovery to make it explicit that recovery
can use the Boot Control HAL only in passthrough mode.

Test: Device boots up, no new denials
Test: Reboot into recovery, sideload OTA update succeeds
Test: Apply OTA update via update_engine:
      1. make dist
      2. Ensure device has network connectivity
      3. ota_call.py -s <serial here> out/dist/sailfish-ota-*.zip
Bug: 34170079

Change-Id: I0888816eca4d77939a55a7816e6cae9176713ee5
2017-03-20 13:11:33 -07:00
Alex Klyubin
2438804719 Merge "Switch Boot Control HAL policy to _client/_server" am: 51a2238c9e am: 2a887bfb3d
am: 4abc2d23d5

Change-Id: I6602b883078cbf5778f9843d68263633de351dbc
2017-03-20 19:46:41 +00:00
Alex Klyubin
4abc2d23d5 Merge "Switch Boot Control HAL policy to _client/_server" am: 51a2238c9e
am: 2a887bfb3d

Change-Id: I4e6cada4fd2cdaae9022fc949dfe84837df24088
2017-03-20 19:42:41 +00:00
Alex Klyubin
2a887bfb3d Merge "Switch Boot Control HAL policy to _client/_server"
am: 51a2238c9e

Change-Id: I612c84a8e27d6b2db8008fd8f71dc5c5f8c7f6d8
2017-03-20 19:39:10 +00:00
Treehugger Robot
51a2238c9e Merge "Switch Boot Control HAL policy to _client/_server" 2017-03-20 19:33:55 +00:00
Janis Danisevskis
12e960e6c9 Fix sepolicy for Gatekeeper HAL
This patch fixes Gatekeeper HAL rules.

Bug: 34260418
Test: Device boots with gatekeeper_hal using hwbinder and
      gatekeeperd does not fall back to software.
Change-Id: I6aaacb08faaa7a90506ab569425dc525334c8171
2017-03-20 07:39:33 -07:00
Alex Klyubin
09d13e734d Switch Boot Control HAL policy to _client/_server
This switches Boot Control HAL policy to the design which enables us
to conditionally remove unnecessary rules from domains which are
clients of Boot Control HAL.

Domains which are clients of Boot Control HAL, such as update_server,
are granted rules targeting hal_bootctl only when the Boot Control 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_bootctl are not granted to client domains.

Domains which offer a binderized implementation of Boot Control HAL,
such as hal_bootctl_default domain, are always granted rules targeting
hal_bootctl.

P. S. This commit removes direct access to Boot Control HAL from
system_server because system_server is not a client of this HAL. This
commit also removes bootctrl_block_device type which is no longer
used. Finally, boot_control_hal attribute is removed because it is now
covered by the hal_bootctl attribute.

Test: Device boots up, no new denials
Test: Reboot into recovery, sideload OTA update succeeds
Test: Apply OTA update via update_engine:
      1. make dist
      2. Ensure device has network connectivity
      3. ota_call.py -s <serial here> out/dist/sailfish-ota-*.zip
Bug: 34170079
Change-Id: I9c410c092069e431a3852b66c04c4d2a9f1a25cf
2017-03-17 17:22:06 -07:00
Jorge Lucangeli Obes
f8713811b3 Merge "ppp: Allow specific ioctls on mtp:socket." am: 11ce09bc14 am: e8acb4f620
am: 294b7d22ce

Change-Id: I2479a5dad9e714352634c199101f70c253a7b34a
2017-03-17 23:16:03 +00:00
Jorge Lucangeli Obes
294b7d22ce Merge "ppp: Allow specific ioctls on mtp:socket." am: 11ce09bc14
am: e8acb4f620

Change-Id: Iab0ebf0748c4c3dda5a7505050d3f87d5ddf0608
2017-03-17 23:06:51 +00:00
Jorge Lucangeli Obes
e8acb4f620 Merge "ppp: Allow specific ioctls on mtp:socket."
am: 11ce09bc14

Change-Id: I8e964a15af674c16e8272fdcf3c617eb5821c64a
2017-03-17 23:02:08 +00:00