Commit graph

17578 commits

Author SHA1 Message Date
Nick Kralevich
4182eda9e7 Merge "disallow priv-apps from following untrusted app symlinks."
am: a310da9aec

Change-Id: I07a0f6a25c6f40a2fc3fde25bd7c90c8db614683
2019-01-25 10:02:38 -08:00
Nick Kralevich
a310da9aec Merge "disallow priv-apps from following untrusted app symlinks." 2019-01-25 17:51:38 +00:00
Michael Wright
24f1d94dfa Add new external vibrator service to system_server
am: e9f1668c17

Change-Id: I20f1293d77262b45ac986d08b0795e4ff85f3095
2019-01-25 08:41:18 -08:00
Michael Wright
e9f1668c17 Add new external vibrator service to system_server
Bug: 111457573
Test: N/A
Change-Id: I457fd9d13cc481f2687ab39d22240c6ea7231183
2019-01-25 14:26:07 +00:00
Roland Levillain
17e021cb88 Merge changes from topics "runtime-apex-otapreopt_chroot-tear-down", "runtime-apex-installd-support", "runtime-apex-otapreopt_chroot-support"
am: c5ec14ba9a

Change-Id: I174e447b0914a1a8422ad3f1bd7f197088f8a780
2019-01-25 04:09:15 -08:00
Roland Levillain
35247c53c4 Allow oatpreopt to run dex2oat from the Runtime APEX.
am: ab9c053078

Change-Id: I7f56c81bbfc43d877a24c16605aaa556792c973e
2019-01-25 04:08:52 -08:00
Roland Levillain
64515d6131 Allow otapreopt_chroot to mount APEX packages using apexd logic.
am: 0a6c2d013a

Change-Id: I9f2712e43d0483fc41c8df6affb4d0bc55905c9d
2019-01-25 04:08:27 -08:00
Roland Levillain
c5ec14ba9a Merge changes from topics "runtime-apex-otapreopt_chroot-tear-down", "runtime-apex-installd-support", "runtime-apex-otapreopt_chroot-support"
* changes:
  Allow `oatpreopt_chroot` to deactivate APEX packages in `/postinstall/apex`.
  Allow `oatpreopt` to run `dex2oat` from the Runtime APEX.
  Allow `otapreopt_chroot` to mount APEX packages using `apexd` logic.
2019-01-25 11:56:30 +00:00
Martijn Coenen
8dc3148a0f Merge "Add more neverallows to app_zygote policy."
am: c7fb2809bf

Change-Id: Ia9545a1f8e702b76807f1871db4951dee2615ec7
2019-01-24 21:42:02 -08:00
Treehugger Robot
c7fb2809bf Merge "Add more neverallows to app_zygote policy." 2019-01-25 05:24:02 +00:00
Tri Vo
07b658ccd4 Merge "Split system and product sepolicy hashes."
am: 6c9d368ab1

Change-Id: If3fec2aef521fa39450f981820d9bea081b58283
2019-01-24 16:13:43 -08:00
Tri Vo
6c9d368ab1 Merge "Split system and product sepolicy hashes." 2019-01-25 00:04:34 +00:00
Ng Zhi An
d5315561bc Merge "Update sepolicy with new native boot flag for activity_manager"
am: 055286fc94

Change-Id: I0b127a0fffab93170b79786372c4776b611c014a
2019-01-24 14:10:56 -08:00
Andreas Gampe
f27a6f881d Merge "Sepolicy: Allow apexd to log to kmsg"
am: a1198e58c3

Change-Id: Ia357eb27c82df072cdb90ae7794a97951e6dd21d
2019-01-24 14:09:54 -08:00
Treehugger Robot
055286fc94 Merge "Update sepolicy with new native boot flag for activity_manager" 2019-01-24 22:00:53 +00:00
Andreas Gampe
a1198e58c3 Merge "Sepolicy: Allow apexd to log to kmsg" 2019-01-24 21:45:20 +00:00
Nick Kralevich
87e91237a4 disallow priv-apps from following untrusted app symlinks.
Untrustworthy symlinks dereferenced by priv-apps could cause those apps
to access files they weren't intending to access. Trusted components
such as priv-apps should never trust untrustworthy symlinks from
untrusted apps.

