Commit graph

1201 commits

Author SHA1 Message Date
Andrew Scull
9c58c14d30 SELinux policies for Weaver HAL.
Bug: 35628284
Test: Boot and call HAL from system_server
Change-Id: I4cdacb601e0eea1f5f0e721c568c7ee04298704f
2017-04-10 19:35:52 +01:00
Sandeep Patil
7b7729814e Merge changes from topic 'sspatil_vendor_rules_cleanup' into oc-dev am: ed3458c2ee
am: faea9dc2ab

Change-Id: Ia1ca45499e8ef960c2d23aa20494fa1884e2f7b6
2017-04-06 23:14:01 +00:00
Sandeep Patil
0eed3beaaf sepolicy: remove redudant rule for symlinks in /vendor/app am: f79d1904e8
am: 6c1362b2c6

Change-Id: Id4a437ec7acbf362cd82690fe0d850dd0951c104
2017-04-06 23:13:57 +00:00
Sandeep Patil
88234ba450 sepolicy: restrict access for /vendor/framework. am: df679fdbd9
am: c98b275e7b

Change-Id: I424909584152898fa81d8eacf664db851f47e37c
2017-04-06 23:13:53 +00:00
Sandeep Patil
e1a736a041 sepolicy: restrict /vendor/overlay from most coredomains am: 9075699a28
am: d4a96aac4b

Change-Id: I89f24a3ba1ca855aba0731f8320aeac93e7bcb66
2017-04-06 23:13:50 +00:00
Sandeep Patil
a2aa513fb6 sepolicy: restrict /vendor/app from most coredomains am: 1b5f81a2d2
am: ec5e26e40d

Change-Id: Ie791b20d2ae2e2690846f18fa0bc74926990bdbc
2017-04-06 23:13:47 +00:00
Sandeep Patil
6c1362b2c6 sepolicy: remove redudant rule for symlinks in /vendor/app
am: f79d1904e8

Change-Id: I7bda1cd1af603adc5fbf142c66bdf5b6b146ad7f
2017-04-06 23:03:34 +00:00
Sandeep Patil
c98b275e7b sepolicy: restrict access for /vendor/framework.
am: df679fdbd9

Change-Id: I4f0d343f42d8bc5c97b2a7c129c63c8e7c50cd3d
2017-04-06 23:03:30 +00:00
Sandeep Patil
d4a96aac4b sepolicy: restrict /vendor/overlay from most coredomains
am: 9075699a28

Change-Id: If3e3e246b7ef5ed0142bc7b180d4d7cfb559ea03
2017-04-06 23:03:25 +00:00
Sandeep Patil
ec5e26e40d sepolicy: restrict /vendor/app from most coredomains
am: 1b5f81a2d2

Change-Id: Ic9e87837f68ac31cfedd735bd20a44cdf029c79e
2017-04-06 23:03:19 +00:00
TreeHugger Robot
ed3458c2ee Merge changes from topic 'sspatil_vendor_rules_cleanup' into oc-dev
* changes:
  sepolicy: fix comments around 'domain' access to search in /vendor
  sepolicy: remove redudant rule for symlinks in /vendor/app
  sepolicy: restrict access for /vendor/framework.
  sepolicy: restrict /vendor/overlay from most coredomains
  sepolicy: restrict /vendor/app from most coredomains
2017-04-06 22:48:11 +00:00
Martijn Coenen
d790d2456a Merge "Add new classes and types for (hw|vnd)servicemanager." into oc-dev am: 133a9c41d2
am: 3dca6eb23f

Change-Id: I84eb61aad4ac9a27fd804abaae3830c6a8ced97b
2017-04-06 20:37:49 +00:00
Sandeep Patil
f79d1904e8 sepolicy: remove redudant rule for symlinks in /vendor/app
All accesses to /vendor/app within platform include permissions to read
symlinks in the location. This rule is redundant now.

Bug: 36806861
Test: Boot sailfish and find no denials for 'vendor_app_file'

Change-Id: Ic17a67521cff6717d83b78bb4ad8e21e772f6d4f
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-04-06 13:28:16 -07:00
Sandeep Patil
df679fdbd9 sepolicy: restrict access for /vendor/framework.
/vendor/framework is now designated location for vendor's platform
libraries. The directory is thus only made available for 'dex2oat'
coredomain.

Bug: 36680116
Test: Boot sailfish & angler and launch gApps, dialer w/ no denials for
      'vendor_framework_file'

