Commit graph

3062 commits

Author SHA1 Message Date
Treehugger Robot
1934af2cf2 Merge "Require equivalence for mls restrictions on symlinks" 2019-01-26 06:30:46 +00:00
Treehugger Robot
3698256b63 Merge "Allow iorapd to access perfetto" 2019-01-26 06:18:32 +00:00
Victor Hsieh
a8b2bc47ec Allow system_server to search su:key in debuggable build
Test: successful fs-verity setup with key loaded from shell
Bug: 112037636
Change-Id: Ide01d11f309008fffeafdedb517508db94472873
2019-01-25 12:59:29 -08:00
Jeff Vander Stoep
bed2e162ea Require equivalence for mls restrictions on symlinks
An app should never follow a symlink provided by another app.

Test: build, boot Taimen, install some apps, watch youtube, browse
chrome.
Bug: 123350324
Change-Id: Iedd42fe1c27d406f7f58293c20d05e1b7646d8a2
2019-01-25 12:30:47 -08:00
Roland Levillain
f6243dac0b Merge "Clean up APEX-related otapreopt_chroot policies." 2019-01-25 18:34:43 +00:00
Leland Miller
9dd538eded Merge "Add policy for ircs service" 2019-01-25 18:28:57 +00:00
Andreas Gampe
bfefce386f Merge "Sepolicy: Initial Apexd pre-/postinstall rules" 2019-01-25 18:23:35 +00:00
Leland Miller
fa5dfd4d23 Add policy for ircs service
Test: Manually verified that service is accessible
Change-Id: If3748f4719b6194eccd16a097a0f1fc050f4160f
2019-01-25 10:12:04 -08:00
Nick Kralevich
a310da9aec Merge "disallow priv-apps from following untrusted app symlinks." 2019-01-25 17:51:38 +00:00
Roland Levillain
66fcb98464 Clean up APEX-related otapreopt_chroot policies.
Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 113373927
Bug: 120796514
Change-Id: Icbbe1babe0dceebff2546264ddabe779babba761
2019-01-25 14:36:37 +00: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
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
Carmen Jackson
4a90f2d012 Ensure that memory and binder_driver tracepoints are available in user builds
Bug: 123367055
Test: used Traceur to take a trace on a user build and verified the
tracepoints are in the resultant trace

Change-Id: I39e963762bf2b9f0e427ee217a3b2a246f970902
2019-01-24 23:43:46 -08:00
Treehugger Robot
c7fb2809bf Merge "Add more neverallows to app_zygote policy." 2019-01-25 05:24:02 +00:00
Andreas Gampe
261ea86192 Sepolicy: Initial Apexd pre-/postinstall rules
Give apexd permission to execute sh.

Add userdebug_or_eng domains and rules for the test
APEX for pre- and post-install.

Bug: 119260955
Bug: 119261380
Test: atest apexservice_test
Change-Id: I0c4a5e35e096101a53c9d1f212d2db2e63728267
2019-01-24 15:06:17 -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
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
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
Treehugger Robot
26d79ed694 Merge "gpuservice: allow cmd gpu vkjson in interactive shell" 2019-01-24 09:53:26 +00: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
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
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
Primiano Tucci
79d1dbbc05 Allow iorapd to access perfetto
This requires moving the type declaration of
perfetto traced to public, because iorapd
needs to refer to it.

Denials without this CL:
https://pastebin.com/raw/sxHMeLEU

Bug: 72170747
Test: 1. runcon u:r:iorapd:s0 iorap.cmd.perfetto \
          -v --output-proto /data/misc/iorapd/test
      2. Check that no selinux denials other than
         avc: denied { entrypoint } for path="/system/bin/iorap.cmd.perfetto" dev="sda6" ino=21 scontext=u:r:iorapd:s0 tcontext=u:object_r:system_file:s0 tclass=file permissive=1
         show up (this is a side-effect of runcon).

Change-Id: Iacd1ab201fe9fb2a6302dbd528f42f709cbca054
2019-01-23 22:43:47 +00: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
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
283761cfca Merge "Allow heap profiling of certain app domains on user builds" 2019-01-23 03:23:12 +00:00
Siarhei Vishniakou
c0c9155589 Permissions for input_native_boot flags
For input experiments that are enabled at boot time, allow system_server
to read and write the device config flags.