Modify the rules and add a neverallow assertion to prevent regressions.

Bug: 123350324
Test: device boots and no obvious problems.
Change-Id: I8c4a5c9c8571fd29b2844b20b4fd1126db4128c0
2019-01-24 13:08:10 -08:00
Martijn Coenen
e0bbb9f85a Add more neverallows to app_zygote policy.
The app_zygote should never use any unix sockets, except the
logd socket and some sockets only available on userdebug/eng.

Prevent it from using ptrace.

Bug: 111434506
Test: builds
Change-Id: Ic47cfca51fba0b150a136194ba0e4a8a488c9996
2019-01-24 20:27:54 +00:00
Ng Zhi An
c5bf4a3994 Update sepolicy with new native boot flag for activity_manager
Whitelist the persistent system properties that will be used as
flags in activity manager experiments.

Bug: 120794810
Test: m, flash, test getting flag value in ActivityManagerService.java
Change-Id: I90a10bc87d6db3a64347b62fd02e6f0b12ac9fa8
2019-01-24 11:07:17 -08:00
Yabin Cui
fc44e546bd Merge "Add sepolicy for simpleperf_app_runner."
am: 31bd80439f

Change-Id: I8fe49c994ae04a7de968a97d9a82f88e6376d383
2019-01-24 11:04:56 -08:00
Chenbo Feng
ac0b2ee2fd Merge "Allow system_server to write to bpf maps"
am: b761636b9d

Change-Id: I61851a57daef4dbd774007e6b4e8de6376fb4d59
2019-01-24 10:56:06 -08:00
Yabin Cui
31bd80439f Merge "Add sepolicy for simpleperf_app_runner." 2019-01-24 18:39:13 +00:00
Chenbo Feng
b761636b9d Merge "Allow system_server to write to bpf maps" 2019-01-24 18:16:25 +00:00
Torne (Richard Coles)
4049c2d971 Track SELinux denial caused by webview zygote.
am: 0375302f41

Change-Id: Idaac104ee5b1de9a2998c9f0346e161e3459b369
2019-01-24 09:52:20 -08:00
Andreas Gampe
aada5013aa Sepolicy: Allow apexd to log to kmsg
Allow apexd to log to the kernel log. This aids in low-level
diagnostics, when adb is not available.

Test: m
Change-Id: Ib8f286bd917b34f5e8992b37ab230313a4820bf9
2019-01-24 09:21:27 -08:00
Torne (Richard Coles)
0375302f41 Track SELinux denial caused by webview zygote.
The new codepath for creating the classloader in the webview zygote
triggers an selinux denial; track this until it is fixed.

Bug: 123246126
Test: DeviceBootTest.SELinuxUncheckedDenialBootTest
Merged-In: I6835947e81364b5dd43898199108af7b14d31088
Change-Id: I6835947e81364b5dd43898199108af7b14d31088
2019-01-24 11:38:05 -05:00
Peter Kalauskas
a8ee48d499 Merge "Allow lazy HAL to run"
am: b6388fe753

Change-Id: I4781cb62428824cf95fb7e4a925d40545f1a0d68
2019-01-24 07:27:14 -08:00
Peter Kalauskas
b6388fe753 Merge "Allow lazy HAL to run" 2019-01-24 15:11:02 +00:00
Nikita Ioffe
333209541b Merge "Allow dumpstate to write into privileged apps private files"
am: 74ea1f29eb