Change-Id: I24c2ec30f836330005a972ae20d839bef9dcb8aa
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-04-06 13:28:16 -07:00
Sandeep Patil
9075699a28 sepolicy: restrict /vendor/overlay from most coredomains
The change makes 'vendor_overlay_file' accessible only to few platform
domains like idmap, system_server, zygote and appdomain.

The overlay files contains RROs (runtime resource overlays)

Bug: 36681210
Test: Boot sailfish (treble device) from wiped flashall
Test: Connect to wifi and launch chrome to load few websites.
Test: Launch camera and record + playback video

Change-Id: I3596ca89ad51d0e7d78c75121f22ea71209ee332
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-04-06 13:28:16 -07:00
Sandeep Patil
54189c5321 sepolicy: fix comments around 'domain' access to search in /vendor
Effectively removes TODOs and finalizes the initial solution to allow
all domains access to 'vendor_file'.

Bug: 36681074
Test: Build and boot sailfish (no policy changes in the CL)

Change-Id: I50c05e20175c5273b34901809d967dd3e48bdb0e
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-04-06 13:28:16 -07:00
Sandeep Patil
1b5f81a2d2 sepolicy: restrict /vendor/app from most coredomains
The change makes 'vendor_app_file' accessible only to few platform
domains like dex2oat, idmap, installd, system_server and appdomain.

Bug: 36681210
Test: Boot sailfish (treble device) from wiped flashall
Test: Connect to wifi and launch chrome to load few websites.
Test: Launch camera and record + playback video

Change-Id: Ib8757fedbf2e19c8381c8cd0f8f2693b2345534b
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-04-06 13:28:12 -07:00
Martijn Coenen
133a9c41d2 Merge "Add new classes and types for (hw|vnd)servicemanager." into oc-dev 2017-04-06 20:05:01 +00:00
Ningyuan Wang
b00ceab676 Merge "Allow wificond to find permission" into oc-dev am: 705a3d0b11
am: 84674b7eee

Change-Id: I17c3df373607889b0ce1fa9cbda16346298e3ca9
2017-04-06 18:11:40 +00:00
Martijn Coenen
bc6d88d2da Add new classes and types for (hw|vnd)servicemanager.
Bug: 34454312
Bug: 36052864
Test: device boots, works
Change-Id: If61d9b736a74c5944cef4449de4dfbaf78d9ccfa
2017-04-06 11:02:23 -07:00
Ningyuan Wang
705a3d0b11 Merge "Allow wificond to find permission" into oc-dev 2017-04-06 17:47:20 +00:00
Alex Klyubin
195d569ce1 Merge "Wifi Keystore HAL is not a HAL" into oc-dev am: 7c3dbfeb69
am: ec9209be52

Change-Id: I4162ad407b058de775089b003f6a9227db379154
2017-04-06 04:08:54 +00:00
Alex Klyubin
7c3dbfeb69 Merge "Wifi Keystore HAL is not a HAL" into oc-dev 2017-04-06 04:02:04 +00:00
Alex Klyubin
482fb3a088 Merge "hwservicemanager is not a HAL" into oc-dev am: cfcffa9a5a
am: 0f7e68bfaa

Change-Id: I9120edc34036ab7f347d0ae27d99dc62aebab5c5
2017-04-06 03:44:04 +00:00
TreeHugger Robot
cfcffa9a5a Merge "hwservicemanager is not a HAL" into oc-dev 2017-04-06 03:36:20 +00:00
Sandeep Patil
9954cb6142 Merge changes from topic 'vendor-ocdev-relabel' into oc-dev am: 37792cecad
am: 6d2e29c1b7

Change-Id: I130f42e045695b3c08d25f4ba287a35c4687d8c1
2017-04-06 03:27:42 +00:00
TreeHugger Robot
37792cecad Merge changes from topic 'vendor-ocdev-relabel' into oc-dev
* changes:
  sepolicy: relabel /vendor
  Sepolicy: Add ASAN-Extract
2017-04-06 03:17:07 +00:00
Nathan Harold
516c9abfcd Merge changes from topic 'ipsec-svc-pick' into oc-dev
* changes:
  Add IpSecService SEPolicy
  Update Common NetD SEPolicy to allow Netlink XFRM
2017-04-06 01:34:37 +00:00
Sandeep Patil
277a20ebec sepolicy: relabel /vendor
The CL splits /vendor labeling from /system. Which was allowing all
processes read, execute access to /vendor.

Following directories will remain world readable
 /vendor/etc
 /vendor/lib(64)/hw/