Bug: 120794829
Test: presubmit
Change-Id: I0f075a7579c593d4e07c3e31be529e34554068a6
2019-01-22 16:18:47 -08:00
Remi NGUYEN VAN
050936239c Merge "Fix permissions for bluetooth tethering." 2019-01-22 22:27:12 +00:00
Hongyi Zhang
f3db0085f0 Clean up server_configurable_flags test prop
Test: m -j & manually on device
Change-Id: I3f5ddeb26ddf1bf280ef5e7b3e62b4b892b83a3c
2019-01-22 01:42:36 +00:00
Ryan Savitski
ca0690e8eb Allow heap profiling of certain app domains on user builds
This patch extends the current debug-specific rules to cover user
builds. As a reminder, on user, the target process fork-execs a private
heapprofd process, which then performs stack unwinding & talking to the
central tracing daemon while staying in the target's domain. The central
heapprofd daemon is only responsible for identifying targets & sending
the activation signal. On the other hand, on debug, the central
heapprofd can handle all processes directly, so the necessary SELinux
capabilities depend on the build type.

These rules are necessary but not sufficient for profiling. For zygote
children, the libc triggering logic will also check for the app to
either be debuggable, or go/profileable.

For more context, see go/heapprofd-security & go/heapprofd-design.

Note that I've had to split this into two separate macros, as
exec_no_trans - which is necessary on user, but nice-to-have on debug -
conflicts with a lot of neverallows (e.g. HALs and system_server) for
the wider whitelisting that we do on debug builds.

Test: built & flashed on {blueline-userdebug, blueline-user}, activated profiling of whitelisted/not domains & checked for lack of denials in logcat.
Bug: 120409382
Change-Id: Id0defc3105b99f777bcee2046d9894a2b39c6a29
2019-01-21 14:30:57 +00:00
Martijn Coenen
1bbda7e662 Initial sepolicy for app_zygote.
The application zygote is a new sort of zygote process that is a
child of the regular zygote. Each application zygote is tied to the
application for which it's launched. Once it's started, it will
pre-load some of the code for that specific application, much like
the regular zygote does for framework code.

Once the application zygote is up and running, it can spawn
isolated service processes that run in the isolated_app domain. These
services can then benefit from already having the relevant
application code and data pre-loaded.

The policy is largely the same as the webview_zygote domain,
however there are a few crucial points where the policy is different.

1) The app_zygote runs under the UID of the application that spawned
   it.
2) During app_zygote launch, it will call a callback that is
   controlled by the application, that allows the application to
   pre-load code and data that it thinks is relevant.

Especially point 2 is imporant: it means that untrusted code can run
in the app_zygote context. This context is severely limited, and the
main concern is around the setgid/setuid capabilities. Those conerns
are mitigated by installing a seccomp filter that only allows
setgid/setuid to be called in a safe range.

Bug: 111434506
Test: app_zygote can start and fork children without denials.
Change-Id: I1cc49ee0042d41e5ac6eb81d8f8a10ba448d4832
2019-01-21 08:24:41 +00:00
Remi NGUYEN VAN
44fd885246 Fix permissions for bluetooth tethering.
Allow bluetooth to find the NetworkStack service so tethering can be
started.

Test: booted, BT tethering obtains IP address and denials not shown
Bug: b/112869080
Change-Id: I726d818f4f9a9adcd98c834726ed22376076ac7b
2019-01-19 11:52:32 +09:00
Eric Holk
f8dfb5f83b [layout compilation] Modify sepolicy to allow installd to run viewcompiler
We will generate precompiled layouts as part of the package install or upgrade
process. This means installd needs to be able to invoke viewcompiler. This
change gives installd and viewcompiler the minimal set of permissions needed for
this to work.

Bug: 111895153
Test: manual
Change-Id: Ic1fe60bd264c497b5f79d9e1d77c2da4e092377b
2019-01-18 23:29:47 +00:00
Christian Wailes
0f466d76d9 Merge "Add SELinux policies for blastula pool sockets." 2019-01-18 20:24:46 +00:00
Narayan Kamath
ea8b87fd36 Merge "Allow installd sufficient permissions to rollback_data_file." 2019-01-18 08:27:15 +00:00
Jeffrey Vander Stoep
3a7f33b44d Merge "rs: add tests to ensure rs cannot abuse app data" 2019-01-18 03:10:50 +00:00
Treehugger Robot
a0fb112a8a Merge "Revoke ftrace selinux access from dumpstate" 2019-01-18 01:39:21 +00:00
William Hester
1fefa6c0e8 Merge "Add the testharness service to sepolicy rules" 2019-01-18 01:07:22 +00:00
Jeff Vander Stoep
561aa01ccb rs: add tests to ensure rs cannot abuse app data
Test: build
Change-Id: I2ea39c767264339e300fceeb23c506883d23a14c
2019-01-17 15:24:34 -08:00
Chris Wailes
232f395548 Add SELinux policies for blastula pool sockets.
This patch adds the necessary SELinux contexts for the blastula pool
sockets.