Change-Id: I5d50d949255ce320eeba1738a4a2a20cf97f6cf4
2019-01-24 05:03:04 -08:00
Treehugger Robot
74ea1f29eb Merge "Allow dumpstate to write into privileged apps private files" 2019-01-24 12:48:21 +00:00
Yiwei Zhang
51ca8c0fd5 Merge "gpuservice: allow cmd gpu vkjson in interactive shell"
am: 26d79ed694

Change-Id: I90cc5980b4ff8932f4ea3fdbec250c0a9e8403da
2019-01-24 02:07:23 -08:00
Treehugger Robot
26d79ed694 Merge "gpuservice: allow cmd gpu vkjson in interactive shell" 2019-01-24 09:53:26 +00:00
Nick Kralevich
3c258dd8e4 Merge "Make Android Studio Instant Run work again"
am: 551eeaf5d5

Change-Id: I6a5cf971bbc17634a97fcf15d27a8c53112a57d5
2019-01-23 21:57:21 -08:00
Treehugger Robot
551eeaf5d5 Merge "Make Android Studio Instant Run work again" 2019-01-24 05:49:02 +00:00
Chenbo Feng
3c3d52e460 Allow system_server to write to bpf maps
The bpf maps for per uid stats need to be regularly cleaned now to
optimize the memory usage and performance. It can only done by
system_server since it is the process that scrapes and read the stats.
So allow it to write to maps to clean the stats. This change also
allows the system server to create PF_KEY sockets since we need a
reliable way to force synchronize the rcu on devices with 4.9 kernel.

Test: CtsUsageStatsTestCases
Bug: 79171384
Change-Id: I6564a56a5906a958f7d8e1d290b85de3f6fa121d
2019-01-24 03:44:25 +00:00
Peter Kalauskas
b1bdbb58cf Allow lazy HAL to run
Test: Manual
Change-Id: Ic4c3fd5b2d8d709573f8cc6332a6340d28d3ba26
2019-01-23 15:29:05 -08:00
Yabin Cui
e5fc21c787 Add sepolicy for simpleperf_app_runner.
Bug: 118835348
Test: build and boot pixel 3.
Test: run simpleperf_app_runner manually.

Change-Id: Ifb6c2ab78e075684bc197d06f761becced8281d1
2019-01-23 23:23:09 +00:00
Siarhei Vishniakou
aee5061689 Merge "Permissions for input_native_boot flags"
am: b1f34ddaf7

Change-Id: I9d61e1c5b5522dafe77ff75219b40772f47382f7
2019-01-23 15:22:31 -08:00
Nikita Ioffe
1ab6affc5c Allow dumpstate to write into privileged apps private files
Bug: 123006652
Bug: 111441001
Fix: 123006652
Test: Wrote a test app using BugreportManager, checked denials in logcat
Change-Id: Id1c4b1d166bc70aec833c3d644e8aea6ae94c35a
2019-01-23 23:13:23 +00:00
Treehugger Robot
b1f34ddaf7 Merge "Permissions for input_native_boot flags" 2019-01-23 23:08:07 +00:00
Nick Kralevich
3e5668f173 Make Android Studio Instant Run work again
system/sepolicy commit ffa2b61330 made
run-as spawned processes run in the runas_app SELinux domain, instead of
the untrusted_app domain.

https://android-review.googlesource.com/q/topic:%22runas_exec%22+(status:open%20OR%20status:merged)

This broke unix socket connections from untrusted_app* to runas_app.
This functionality is used by Android Studio for the Instant Run
feature. See https://developer.android.com/studio/run/

Allow untrusted_apps to connect to listening abstract sockets hosted by
runas_app.

Addresses the following denial:

01-23 11:11:56.084 16272 16272 W e.myapplication: type=1400 audit(0.0:68): avc: denied { connectto } for path=006972736F636B6574000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 scontext=u:r:untrusted_app_27:s0:c169,c256,c512,c768 tcontext=u:r:runas_app:s0:c169,c256,c512,c768 tclass=unix_stream_socket permissive=0 app=com.example.myapplication
01-23 11:11:56.086 16272 16272 V SwapperAgent: Prior agent invocations in this VM: 1
01-23 11:11:56.088 16272 16272 E SwapperAgent: Could not connect to socket