Following are currently world readable but their scope
will be minimized to platform processes that require access
 /vendor/app
 /vendor/framework/
 /vendor/overlay

Files labelled with 'same_process_hal_file' are allowed to be
read + executed from by the world. This is for Same process HALs and
their dependencies.

Bug: 36527360
Bug: 36832490
Bug: 36681210
Bug: 36680116
Bug: 36690845
Bug: 36697328
Bug: 36696623
Bug: 36806861
Bug: 36656392
Bug: 36696623
Bug: 36792803

All of the tests were done on sailfish, angler, bullhead, dragon
Test: Boot and connect to wifi
Test: Run chrome and load websites, play video in youtube, load maps w/
      current location, take pictures and record video in camera,
      playback recorded video.
Test: Connect to BT headset and ensure BT audio playback works.
Test: OTA sideload using recovery
Test: CTS SELinuxHostTest pass

Change-Id: I278435b72f7551a28f3c229f720ca608b77a7029
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-04-05 13:58:32 -07:00
Andreas Gampe
82071b6859 Sepolicy: Add ASAN-Extract
Add selinux policies for init script and shell script to unzip a tar
containing ASAN libraries on boot.

Bug: 36458146
Test: m && m SANITIZE_TARGET=address
Test: manual (build steps for tar missing)
Change-Id: I5c3cb233aae93ee9985431090af902b0e3c1b0a7
(cherry picked from commit 0b74305011)
Merged-In: I5c3cb233aae93ee9985431090af902b0e3c1b0a7
2017-04-05 13:09:29 -07:00
Nick Kralevich
f3ecd2be40 Merge "Fix lock logspam and remove domain_deprecated rule" into oc-dev am: 6f108fd8e6
am: a2bc090b7b

Change-Id: I4e765f5c2adb3cc40253fde80f89bd40f02c53e4
2017-04-05 14:10:26 +00:00
Nick Kralevich
a2bc090b7b Merge "Fix lock logspam and remove domain_deprecated rule" into oc-dev
am: 6f108fd8e6

Change-Id: I98a793c05260b9f469902c17375693ef7c68b238
2017-04-05 14:01:49 +00:00
Nick Kralevich
6f108fd8e6 Merge "Fix lock logspam and remove domain_deprecated rule" into oc-dev 2017-04-05 13:54:18 +00:00
TreeHugger Robot
c0e6cb584c Merge "Allow update_verifier to reboot the device" into oc-dev 2017-04-05 01:53:52 +00:00
Nick Kralevich
4a580ccabb Fix lock logspam and remove domain_deprecated rule
Remove system_file:file { lock ioctl } from domain_deprecated. The only
domains triggering this were dex2oat and netd, which are fixed in this
change.

Addresses the following logspam similar to:

  avc: granted { lock } for comm="iptables"
  path="/system/etc/xtables.lock" dev="sda22" ino=3745
  scontext=u:r:netd:s0 tcontext=u:object_r:system_file:s0 tclass=file

  avc: granted { lock } for comm="dex2oat"
  path="/system/framework/arm/boot-okhttp.art" dev="dm-0" ino=1295
  scontext=u:r:dex2oat:s0 tcontext=u:object_r:system_file:s0 tclass=file

Test: device boots and no obvious problems.
Bug: 28760354
Bug: 36879751
Change-Id: Iac851c0e49a52ce4000fdfe16e68c17ff819693f
2017-04-04 18:37:28 -07:00
Ningyuan Wang
9282ef6b04 Allow wificond to find permission
This is used for wificond to check if it is allowed to dump logs.

Bug: 31336376
Test: compile, manual test
Change-Id: I8a1b681255398f9a1f2cf79fd0891e58283aa747
2017-04-04 16:52:25 -07:00
TreeHugger Robot
ccbea503ca Merge "Remove hal_binderization_prop" into oc-dev 2017-04-04 23:50:35 +00:00
Yifan Hong
162613994d Merge "Allow hal_sensors to use ashmem from android.hidl.allocator" into oc-dev am: abaf415c36
am: 56f8a1a754

Change-Id: I71034e92a0d9f982756611675b60eeacca5cd8ff
2017-04-04 23:29:34 +00:00
Yifan Hong
56f8a1a754 Merge "Allow hal_sensors to use ashmem from android.hidl.allocator" into oc-dev
am: abaf415c36

Change-Id: I89396424e62a09f8e111212b920fc0897b6a517e
2017-04-04 23:26:49 +00:00
TreeHugger Robot
abaf415c36 Merge "Allow hal_sensors to use ashmem from android.hidl.allocator" into oc-dev 2017-04-04 23:22:57 +00:00
Ray Essick
445ccc48b6 Merge "allow media.metrics to write to file descriptor in /data" into oc-dev am: 72f6219fed
am: 090d9bc4f6