Topic: zygote-prefork
Test: make & flash & check log for message
Bug: 68253328
Change-Id: I46d62e5ab8c573cb7704feec2b1d42d91a990fd9
2019-01-17 23:23:34 +00:00
Roland Levillain
0a6c2d013a Allow otapreopt_chroot to mount APEX packages using apexd logic.
Allow `otapreopt_chroot` to:
- read SELinux policy files;
- open and read the contents of `/postinstall/system/apex`;
- read the `persist.apexd.verity_on_system` system property;
- create loop devices with `/dev/loop-control`;
- access loop devices;
- configure read-ahead of loop devices;
- mount a tmpfs filesystem in `/postinstall/apex`;
- manipulate the tmpfs filesystem mounted in `/postinstall/apex`;
- mount APEX packages in `/postinstall/apex`.

Allow the kernel to:
- read `otapreopt_chroot`'s file descriptors;
- read files under `/postinstall`.

Allow `otapreopt` (running as "postinstall_dexopt") to:
- read data from `/postinstall/apex`.

Allow `dex2oat` to:
- access `/postinstall/apex`.

Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 113373927
Bug: 120796514
Change-Id: I204df92611dc710fdc97b22cd67d088ffd991210
2019-01-17 21:42:46 +00:00
William Hester
5f486c74bf Add the testharness service to sepolicy rules
The testharness service will manage Test Harness Mode and provide a
command-line interface for users to enable Test Harness Mode; however it
does not directly provide a public API.

Bug: 80137798
Test: make
Test: flash crosshatch
Change-Id: Ie396e40fcea8914b4dd2247f2314e029b66ad84e
2019-01-17 13:10:37 -08:00
Treehugger Robot
43f0fcf753 Merge "Add filemap events for iorapd" 2019-01-17 21:06:33 +00:00
Nandana Dutt
5a974a0eae Merge "Add sepolicy for BugreportManagerService" 2019-01-17 20:30:19 +00:00
Primiano Tucci
82f99dbed7 Add filemap events for iorapd
iorapd needs to access these events on-device
through perfetto.

Bug: 122606712
Bug: 72170747
Change-Id: I819dc9b79e85c3e261859d125c680a50737351da
2019-01-17 18:38:32 +00:00
Narayan Kamath
802cfe0f3d Allow installd sufficient permissions to rollback_data_file.
Used to capture and restore app data snapshots as implemented in change
I3e4d36c11e52fb885b585b1946e215cf986206fd.

Test: make, manual
Bug: 112431924

Change-Id: I1cd1ec3f9c93c4af65b662a5ada582299b595a8f
2019-01-17 16:56:42 +00:00
Primiano Tucci
33e81a9e42 Revoke ftrace selinux access from dumpstate
Getting rid of the feature in aosp/874979.
See other CL and bug for context.

Bug: 122987614
Bug: 122987614
Test: run dumpstate before and after patch,
      file sizes are comparable,
      observed no tracing-related errors.
Change-Id: Ifcde8dcbb99ce53d226b50ddd3178adaaa4322bd
2019-01-17 16:09:01 +00:00
Annie Meng
4c3d11c018 Add rules for multi-user backup/restore
The backup system service will move its storage location to per-user CE
directories to support multiple users. Add additional iterations on the
existing rules to support the new location.

/data/backup -> /data/system_ce/[user id]/backup
Previously covered by rule backup_data_file

/cache/backup -> /data/system_ce/[user id]/backup_stage
Previously covered by rule cache_backup_file

Also add support for vold to create and perform restorecon on the new
locations.

Example denials and detailed proposal in the doc on the linked bug.

Bug: 121197420
Test: 1) Boot device; check dirs created with correct label; run backup
successfully on system user
2) Create secondary user; check dirs created with correct label; run
backup successfully