Change-Id: Ia1203f44aebcbec0ff858b8316e147cba7a048a2
Fixes: 123297648
Test: acleung manual testing
2019-01-23 14:58:12 -08:00
Yiwei Zhang
6e8191ead0 gpuservice: allow cmd gpu vkjson in interactive shell
Bug: 122860343
Test: adb shell, then 'cmd gpu vkjson'
Change-Id: I2720d1bbc27152f416cd7e61f4dcccb4a13c7b82
2019-01-23 14:28:56 -08:00
Tri Vo
1824e25b1c Split system and product sepolicy hashes.
We need to be able to tell if /system was updated independently
/product, and vice versa.  Otherwise, the device might accidentally load
the precompiled_policy after a /product sepolicy update.

Also change the name of the hash file to more closely reflect how its
generated.

Bug: 119305624
Test: boot aosp_taimen, precompiled policy is loaded
Test: If either of these hashes
/system/etc/selinux/plat_sepolicy_and_mapping.sha256
/product/etc/selinux/product_sepolicy_and_mapping.sha256
are removed, then init falls back to compiling sepolicy at boot time.
Change-Id: I14af81c8d3c5cb85c01592518e22077a8c8c3e5e
2019-01-23 09:19:35 -08:00
Roland Levillain
7094d4f505 Allow oatpreopt_chroot to deactivate APEX packages in /postinstall/apex.
Allow `otapreopt_chroot` to:
- unmount APEX packages (ext4 images) mounted in `/postinstall/apex`;
- access `/dev/block`.

Deactivating APEX packages (unmounting them from `/postinstall/apex`
and detaching the corresponding loop devices) is part of the tear-down
phase run at the end of `oatpreopt_chroot`.

Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 113373927
Bug: 120796514
Change-Id: Ida07d2ceda31c7296228d973b26ff642f6533274
2019-01-23 16:19:28 +00:00
Roland Levillain
ab9c053078 Allow oatpreopt to run dex2oat from the Runtime APEX.
- Allow `postinstall_dexopt` to transition to domain `dex2oat` when
  executing `dex2oat` from the Runtime APEX
  (`/postinstall/apex/com.android.com/bin/dex2oat`).
- Allow `dex2oat` (from the Runtime APEX) to read files under
  `/postinstall` (e.g. APKs under `/system`, `/system/bin/linker`);

- Also allow `dex2oat` (from the Runtime APEX) to use libraries under
  `/postinstall/system` (e.g. `/system/lib/libc.so`). This is
  temporary change until Bionic libraries are part of the Runtime
  APEX.

Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 113373927
Bug: 120796514
Change-Id: I0a8a6ac485f725753ee909b1561becd3bd908ce4
2019-01-23 16:18:35 +00:00
Ryan Savitski
0670330838 Merge "Allow heap profiling of certain app domains on user builds"
am: 283761cfca

Change-Id: Id449f08ebc6d0f2b97101b5292d8cd1b9c078a37
2019-01-22 20:07:32 -08:00
Brian Stack
38626e4975 Merge "Add selinux policy for Sensors HAL 2.0"
am: 1e6055f172

Change-Id: Ib5292ee26f5f35b1d22d2095b29acc592b2036cf
2019-01-22 20:06:51 -08:00
Ryan Savitski
283761cfca Merge "Allow heap profiling of certain app domains on user builds" 2019-01-23 03:23:12 +00:00
Treehugger Robot
1e6055f172 Merge "Add selinux policy for Sensors HAL 2.0" 2019-01-23 03:15:05 +00:00
Sundong Ahn
39ffdb711c Merge "Add ro.surface_flinger.* to property_contexts"
am: d99018cfd5

Change-Id: Ib9e0c3fc82820043c51314b07728ef03f03d7660
2019-01-22 18:17:03 -08:00