Change-Id: I487d2e52f3c427d80670d2d413b92ace59fcace3
2017-04-04 23:19:08 +00:00
Ray Essick
090d9bc4f6 Merge "allow media.metrics to write to file descriptor in /data" into oc-dev
am: 72f6219fed

Change-Id: I93bd189fc07ee4386b1a1c14cf345ca739f9f64b
2017-04-04 23:16:31 +00:00
Ray Essick
72f6219fed Merge "allow media.metrics to write to file descriptor in /data" into oc-dev 2017-04-04 23:12:26 +00:00
TreeHugger Robot
4d37cb7c1e Merge "SE Policy for Wifi Offload HAL" 2017-04-04 23:10:35 +00:00
Amit Mahajan
26b0152096 rild does not communicate with BT/system_server/mediaserver over sockets am: 8b080ee260
am: c6171967a1

Change-Id: Iaa6f13640724e1c84651fff6d036795bb77f43f4
2017-04-04 23:07:29 +00:00
Amit Mahajan
c6171967a1 rild does not communicate with BT/system_server/mediaserver over sockets
am: 8b080ee260

Change-Id: Ieba9f9055b78d349c883ca1132336c318e490b17
2017-04-04 23:05:29 +00:00
Alex Klyubin
9a14704f62 Wifi Keystore HAL is not a HAL
Wifi Keystore HAL is a HwBinder service (currently offered by keystore
daemon) which is used by Wifi Supplicant HAL. This commit thus
switches the SELinux policy of Wifi Keystore HAL to the approach used
for non-HAL HwBinder services.

The basic idea is simimilar to how we express Binder services in the
policy, with two tweaks: (1) we don't have 'hwservicemanager find' and
thus there's no add_hwservice macro, and (2) we need loosen the
coupling between core and vendor components. For example, it should be
possible to move a HwBinder service offered by a core component into
another core component, without having to update the SELinux policy of
the vendor image. We thus annotate all components offering HwBinder
service x across the core-vendor boundary with x_server, which enables
the policy of clients to contain rules of the form:
binder_call(mydomain, x_server), and, if the service uses IPC
callbacks, also binder_call(x_server, mydomain).

Test: mmm system/sepolicy
Test: sesearch indicates to changes to binder { call transfer} between
      keystore and hal_wifi_supplicant_default domains
Bug: 36896667

Change-Id: I45c4ce8159b63869d7bb6df5c812c5291776d892
2017-04-04 15:04:05 -07:00
Sohani Rao
3dd460ba2b SE Policy for Wifi Offload HAL
Update SE Policy to allow calls to and callbacks from Wifi Offload HAL
HIDL binderized service.
Cherry pick from d56aa1982d15acfc2408271138dac43f1e5dc987

Bug: 32842314
Test: Unit tests, Mannual test to ensure Wifi can be brought up and
connected to an AP, ensure that Offload HAL service is running and that
that wificond can get the service handle by calling hwservicemanager.

Change-Id: I0fc51a4152f1891c8d88967e75d45ded115e766e
2017-04-04 14:28:39 -07:00
Tianjie Xu
6ca32e3531 Allow update_verifier to reboot the device
Currently update_verifier only verifies the blocks when dm-verity is in
'enforcing' mode; and dm-verity will reboot the device upon detection of
errors. However, sometimes the verity mode is not guaranteed to be
correct. When mode is 'eio' for example, dm-verity will not trigger
a reboot but rather fail the read. So update_verifier need to take the
responsibility to reboot the device. Otherwise the device will continue
to boot without setting the flag "isSlotMarkedSuccessful".

Denial message:
update_verifier: type=1400 audit(0.0:18): avc: denied { write } for
name="property_service" dev="tmpfs" ino=14678 scontext=u:r:update_verifier:s0
tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0

Bug: 36260064
Test: powerctl property sets successfully

Change-Id: I1260e60f2ef4db50573e515ba95c332512c8ae62
(cherry picked from commit 0d8c1e0a33)
2017-04-04 21:07:48 +00:00
Alex Klyubin
cae2a062a6 Merge "No access to tee domain over Unix domain sockets" into oc-dev am: ea53e29f82
am: 3a9946157f

Change-Id: Ib3d15ed7b190be7410bff218cc1d97742a750267
2017-04-04 21:05:23 +00:00