Change-Id: I47faa69cd2a6ac55fb762edbf366a86d3b06ca77
2019-01-17 12:53:08 +00:00
Nandana Dutt
5cdd2f5ef8 Add sepolicy for BugreportManagerService
BUG:111441001
Test: boots
Change-Id: I71a54e8335c5ce7f9d97af3dbbd62e663bb66d33
2019-01-17 12:23:31 +00:00
Annie Meng
9e332a59b2 Merge "Add initial sepolicy for app data snapshots." 2019-01-17 11:01:00 +00:00
Frank Li
2d86b6502d Merge "Allow netd to write to statsd" 2019-01-17 04:15:00 +00:00
Treehugger Robot
938d0c2bf6 Merge "Allow the kernel to read staging_data_file." 2019-01-17 01:18:47 +00:00
Martijn Coenen
b85acbb889 Allow the kernel to read staging_data_file.
These are APEX files in /data/staging, and will be accessed by the loop
driver in the kernel.

Bug: 118865310
Test: no denials on emulator
Change-Id: I5c849b6677566cb00d28011352b9dc6b787a0bc4
2019-01-16 21:05:26 +01:00
Nick Kralevich
80eec389e2 rs.te: Remove dontaudit statements
These dontaudit rules were in place to suppress SELinux denials due to
file descriptor leakage. The file descriptor leakage has been fixed, so
these rules are no longer necessary. Delete.

Fixes: 120983106
Test: cts-tradefed run cts-dev -m CtsRenderscriptTestCases
Change-Id: I5cad79c3526583bd2b65bd089fee9c490f6beb5e
2019-01-16 10:54:16 -08:00
Narayan Kamath
2ad229c788 Add initial sepolicy for app data snapshots.
Define a rollback_data_file label and apply it to the snapshots
directory. This change contains just enough detail to allow
vold_prepare_subdirs to prepare these directories correctly.

A follow up change will flesh out the access policy on these
directories in more detail.

Test: make, manual
Bug: 112431924

Change-Id: I4fa7187d9558697016af4918df6e34aac1957176
2019-01-16 15:22:51 +00:00
lifr
980c08c999 Allow netd to write to statsd
config sepolicy to allow netd to write to statsd.

Test: run runtests.sh, make sure no missing test and get all pass
      run /out/host/linux-x86/bin/statsd_testdrive 82
      Got following metric data dump:pass for local test
Bug: 119862317

Change-Id: Ieff5ca55de46715d54ef57c4a6d144fd7d03e4b7
2019-01-16 13:33:18 +00:00
David Anderson
6d53efcf46 sepolicy for gsid
Bug: 122556707
Test: gsid starts
Change-Id: Ib05ddb79051436f51cd236de04027a3b12ee87a9
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-01-15 20:43:33 -08:00
Remi NGUYEN VAN
a2e024f890 Merge "Allow NetworkStack to find the telephony service" 2019-01-16 01:29:10 +00:00
Remi NGUYEN VAN
fd758cbddb Allow NetworkStack to find the telephony service
The network stack needs access to TelephonyManager#getAllCellInfo to
send network conditions broadcasts.

Bug: 122843997
Test: Flashed, verified violation not shown and cell info obtained
properly.

Change-Id: I6ef2858c9a2d1fbbb993164a93bd985e0eee8887
2019-01-15 16:57:32 +09:00
chenbruce
e3d625b72e SEPolicy updates for adding native flag namespace(netd).
For experiment flag testing, we add a flag netd and have
SEPolicy updates.

Test:  add sepolicy, m -j, check GetServerConfigurableFlag function in netd
Bug:122050512
Change-Id: I21c844c277afc358085d80447f16e4c0d4eba5b3
2019-01-15 02:47:57 +00:00
Jiwen Cai
53f5375824 Merge "Allow app to conntect to BufferHub service" 2019-01-14 21:58:15 +00:00
Treehugger Robot
146be01a0f Merge "Add selinux rules for detachable perfetto process." 2019-01-14 20:24:32 +00:00
Dario Freni
0eb6bff5f3 Merge "Allow apexd to also create dirs/files in its storage." 2019-01-14 19:41:15 +00:00
Jiwen 'Steve' Cai
e17b293528 Allow app to conntect to BufferHub service
Bug: 112940221
Test: AHardwareBufferTest
Change-Id: I1fd065844e03c7e079dc40b7f7dbb8968f1b00bc
2019-01-14 10:49:35 -08:00
Joel Fernandes
2075608582 Merge changes from topic "bpf-init"
* changes:
  Add permissions for bpf.progs_loaded property
  Allow executing bpfloader from init and modify rules
  Assign bpfloader with CAP_SYS_ADMIN
2019-01-14 18:34:19 +00:00
Jeff Vander Stoep
036090d203 netdomain: allow node_bind for ping sockets
Grant for icmp_socket for devices with 4.14 or greater kernel, and
rawip_socket for devices with earlier kernels.

Bug: 122572608
Test: build
Change-Id: I1c9d2ce6761dbd2c4db3635600c5f5c335461083
2019-01-14 16:59:03 +00:00
Jeffrey Vander Stoep
75448f8316 Merge "netdomain: move to public policy" 2019-01-14 16:58:50 +00:00
Joel Fernandes
b76a639956 Add permissions for bpf.progs_loaded property
Change-Id: If4e550e4186415c5a1088bb53b0755b69f92560a
Signed-off-by: Joel Fernandes <joelaf@google.com>
2019-01-14 10:59:10 -05:00
Joel Fernandes
147cf6482e Allow executing bpfloader from init and modify rules
init needs to execute bpfloader as a one-shot service. Add sepolicy for
the same. Also update old rules allowing init to fork/exec bpfloader and
remove rules allowing netd to do so.

Bug: 112334572
Change-Id: Ic242cd507731ed8af3f8e94d4fccc95819831d37
Signed-off-by: Joel Fernandes <joelaf@google.com>
2019-01-14 10:59:10 -05:00
Joel Fernandes
4bf478828f Assign bpfloader with CAP_SYS_ADMIN
bpfloader needs to load bpf programs with tracepoints in them. The
tracepoint programs are not activated but are just loaded and pinned.
The kernel expects the process doing this to have CAP_SYS_ADMIN. Since
bpfloader was intended to be a 1-shot run and exit process with security
privileges, lets assign it CAP_SYS_ADMIN so that it is able to load the
tracepoint programs.

Bug: 112334572
Change-Id: Icf9b5d95615e69f5c28dc28f021b07f49710c97d
Signed-off-by: Joel Fernandes <joelaf@google.com>
2019-01-14 10:59:10 -05:00
Cheney Ni
a6946d7929 Add Bluetooth Audio HAL interface V2 as hal_audio_hwservice
Bluetooth Audio HAL interface is an unified HIDL interface for BT Stack
and Audio HAL. It works the same as IBluetoothAudioOffload and uses the
same rules.

Bug: 111519504
Test: manual

Change-Id: Ifdff0d2d9a111abc51ed74c223d2e430ad51b203
2019-01-14 22:26:22 +08:00
Martijn Coenen
179ada913c Allow apexd to also create dirs/files in its storage.
Bug: 118865310
Test: no denials when running ApexServiceTest#SubmitSessionTestSuccess
Change-Id: I9a309fca99c23ca7db4af58db782a2bd6a83d829
2019-01-14 09:15:46 +01:00
Martijn Coenen
cb691fbcfd Merge "Add persist.apexd. property context." 2019-01-14 07:59:12 +00:00
Sooraj Sasindran
2968496e2c Merge "Rename ANS to ONS" 2019-01-12 19:11:52 +00:00
Treehugger Robot
9c654b7ca1 Merge "Allow fs-verity setup within system_server" 2019-01-12 06:03:26 +00:00
Jeff Vander Stoep
937f256b2d netdomain: move to public policy
Vendor domains may use net_domain() so it should be moved to public
policy. This will allow removal of permissions such as rawip_socket
in future releases without breaking Treble compatiblity.

Bug: 122572608
Test: build
Change-Id: Id84feb11587d305334cd9dbbc6e4f6f71ffff6f2
2019-01-12 04:31:41 +00:00
Nick Kralevich
ef6f1b52ad Merge "rename rs_data_file to app_exec_data_file" 2019-01-12 01:51:47 +00:00
Victor Hsieh
7397ebd1e1 Allow fs-verity setup within system_server
The original fs-verity implementation requires CAP_SYS_ADMIN and thus
the actual setup is proxied through installd.  Instead, upstream
FS_IOC_ENABLE_VERITY ioctl checks write permission to inode, and thus
can happen in system_server.

Also, replace the old measure ioctl with FS_IOC_SET_VERITY_MEASUREMENT.
Note that although the number is name, they work differently.

Test: set ro.apk_verity.mode=2, in-progress CTS passed without denial
Bug: 112037636
Change-Id: I3e8d14321df8904dfed68b83aae8b3dd99c211ac
2019-01-11 12:21:59 -08:00
Nick Kralevich
fb66c6f81b rename rs_data_file to app_exec_data_file
There are multiple trusted system components which may be responsible
for creating executable code within an application's home directory.
Renderscript is just one of those trusted components.

Generalize rs_data_file to app_exec_data_file. This label is intended to
be used for any executable code created by trusted components placed
into an application's home directory.

Introduce a typealias statement to ensure files with the previous label
continue to be understood by policy.

This change is effectively a no-op, as it just renames a type, but
neither adds or removes any rules.

Bug: 121375718
Bug: 112357170
Test: cts-tradefed run cts-dev -m CtsRenderscriptTestCases
Change-Id: I17dca5e3e8a1237eb236761862174744fb2196c0
2019-01-11 20:07:20 +00:00
Tao Bao
a22f9b80f3 Remove the file context rule for /system/bin/bspatch.
update_engine no longer needs a standalone bspatch executable since [1]
(which first landed into O). And we don't ship /system/bin/bspatch on
device by default.

[1] https://android-review.googlesource.com/c/platform/system/update_engine/+/327365

Test: Verify that /system/bin/bspatch doesn't exist on device.
Test: Trigger an A/B OTA install for aosp_walleye-userdebug:
      `m dist`;
      `system/update_engine/scripts/update_device.py out/dist/aosp_walleye-ota.zip`.
      No update_engine related denial.
Change-Id: Iff578bdb0b1909092dd19feff069755a44d29398
2019-01-11 19:00:55 +00:00
Steven Moreland
b7246ac0b6 system/etc/event-log-tags available to all
This was a regression in Q, and the file is an implementation of
liblog.

Bug: 113083310
Test: use tags from vendor and see no denials

Change-Id: I726cc1fcfad39afc197b21e431a687a3e4c8ee4a
2019-01-11 18:42:02 +00:00
Treehugger Robot
1531e72e76 Merge "Permissions for InputClassifier HAL" 2019-01-11 18:30:38 +00:00
Sooraj Sasindran
2cf336bf31 Rename ANS to ONS
Rename AlternativeNetworkService to OpportunisticNetworkService
Bug: 118347827
Test: compile
Merged-In: I23b0caadd1801c104806fa438fc9054d8a31962e
Change-Id: I23b0caadd1801c104806fa438fc9054d8a31962e
2019-01-11 17:46:04 +00:00
Martijn Coenen
97650f5032 Add persist.apexd. property context.
For persistent properties related to apexd.

Bug: 121302351
Test: apexd can get the prop
Change-Id: Id9fd25923385188f46a9804155168c52f6b1187e
2019-01-11 16:09:10 +00:00
Primiano Tucci
985cb4a96a Merge "Allow perfetto to ingest logs on userdebug/eng" 2019-01-11 14:06:42 +00:00
Remi NGUYEN VAN
9b9c787937 Merge "Allow network_stack to use common app api services" 2019-01-11 02:40:52 +00:00
Siarhei Vishniakou
41a871ba84 Permissions for InputClassifier HAL
Add the required permissions for the InputClassifier HAL.

Bug: 62940136
Test: no selinux denials in logcat when HAL is used inside input flinger.
Change-Id: Ibc9b115a83719421d56ecb4bca2fd196ec71fd76
2019-01-11 02:08:19 +00:00
Remi NGUYEN VAN
d0f65ce2ff Allow network_stack to use common app api services
Bug: b/122620633
Test: m
Change-Id: I36fe66fc22a1664f9ef25c66f933a2613a6f346b
2019-01-11 07:48:21 +09:00
Carmen Jackson
9678e079ac Add selinux rules for detachable perfetto process.
This appears to be the minimum change required to accommodate Traceur
running the detachable Perfetto process.

Bug: 116754732
Test: Started a perfetto trace using --detach and it started
successfully.

Change-Id: I12881ae343389abdcc74af5f11ecbac99b03ef7c
2019-01-10 12:18:24 -08:00
Primiano Tucci
a64d5bb7ef Allow perfetto to ingest logs on userdebug/eng
When recording hour-long traces, logcat messages help
to interpret the trace, giving human readable context on what
is happening on the system.
Furthermore this is particularly helpful for startup
debugging thanks to activity manager instrumentation events
(am_on_create_called, am_on_start, ...).
This is only allowed on userdebug/eng builds.

Bug: 122243384
Change-Id: I4dfaebf21107e9853b0bf42403fbab6c3b4d5141
2019-01-10 20:14:06 +00:00
Chalard Jean
fb15c9f12f Add sepolicy for IpMemoryStoreService
Bug: 116512211
Test: Builds, boots, including upcoming changes needing this
Change-Id: I6f119368c5a4f7ac6c0325915dff60124c5a6399
2019-01-10 18:06:56 +09:00