Commit graph

4042 commits

Author SHA1 Message Date
Roland Levillain
446b2fedce Allow otapreopt to use bind-mounted Bionic artifacts from the Runtime APEX.
Allow `otapreopt_chroot` to:
- bind-mount Bionic artifacts from the Runtime APEX
  (`/postinstall/apex/com.android.runtime`) into `/postinstall/bionic/`;
- read the `/postinstall/system/bin/linker(64)` symlink to
  `/postinstall/bionic/bin/linker(64)` when executing
  `/postinstall/system/bin/otapreopt`.

Allow `otapreopt` (running as `postinstall_dexopt`) to:
- read directories under `/postinstall`.

Test: m otapreopt_chroot
Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 113373927
Bug: 120266448
Change-Id: I6de9df12d5fd84f1dd92798efed5f2d8b72d3ebe
2019-01-31 19:09:08 +00:00
Jeff Vander Stoep
9ec16c1c34 Merge "Remove unused *_tmpfs types"
am: 586c2cdfdf

Change-Id: I575c948a9143a3d3926ef4bb8b758eab6c928c32
2019-01-31 11:08:34 -08:00
Treehugger Robot
586c2cdfdf Merge "Remove unused *_tmpfs types" 2019-01-31 18:59:43 +00:00
Dongwon Kang
523c746859 SEPolicy updates for adding native flag namespace(media).
Test: add sepolicy, build, check GetServerConfigurableFlag function
Bug: 123658514
Change-Id: I798b0ef901068c53070e768305acd38118a7e886
2019-01-31 10:06:32 -08:00
Jiyong Park
46298e157f Allow init to mount on /bionic in recovery mode
am: cd6a6a0933

Change-Id: I8ab4fbf121144b5e88e92683543e517888ecb6ef
2019-01-30 21:00:42 -08:00
Jiyong Park
cee3eecccd init can call setns
am: 9d9333ac86

Change-Id: I7055d04b08f81b08a0bfe5b371723204c459f698
2019-01-30 21:00:29 -08:00
Jiyong Park
b546607a27 Label the bootstrap linker and bionic mount points
am: 4b3f2c6245

Change-Id: Ia90d5b6960272124e6a19ddb5c0923ecce105073
2019-01-30 21:00:17 -08:00
Jiyong Park
cd6a6a0933 Allow init to mount on /bionic in recovery mode
The mount points under /bionic are rootfs in recovery mode. Init should
be able to bind-mount the bootstrap Bionic to the mount points.

Bug: 120266448
Test: adb reboot recovery; phone enters into the recovery mode
Change-Id: I57aed268eac08a5fb3609750bf10cd8d6e97347a
2019-01-31 13:44:21 +09:00
Jiyong Park
9d9333ac86 init can call setns
init now creates two mount namespaces one for pre-apexd processes and
the other for post-apexd processes. This is to mount different files to
the same mount point at /bionic. For pre-apexd processes, the bootstrap
Bionic is mounted. For post-apexd processes, the default Bionic (from
the runtime APEX) is mounted.

Using unshare and setns, init first starts with the mount namespace for
the pre-apexd and then switches to the other mount namespace when APEXes
are ready. It then occasionally switches to pre-apexd mount namespace
when it has to re-launch a pre-apexd process (e.g. the process has
crashed, etc.)

In doing so, read access to /proc/self/ns/mnt is granted to init as
well.

Bug: 120266448
Bug: 122717176
Test: m device boots
Change-Id: Idbf15cbf5cc36b9993d718d4d887cd8f23a94666
2019-01-31 13:44:21 +09:00
Jiyong Park
4b3f2c6245 Label the bootstrap linker and bionic mount points
Bootstap linker has been moved from /system/bin/linker[64] to
/system/bin/bootstrap/linker[64]. Reflect the change in file_contexts.
Existing paths are not removed since the bootstrap linker (or the
linker from the rumtime APEX) will be bind-mounted to the old path by
init.

Also label the files under /bionic which serve as mount points for
either of the bootstrap bionic or the bionic from the runtime APEX.

In addition, read access for the symlinks in /system/lib/*.so and
/system/bin/linker is granted. This is because Bionic files in the paths
are now symlinks to the corresponding mountpoints at /bionic.

Bug: 120266448
Test: device boots to the UI

Change-Id: Iea4d76eb46754b435b6c5428481cd177da8d2ee1
2019-01-31 13:44:21 +09:00
Yabin Cui
a3248b809c Merge "Fix running simpleperf_app_runner on user device."
am: 59e8da9196

Change-Id: Iab88f8f0754b72a6c626608e797342b91c400548
2019-01-30 15:07:36 -08:00
Treehugger Robot
59e8da9196 Merge "Fix running simpleperf_app_runner on user device." 2019-01-30 22:59:43 +00:00
Jeff Vander Stoep
3b9fad192a Remove unused *_tmpfs types
Apps now all share the appdomain_tmpfs type.

Bug: 122854450
Test: boot Blueline with memfd enabled.
Change-Id: I5eac0adc7ecd10d19aa1bdf5f72efc7ed2a3a548
2019-01-30 21:54:40 +00:00
David Anderson
607fb9e445 Allow mkfs on device-mapper devices.
When running a GSI as a live image, a temporary userdata partition is
mounted through device-mapper. In order to properly format+encrypt this
like a normal userdata partition, mkfs must have rw permissions.

Bug: 122850122
Test: manual test
Change-Id: I5aa888f12a85954a9818ed04009832d76c139862
2019-01-30 13:00:35 -08:00
Jeff Vander Stoep
5314cb2a93 Initial selinux policy support for memfd
am: 9f5d0d90a3

Change-Id: Idcdd62cdb6bb0119c7ab85da9e7dfaebe3f1078e
2019-01-30 11:33:43 -08:00
Jeff Vander Stoep
9f5d0d90a3 Initial selinux policy support for memfd
Move all app tmpfs types to appdomain_tmpfs. These are still protected
by mls categories and DAC. TODO clean up other app tmpfs types in a
separate change.

Treble-ize tmpfs passing between graphics composer HAL and
surfaceflinger.

Bug: 122854450
Test: boot Blueline with memfd enabled.
Change-Id: Ib98aaba062f10972af6ae80fb85b7a0f60a32eee
2019-01-30 19:11:49 +00:00
Yabin Cui
84c70929be Fix running simpleperf_app_runner on user device.
Bug: 118835348
Test: build and boot blueline user device.
Test: test simpleperf_app_runner manually.
Change-Id: I022d7f10f6164e6980f55badd4edcdc76a73c004
2019-01-30 11:09:43 -08:00
Shuzhen Wang
410a5f08d3 Allow cameraserver to access tmpfs
am: 248633385e

Change-Id: I988a34b8c28fb44ddf723cf74ef6beb4a2487350
2019-01-29 21:46:16 -08:00
Shuzhen Wang
e588655bb9 Revert "Cameraserver: Allow cameraserver to access /data/misc/cameraserver"
am: 6b4caaa3e8

Change-Id: I5544b92d58ba992dd24c354d4c801f6891204b35
2019-01-29 21:45:53 -08:00
Shuzhen Wang
248633385e Allow cameraserver to access tmpfs
Bug: 79465976
Test: testHeic CTS test
Change-Id: I51eb485dc29d869c5d35fc317b0e008d04bdcbad
2019-01-30 05:31:42 +00:00
xunchang
0ad3e4f4dd Allow update engine to write to statsd socket
Update_engine reports metrics with libmerticslogger, which switches to
write to statsd recently. Add the permission to update_engine_common so
that both the daemon and recovery sideload tool can report the metrics.

update_engine: type=1400 audit(0.0:47): avc: denied { write } for name="statsdw" dev="tmpfs" ino=26257 scontext=u:r:update_engine:s0 tcontext=u:object_r:statsdw_socket:s0 tclass=sock_file permissive=0
update_engine: type=1400 audit(0.0:54): avc: denied { write } for name="statsdw" dev="tmpfs" ino=26257 scontext=u:r:update_engine:s0 tcontext=u:object_r:statsdw_socket:s0 tclass=sock_file permissive=0

Bug: 120623435
Test: the denial message disappear
Change-Id: Ie6a7a179b4291ef8209c99de758862b25df2a02f
2019-01-29 16:07:39 -08:00
Shuzhen Wang
6b4caaa3e8 Revert "Cameraserver: Allow cameraserver to access /data/misc/cameraserver"
This reverts commit 4e1497c7c0.

Reason for revert: Write temporary file to in-memory tmpfs instead

Test: testHeic CTS test
Bug: 123526741
Change-Id: Ifa7f5a0b50c46ee3e1a5695595233b17adc99222
2019-01-29 23:29:05 +00:00
Mathieu Chartier
a35beeb6f3 Merge "Rename runtime -> runtime_native property namespace"
am: 91b0ef13d8

Change-Id: Idfa6c810d540332c44ba997ec2a061efabdb6903
2019-01-29 14:48:03 -08:00
Roland Levillain
9ae5d888eb Introduce a postinstall_apex_mnt_dir label for /postinstall/apex.
am: a42ebf4128

Change-Id: I52a7240c6d852b20bde14a269ebccec46e53b5ea
2019-01-29 10:21:02 -08:00
Mathieu Chartier
669cef88a3 Rename runtime -> runtime_native property namespace
The convention for native properties is to use _native suffix.

Bug: 123524494
Bug: 120794191
Test: set a property and ensure it can be read in AndroidRuntime.cpp

Change-Id: I69feab9be78f24d812b8f953d3ec06a5d8d18f15
2019-01-29 10:20:36 -08:00
Roland Levillain
a42ebf4128 Introduce a postinstall_apex_mnt_dir label for /postinstall/apex.
Directory `/postinstall/apex` is used as a mount point for a tmpfs
filesystem during A/B OTA updates. APEX packages from the new system
partition are mounted ("activated") in subdirectories of
`/postinstall/apex`, so that they are available when `otapreopt` is
running.

Directory `/postinstall/apex` used to be of type `tmpfs` for SELinux
purposes. The new `postinstall_apex_mnt_dir` label is more
restrictive, and tightens permissions granted to `otapreopt_chroot`,
`otapreopt` (running as `postinstall_dexopt`), and `dex2oat`,
regarding the apexd logic recently added to `otapreopt_chroot`.

Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 113373927
Bug: 120796514
Change-Id: I03f0b0433d9c066a0c607f864d60ca62fc68c990
2019-01-29 10:09:50 +00:00
Mathieu Chartier
01a1ca2d55 Merge "Add runtime property permissions for experiments"
am: 2c92514304

Change-Id: I024ecbbbc7da3d0089ba2427b70daaf044b3e084
2019-01-28 21:34:29 -08:00
Remi NGUYEN VAN
27902606e3 Merge "Add NetworkStack policies for netd and netlink"
am: a579a99d31

Change-Id: Id9ea589714f9757c7d5d61ca2efa867006569077
2019-01-28 21:28:53 -08:00
Mathieu Chartier
2c92514304 Merge "Add runtime property permissions for experiments" 2019-01-29 00:43:43 +00:00
Remi NGUYEN VAN
a579a99d31 Merge "Add NetworkStack policies for netd and netlink" 2019-01-28 23:13:08 +00:00
Mathieu Chartier
05ad04dd91 Add runtime property permissions for experiments
Bug: 120794191
Bug: 123524494
Test: set a property and ensure it can be read in AndroidRuntime.cpp

Change-Id: Ib37102f35e9987d3d9baff83c45571a5d632ad50
2019-01-28 12:39:23 -08:00
Shuzhen Wang
33898587ef Cameraserver: Allow cameraserver to access /data/misc/cameraserver
am: 4e1497c7c0

Change-Id: I9da56e7216e5b303bccf561814ef0ce409561bbc
2019-01-28 08:20:44 -08:00
Shuzhen Wang
b1a7f25f58 Cameraserver: Allow camera server to talk to MediaCodec
am: 8db7e4a7fa

Change-Id: Icdd5c65ee33472cf54790afdc57db336d0e342fd
2019-01-28 08:20:31 -08:00
Shuzhen Wang
4e1497c7c0 Cameraserver: Allow cameraserver to access /data/misc/cameraserver
Test: Cameraserver writes/reads/overwrites files in the folder
Bug: 79465976
Change-Id: I76460844a8e02e4c6ce704b85c72e57f861f5b18
2019-01-28 07:32:00 -08:00
Shuzhen Wang
8db7e4a7fa Cameraserver: Allow camera server to talk to MediaCodec
Test: Verify that cameraserver can call MediaCodec functions
Bug: 79465976
Change-Id: I145d2aac5004bf0d9432c3d5dd4d6dcd672374be
2019-01-28 07:32:00 -08:00
Remi NGUYEN VAN
780fbadf08 Add NetworkStack policies for netd and netlink
Allow netd to send network events to the NetworkStack, and allow the
NetworkStack to interact with netlink_route_socket for neighbor
monitoring.

Test: built, booted, WiFi works, no more violations
Bug: 112869080
Change-Id: If212b2897e37e9d249f81ba8139461bce461528e
2019-01-28 14:40:52 +09:00
Jeff Vander Stoep
cad5b92413 Merge "iorapd: add tmpfs type"
am: 063022a6ec

Change-Id: I04c61ac958d4d6f1df6d0aede2079794f2be0999
2019-01-26 23:53:29 -08:00
Jeff Vander Stoep
5e05eb6584 Merge "Properly Treble-ize tmpfs access"
am: df88d3faee

Change-Id: Ia466de350f93ed9798301cd35d890ed9912c6efd
2019-01-26 23:53:11 -08:00
Treehugger Robot
063022a6ec Merge "iorapd: add tmpfs type" 2019-01-27 07:46:14 +00:00
Jeff Vander Stoep
6742ab4e4e iorapd: add tmpfs type
Fixes build breakage:
system/sepolicy/private/traced.te:36:ERROR 'unknown type iorapd_tmpfs' at token ';' on line 43166:

Bug: 123445058
Test: build marlin-userdebug
Change-Id: Iefeba03ed2efee92fb0d61214514338c6d999bd1
(cherry picked from commit 426ff11951)
2019-01-26 12:55:13 -08:00
Jeffrey Vander Stoep
33f3e04705 Merge "runtime_event_log_tags_file: dontaudit map permission"
am: 0e48c3bcdd

Change-Id: I9738e6e1feb10063e4485074b105780dedabfd24
2019-01-26 09:35:43 -08:00
Jeff Vander Stoep
41a2abfc0d Properly Treble-ize tmpfs access
This is being done in preparation for the migration from ashmem to
memfd. In order for tmpfs objects to be usable across the Treble
boundary, they need to be declared in public policy whereas, they're
currently all declared in private policy as part of the
tmpfs_domain() macro. Remove the type declaration from the
macro, and remove tmpfs_domain() from the init_daemon_domain() macro
to avoid having to declare the *_tmpfs types for all init launched
domains. tmpfs is mostly used by apps and the media frameworks.

Bug: 122854450
Test: Boot Taimen and blueline. Watch videos, make phone calls, browse
internet, send text, install angry birds...play angry birds, keep
playing angry birds...

Change-Id: I20a47d2bb22e61b16187015c7bc7ca10accf6358
Merged-In: I20a47d2bb22e61b16187015c7bc7ca10accf6358
(cherry picked from commit e16fb9109c)
2019-01-26 17:30:41 +00:00
Jeffrey Vander Stoep
0e48c3bcdd Merge "runtime_event_log_tags_file: dontaudit map permission" 2019-01-26 17:28:51 +00:00
Primiano Tucci
a1150133af Merge "Allow iorapd to access perfetto"
am: 3698256b63

Change-Id: I6f91ac68da4ef21f9be0a3efaa5a747b0ff6296e
2019-01-25 22:31:22 -08:00
Treehugger Robot
3698256b63 Merge "Allow iorapd to access perfetto" 2019-01-26 06:18:32 +00:00
Jiyong Park
92e81ee4ca Merge "Don't audit access for postinstall_mnt_dir"
am: 527d215ca0

Change-Id: Icb90f19154e1fc1ad58164d25f9958f4183c48db
2019-01-25 14:51:11 -08:00
Treehugger Robot
527d215ca0 Merge "Don't audit access for postinstall_mnt_dir" 2019-01-25 22:41:50 +00:00
Roland Levillain
7fb3fa878e Merge "Clean up APEX-related otapreopt_chroot policies."
am: f6243dac0b

Change-Id: I9366b60185a88c246f4f386695c8b58cbad24628
2019-01-25 10:47:13 -08:00
Roland Levillain
f6243dac0b Merge "Clean up APEX-related otapreopt_chroot policies." 2019-01-25 18:34:43 +00:00
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
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
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
Jiyong Park
4372bfb5cd Don't audit access for postinstall_mnt_dir
The dynamic linker always calls access(2) on the path. Don't generate SElinux
denials since the linker does not actually access the path in case the path
does not exist or isn't accessible for the process.

Bug: 120996057
Test: copy ping to /data/local/tmp, run it, no selinux denials
Test: bionic unit tests

Change-Id: Idf33ba7bc6c0d657b6ab0abde6bd078e4bb024e5
2019-01-25 20:48:58 +09: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
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
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
Yabin Cui
31bd80439f Merge "Add sepolicy for simpleperf_app_runner." 2019-01-24 18:39:13 +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
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
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
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
Ryan Savitski
283761cfca Merge "Allow heap profiling of certain app domains on user builds" 2019-01-23 03:23:12 +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
Treehugger Robot
d99018cfd5 Merge "Add ro.surface_flinger.* to property_contexts" 2019-01-23 02:03:00 +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
Hongyi Zhang
365d9f3c8c Merge "Clean up server_configurable_flags test prop"
am: d71144a922

Change-Id: I90b4e4a032e82206264a12fa50c2d40adf1e4404
2019-01-22 10:52:51 -08:00
Hongyi Zhang
d71144a922 Merge "Clean up server_configurable_flags test prop" 2019-01-22 18:27:29 +00:00
Leo Liou
6842d1d10d Add selinux policy for ext4 fs-verity feature
am: 51373ec7a3

Change-Id: Ie67a62c1694fde406884433161d90cceed4f848a
2019-01-21 22:50:58 -08:00
Sundong Ahn
b9796da741 Add ro.surface_flinger.* to property_contexts
The ro.surface_flinger.* properties are added to property_contexts.
Because these properties are located in vendor partition, but
surfaceflinger service which use these properties is in the system
partition.

Bug: 112386364
Test: m -j & boot test
Change-Id: I98d71d4c03297a2a3fe92ba17bfdcb428f763753
2019-01-22 11:00:14 +09: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
Leo Liou
51373ec7a3 Add selinux policy for ext4 fs-verity feature
avc: denied { read } for comm="init" name="verity" dev="sysfs" ino=44746
scontext=u:r:init:s0 tcontext=u:object_r:sysfs_fs_ext4_features:s0 tclass=file
permissive=0

Bug: 117437571
Test: bootable for phone projects
Change-Id: I4c53e03ec55c2064f1b23c0cbd0302de3f8aa38e
2019-01-22 08:12:54 +08: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
fd4b0b29f9 Initial sepolicy for app_zygote.
am: 1bbda7e662

Change-Id: Iaca2468441b11d0e1aff49f89fc018324ca03b0e
2019-01-21 00:29:43 -08: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
Jeffrey Vander Stoep
7a711626c3 Merge "rs: add tests to ensure rs cannot abuse app data"
am: 3a7f33b44d

Change-Id: I8d191d9c0a377079805a6b99f6be95e068d09ebc
2019-01-17 19:18:44 -08:00
Jeffrey Vander Stoep
3a7f33b44d Merge "rs: add tests to ensure rs cannot abuse app data" 2019-01-18 03:10:50 +00:00
William Hester
a587f0d4d3 Merge "Add the testharness service to sepolicy rules"
am: 1fefa6c0e8

Change-Id: I9185a2b57d3f862cc2f4e64da05ec5a3d2de7172
2019-01-17 17:31:07 -08: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
Tao Bao
0a44f5e1fc Merge "recovery: Address the ioctl denials during wiping."
am: 945f6bd1c6

Change-Id: I58b58eb8b25e3a1774d9c509e811ddd23929a554
2019-01-17 15:23:38 -08:00
Treehugger Robot
945f6bd1c6 Merge "recovery: Address the ioctl denials during wiping." 2019-01-17 22:50:56 +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
Jaegeuk Kim
69c3e053c1 Merge "zram: allow zram writeback"
am: b9114af8aa

Change-Id: I31c679e514d7744dddad46cc9f1bef2feee5261b
2019-01-17 13:16:46 -08: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
Jaegeuk Kim
b9114af8aa Merge "zram: allow zram writeback" 2019-01-17 21:03:15 +00:00
Nandana Dutt
b3b807b758 Merge "Add sepolicy for BugreportManagerService"
am: 5a974a0eae

Change-Id: I72abcbff8d3762561fec9f9102255e3ed4299ba9
2019-01-17 12:43:20 -08:00
Nandana Dutt
5cdd2f5ef8 Add sepolicy for BugreportManagerService
BUG:111441001
Test: boots
Change-Id: I71a54e8335c5ce7f9d97af3dbbd62e663bb66d33
2019-01-17 12:23:31 +00:00
Jaegeuk Kim
579271906a zram: allow zram writeback
This allows fs_mgr in init to build loopback device and its control.

Bug: 74582279
Change-Id: I039cd57d4638870a59dd38c952d3ab9b671be545
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2019-01-17 04:28:00 +00:00
Martijn Coenen
0fc85c1535 Merge "Allow the kernel to read staging_data_file."
am: 938d0c2bf6

Change-Id: I66fbc471ad5e508de0b8fde2d1ab3cb6fe1646a8
2019-01-16 17:36:25 -08: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
Jeff Vander Stoep
ec56d3024c Merge "app: remove redundant neverallow rule"
am: 2b80559518

Change-Id: I6eaaaa6b622f2cb4135d697f870b9618216ba0c0
2019-01-16 07:45:52 -08:00
Treehugger Robot
2b80559518 Merge "app: remove redundant neverallow rule" 2019-01-16 15:28:28 +00:00
Jeff Vander Stoep
d8bec4ac72 app: remove redundant neverallow rule
Access to zygote_socket is already neverallowed to
{ domain -system_server }.

Test: build
Change-Id: I6353ef09f769c8d64c97b1bdef93f0ab4d5dae6a
2019-01-15 20:31:01 -08:00
Wei Wang
6acbe4626b Merge "Allow lmkd to renice process before killing"
am: f0dd63dbe0

Change-Id: I0b58e4ed5ca49b0171068a321b0b009a1b39d44d
2019-01-15 19:13:37 -08:00
Wei Wang
f0dd63dbe0 Merge "Allow lmkd to renice process before killing" 2019-01-16 03:06:21 +00:00
Tao Bao
832f8af08b recovery: Address the ioctl denials during wiping.
avc:  denied  { ioctl } for  pid=599 comm="mke2fs" path="/dev/block/sda13" dev="tmpfs" ino=18975 ioctlcmd=127b scontext=u:r:recovery:s0 tcontext=u:object_r:userdata_block_device:s0 tclass=blk_file
avc:  denied  { ioctl } for  pid=587 comm="mke2fs" path="/dev/block/sda20" dev="tmpfs" ino=17931 ioctlcmd=0x127b scontext=u:r:recovery:s0 tcontext=u:object_r:metadata_block_device:s0 tclass=blk_file

0x127b (BLKPBSZGET) is called by mke2fs that queries physical sector
size. Although the denial is currently non-fatal, as mke2fs falls back
to use logical sector size, it might lead to undesired result in future.

Test: Factory reset on taimen and blueline respectively.
Change-Id: I14fc6593aeae309c79f5eadcffc8158b0a2ab2f6
2019-01-15 16:08:09 -08:00
Sandeep Patil
68dbdcf19c Merge "Allow init to relabel metadata block device."
am: fae37428f1

Change-Id: I0dceec8bb5f853a916a6d9870ed381e1b43f9dd0
2019-01-15 11:34:01 -08:00
Treehugger Robot
fae37428f1 Merge "Allow init to relabel metadata block device." 2019-01-15 19:20:32 +00:00
Wei Wang
abeaa3bc92 Allow lmkd to renice process before killing
Bug: 118468011
Test: mem-pressure test
Change-Id: Icf387a02243af60a3bfffba912711f037669fa7f
2019-01-14 22:52:32 -08:00
chenbruce
fa0e90a368 SEPolicy updates for adding native flag namespace(netd).
am: e3d625b72e

Change-Id: I56ae62db0f0037460974a5632968af5b834515a3
2019-01-14 19:17:45 -08: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
Sandeep Patil
e3ba85c330 Allow init to relabel metadata block device.
In order to boot into GSI, we need init's second-stage block-device
machinery to relable metadata. This will allow it to format / mount
the block device later

Bug: 121209697
Test: device boots

Change-Id: I4e63151767345976b5667df74530cd69fffcfa89
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-01-14 15:10:08 -08:00
Jiwen Cai
992999243e Merge "Allow app to conntect to BufferHub service"
am: 53f5375824

Change-Id: Icc852fa03100c67264e41c9543f7d64386d46c8f
2019-01-14 14:08:05 -08:00
Jeff Vander Stoep
51d92c99b3 runtime_event_log_tags_file: dontaudit map permission
In permissive mode, map denials may occur on
runtime_event_log_tags_file. Suppress.

Fixes: 122803985
Test: build
Change-Id: I4aebd4363091685185e0c5f98895c4a9301b9cfe
2019-01-14 13:01:28 -08:00
Jeff Vander Stoep
6672e2df40 Merge commit '20756085829a0d7d79463eab5a555bf4b0556f1a' into manual_merge_20756085829a0d7d79463eab5a555bf4b0556f1a
Change-Id: Ifd7b4af2c976a81bb84bd95d30261a0e2ef01628
2019-01-14 12:52:27 -08: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
846665fed4 netdomain: allow node_bind for ping sockets
am: 036090d203

Change-Id: I5cf2f70b42c0d833a91c22347ef2072c135a3d95
2019-01-14 09:12:38 -08:00
Jeffrey Vander Stoep
19c8701b8a Merge "netdomain: move to public policy"
am: 75448f8316

Change-Id: Iab295f35f2f095f4f511d3f02239551ba09708b8
2019-01-14 09:12:13 -08: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
Victor Hsieh
756d10a17d Merge "Allow fs-verity setup within system_server"
am: 9c654b7ca1

Change-Id: I51d4677c2f34b252b19faafaf34a9447ab7fe3aa
2019-01-11 22:17:47 -08: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
Tim Van Patten
8d44940ebe Merge "Create System Property to Indicate ANGLE Support"
am: 890186e561

Change-Id: Ic4288982695a72cad5c1212fa1d9b6f51e81c19a
2019-01-11 15:24:11 -08:00
Tim Van Patten
890186e561 Merge "Create System Property to Indicate ANGLE Support" 2019-01-11 22:58:43 +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
Steven Moreland
78bcb0e237 system/etc/event-log-tags available to all
am: b7246ac0b6

Change-Id: I724850c1ecb440d15baca4e9cdda9d19f4a65fa8
2019-01-11 11:02:21 -08:00
Siarhei Vishniakou
f01aeef78c Merge "Permissions for InputClassifier HAL"
am: 1531e72e76

Change-Id: Ic1f5e2815740222e35011738a6f391b5d2222019
2019-01-11 10:54:31 -08: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
Jiyong Park
107897bdce Merge "Allow init to mount on bionic libs and the dynamic linker"
am: 5f49b8dcec

Change-Id: I198489f0a93e278b187f8708922cb5bdda9a2e15
2019-01-11 01:14:42 -08:00
Chalard Jean
bb05d23d63 Add sepolicy for IpMemoryStoreService
am: fb15c9f12f

Change-Id: I43acccc8658c9fade28fe3513f48627d765450d3
2019-01-11 01:13:59 -08:00
Felipe Leme
26f04ff7f2 DO NOT MERGE - Renamed "intelligence" to "content_capture"
This cherry-pick exists to update stage-aosp-master sepolicy
files to look like the ones in master and aosp. It looks like
it was an overlook this patch was merged with DO NOT MERGE
instead of only Merged-In.

Bug: 111276913
Test: manual verification

Merged-In: If76dc7bfdad87789a58fc94e0fd280deae1a41ab
Change-Id: If76dc7bfdad87789a58fc94e0fd280deae1a41ab
(cherry picked from commit 73e7fa884b)
2019-01-11 17:45:42 +09:00
Treehugger Robot
5f49b8dcec Merge "Allow init to mount on bionic libs and the dynamic linker" 2019-01-11 06:27:23 +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
Tim Van Patten
3293abb67f Create System Property to Indicate ANGLE Support
Create the system property ro.gfx.angle.supported that indicates if the
device supports ANGLE.   The current planned use of this property is to
allow CTS to validate ANGLE functionality if the device indicates ANGLE
is supported.

Bug: 80239516
Test: Flash the build and verify the property is 'false' for marlin.
Test: Flash the build and verify the property is 'true' for walleye.
Change-Id: I00387db9ade34152f79d75453ea17d5ea7b063cd
2019-01-10 11:35:58 -07: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
Yabin Cui
0dd15e788a Merge "Add permissions in runas_app domain to debug/profile debuggable apps."
am: cd1c24f323

Change-Id: I11c6f1d25977837b5388de34a3796b7cadcf5ea8
2019-01-09 12:06:09 -08:00
Treehugger Robot
cd1c24f323 Merge "Add permissions in runas_app domain to debug/profile debuggable apps." 2019-01-09 19:48:18 +00:00
Chenbo Feng
1e98efd4c6 Merge "Use bpfloader to create bpf maps instead of netd"
am: a739746990

Change-Id: Iddcc2231c391c512b03dfa9779661518ffec141b
2019-01-09 10:54:27 -08:00
Treehugger Robot
a739746990 Merge "Use bpfloader to create bpf maps instead of netd" 2019-01-09 18:34:49 +00:00
Yabin Cui
770a4f6539 Add permissions in runas_app domain to debug/profile debuggable apps.
runas_app domain is used by lldb/ndk-gdb/simpleperf to debug/profile
debuggable apps. But it misses permissions to ptrace app processes and
read /proc/<app_pid> directory.

Bug: none
Test: build and boot marlin.
Test: run lldb and simpleperf on apps with target sdk version 24-29.
Change-Id: I9e6f940ec81a8285eae8db3b77fb1251a25dedd0
2019-01-09 17:24:31 +00:00
Jiyong Park
b55762da64 Allow init to mount on bionic libs and the dynamic linker
In order to use the bionic libs and the dynamic linker from the runtime
APEX for all processes that are started after the APEX is activated, the
paths /system/lib/{libc.so|libm.so|libdl.so} and /system/bin/linker are
bind-mounted to the corresponding bionic libs and the dynamic linker
in the runtime APEX.

This bind mount allows us to keep other part of the platform and the
tests having implicit assumption that bionic libs are located at
/system/lib and loaded from the default linker namespace.

Bug: 120266448
Test: device boots

Change-Id: Ied611b267d187ee3d75a139c378ee12242d5b8d8
2019-01-09 20:41:41 +09:00
David Anderson
3cbe14c465 Merge "Allow init to symlink userdata during first stage mounting."
am: 39b0b80c34

Change-Id: Iff335fa5d47c7d745625f5c56540b724818ac020
2019-01-08 23:43:22 -08:00
David Anderson
39b0b80c34 Merge "Allow init to symlink userdata during first stage mounting." 2019-01-09 07:37:00 +00:00
Chenbo Feng
7b57104013 Use bpfloader to create bpf maps instead of netd
Recent change in netd and bpfloader switched the creater of bpf maps
from netd to bpfloader. Change the rules related to it to make sure it
doesn't fail.

Test: dumpsys netd trafficcontroller
Bug: 112334572
Change-Id: I016ff68b58ef7b12bdfdebc2fd178be1d0206a62
2019-01-08 10:30:22 -08:00
Joel Galenson
f2cfe86a82 Merge "Allow dumpstate to read some directories."
am: edbe51215e

Change-Id: I4a57c5776f94028ef39e3ab9a25ffd1d830e00ba
2019-01-08 07:46:57 -08:00
Treehugger Robot
edbe51215e Merge "Allow dumpstate to read some directories." 2019-01-08 15:21:06 +00:00
Dario Freni
757484f199 Merge "SEPolicy for Staged Installs."
am: 4d399f606f

Change-Id: Idbec6c32736accd630831d7de420d4bdc66b9d14
2019-01-08 02:03:00 -08:00
Dario Freni
274c1ded4d SEPolicy for Staged Installs.
Test: basic workflow between apexd and PackageManager tested with
changes being developed.
Bug: 118865310
Change-Id: I1ae866f33e9b22493585e108c4fd45400493c7ac
2019-01-07 22:36:28 +00:00
Joel Galenson
886ba9c9ff Allow dumpstate to read some directories.
This prevents denials while taking a bugreport.

Bug: 116711254
Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t
android.security.cts.SELinuxHostTest#testNoBugreportDenials

Change-Id: I64f441eb66c355d03eaf7755f2e9d3e970305ecd
2019-01-07 12:45:56 -08:00
David Anderson
6bde9cf665 Allow init to symlink userdata during first stage mounting.
In order to boot into GSI, we need init's first-stage block-device
machinery to find userdata. This will create its symlink before sepolicy
is loaded, leading to denials in the second stage.

Bug: 121209697
Test: device boots
Change-Id: Ibf3398c811016e09747116cf17393e8d22541bb2
2019-01-03 18:29:58 -08:00
Joel Galenson
153feed9c5 Allow dumpstate to read sysfs_loop files.
am: f0264fe2e9

Change-Id: I7cb5cef74b74e3570a863a05a403c0690372ac99
2019-01-02 11:42:46 -08:00
Joel Galenson
f0264fe2e9 Allow dumpstate to read sysfs_loop files.
This prevents denials while taking a bugreport.

Bug: 116711254
Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t
android.security.cts.SELinuxHostTest#testNoBugreportDenials

Change-Id: Ie190bfa62cf5aa172ebfff8bfd82dea2a7d1a016
2019-01-02 09:23:45 -08:00
Zachary Iqbal
f8be9cf1c0 Added placeholder SELinux policy for the biometric face HAL.
am: 893272d883

Change-Id: I6888b5d3527c396e59b3798d18595e47a3002fde
2018-12-28 12:32:26 -08:00
Zachary Iqbal
893272d883 Added placeholder SELinux policy for the biometric face HAL.
Notes:
- Added face hal domain, context and file types for the default
  SELinux policy.
- Please see aosp/q/topic:"Face+Authentication"

Bug: 80155388
Test: Built successfully.
Change-Id: I2e02cf6df009c5ca476dfd842b493c6b76b7712a
2018-12-28 12:23:56 -08:00
Dario Freni
86acf690de Revert "Add StagingManager service."
am: ca86169422

Change-Id: I114102451c0463d0ccb1db688e60f0baea9ebfb7
2018-12-28 10:25:44 -08:00
Dario Freni
ca86169422 Revert "Add StagingManager service."
This reverts commit 9eb3b8ffdf.

Reason for revert: We are deciding for now not to make StagingManager a fully-fledged binder service, as it will only be accessed by PackageInstaller. We might re-evaluate this decision later if needed.

Bug: 122072686
Change-Id: Ic2a53fc92ddd7d7eeccc6a4a0117f28724346ec7
2018-12-28 12:50:49 +00:00
Dario Freni
35e5027124 Add StagingManager service.
am: 9eb3b8ffdf

Change-Id: I26f5722d645dab805634fcaefa9a0c3ad94a2c93
2018-12-27 10:03:57 -08:00
Dario Freni
9eb3b8ffdf Add StagingManager service.
Adding a new high-level service which will handle staged installs, i.e.
installs that require a reboot.

Bug: 118865310
Test: An initial implementation of StagingManager can be reached
successfully by PackageManagerService and PackageInstallerService.
Change-Id: I8859b463575f8ee85caae43570958347b82f967e
2018-12-27 16:13:24 +00:00
Michael Groover
390270e0fb Merge "Add selinux policy for new SensorPrivacyService"
am: 09c86730b5

Change-Id: I274d9e0bbbc006fdbb5a544ea649eceb3172840f
2018-12-27 08:06:12 -08:00
Michael Groover
09c86730b5 Merge "Add selinux policy for new SensorPrivacyService"
Test: manually verified SensorPrivacyService is accessible
Bug: 110842805
Merged-In: Idd215f338f2da0dab4898ea06fa08d9b4a1bcb5f
Change-Id: Idd215f338f2da0dab4898ea06fa08d9b4a1bcb5f
(cherry picked from commit 0ac3dea71b)
2018-12-27 08:53:15 +00:00
Emilian Peev
67fbfdf793 Merge "sepolicy: Add "rs" and "rs_exec" to public policy"
am: 9c9eb2dfca

Change-Id: I4cc8e1179f65f2f3a881f1bd79d457daf3c299c7
2018-12-21 16:46:22 -08:00
Emilian Peev
a34cfe7b56 sepolicy: Add "rs" and "rs_exec" to public policy
Add "rs" and "rs_exec" types to public policy. Access
to these types might be needed for device specific
customization.

Bug: 121306110
Test: Manual using application
Change-Id: Ief35d3353625adfbf468447de74aa80651dd9451
2018-12-21 17:47:54 +00:00
Florian Mayer
295073f4c6 Merge "Make heapprofd work with MLS."
am: 49ff99ff79

Change-Id: I955e16995786011b4841da5c9d720880807c4408
2018-12-21 09:37:47 -08:00
Florian Mayer
49ff99ff79 Merge "Make heapprofd work with MLS." 2018-12-21 17:27:51 +00:00
Florian Mayer
23e1f4c7d3 Make heapprofd work with MLS.
Arbitrary apps need to connect to heapprofd in order to send samples.

Relevant denial trying to profile com.google.android.inputmethod.latin
on userdebug:

12-20 14:50:20.420 25219 25219 I heapprofd: type=1400 audit(0.0:1006): avc: denied { read } for path="/proc/24819/mem" dev="proc" ino=244219 scontext=u:r:heapprofd:s0 tcontext=u:r:untrusted_app_27:s0:c133,c256,c512,c768 tclass=file permissive=1

Bug: 121370989

Test: m
Test: flash walleye
Test: profile com.google.android.inputmethod.latin

Change-Id: Iee82c8c49951e5a5726cd5ab0b9e8fa71226c802
2018-12-21 15:25:01 +00:00
Remi NGUYEN VAN
4d75750f98 Add selinux policies for network stack service
am: 47c2dee5c2

Change-Id: I01235f3e048c7149ff741bbb7563da999e98e415
2018-12-20 16:46:47 -08:00
Remi NGUYEN VAN
5b586461ca Merge "sepolicy changes for network stack app"
am: 41b6263007

Change-Id: I1fb6a0729528895a500af70b83144c966b1037ee
2018-12-20 16:41:37 -08:00
Remi NGUYEN VAN
47c2dee5c2 Add selinux policies for network stack service
The policies allow the system server to register a network_stack_service
used to communicate with the network stack process.

Test: atest FrameworksNetTests
Bug: b/112869080
Change-Id: Ib9b7d9150fe4afcce03c8b3dbb36b81c67e39366
2018-12-21 00:09:50 +00:00
Remi NGUYEN VAN
41b6263007 Merge "sepolicy changes for network stack app" 2018-12-21 00:06:39 +00:00
Todd Kennedy
13a7dff211 Merge "Open permission manager service to the world"
am: 7e06c56154

Change-Id: Ia9af8732ec45f665b49f2a7087d10774e0ff7111
2018-12-20 13:44:21 -08:00
Treehugger Robot
7e06c56154 Merge "Open permission manager service to the world" 2018-12-20 21:36:13 +00:00
Sudheer Shanka
7468da2948 Allow vold to create files at /mnt/user/.*
am: f0abbf9798

Change-Id: If2b369aa5a913f2bb17335d51b9457cb7aa07fe5
2018-12-20 13:24:02 -08:00
Sudheer Shanka
f0abbf9798 Allow vold to create files at /mnt/user/.*
Bug: 121099965
Test: manual
Change-Id: I940868eb984399763d7346a201e37cb07fb12333
2018-12-20 12:01:54 -08:00
Todd Kennedy
2ec0388564 Open permission manager service to the world
There are many permission related APIs currently handled by the
package manager service. These are simply pass throughs from the
package manager service to an internal API defined by the
permission manager service. Instead of this multi-hop, we want
to open the permission manager service directly to apps. For
legacy, we won't be able to remove the APIs from PackageManager,
but, the implementation should go directly to the Permission
Manager Service.

Test: System boots w/o selinux denials
Change-Id: I1d953077b3da18ccf44deb85b9084be68a2179bd
2018-12-20 07:54:23 -08:00
Martijn Coenen
11ac1ed2dd Merge "Allow apexd to write to sysfs loop device parameters."
am: 36f93d0339

Change-Id: I2301afff86aa59e600641a5e7f2af863f1e0730d
2018-12-20 00:07:16 -08:00
Martijn Coenen
36f93d0339 Merge "Allow apexd to write to sysfs loop device parameters." 2018-12-20 07:53:08 +00:00
Remi NGUYEN VAN
5f3ba92c61 sepolicy changes for network stack app
The networking stack app hosts services that used to be in the system
server (IpClient, NetworkMonitor for now), but in a different process to
be packaged as a mainline module.

Test: booted, verified networking stack working when in app
Change-Id: I300a556f51b35c17378af961cea1ec937444e597
2018-12-20 12:05:31 +09:00
Yao Chen
d31cae1585 Merge "Allow statsd to write stats log events to perfd(running as shell) via pipes."
am: 2ec03cb5cb

Change-Id: Ie9f3f66cedc3628a045ed467cb70970969d7877c
2018-12-19 18:39:55 -08:00
Treehugger Robot
2ec03cb5cb Merge "Allow statsd to write stats log events to perfd(running as shell) via pipes." 2018-12-20 02:31:11 +00:00
Martijn Coenen
d7bf9218a0 Allow apexd to write to sysfs loop device parameters.
To configure read-ahead on loop devices, eg.
/sys/devices/virtual/block/loop0/queue/read_ahead_kb

Bug: 120776455
Test: configuring read-ahead on loop devices works from apexd
Change-Id: Ib25372358e8ca62fa634daf286e4b64e635fac58
2018-12-20 03:05:50 +01:00
Nick Kralevich
4aa9123f1b Merge "Ensure that hwservice_manager adds / finds make sense."
am: f21085ca29

Change-Id: Ie17c0cd5bddf23e0890a8fecbbe29e755d6203d3
2018-12-19 17:47:20 -08:00
Treehugger Robot
f21085ca29 Merge "Ensure that hwservice_manager adds / finds make sense." 2018-12-20 01:33:44 +00:00
Nick Kralevich
2c9fca3127 Merge "Ensure that service_manager adds / finds make sense."
am: c2be630c3a

Change-Id: I590206e3de5fb68d19d7ed9f3c03d2589b80c2da
2018-12-19 16:57:04 -08:00
Nick Kralevich
db43ee04eb Ensure that hwservice_manager adds / finds make sense.
Add a neverallow rule asserting that services registered or queried
through hwservicemanager must have the attribute hwservice_manager_type.
Attempting to add or query a service which does not have that
attribute is malformed policy.

Test: compiles
Change-Id: Ib498508694f478c396f2d9273abaccbff06975e6
2018-12-19 14:24:26 -08:00
Nick Kralevich
5f154404de Ensure that service_manager adds / finds make sense.
Add a neverallow rule asserting that services registered or queried
through servicemanager must have the attribute service_manager_type
or vndservice_manager_type. Attempting to add or query a service which
does not have one of those attributes is malformed policy.

See
https://android-review.googlesource.com/c/platform/system/sepolicy/+/826500/7/private/system_server.te#696
as an example where this occurred.

Test: compiles
Change-Id: I339bde04b80819b07832d96797fd7f477a4b676a
2018-12-19 13:44:22 -08:00
Yao Chen
e1d250891c Allow statsd to write stats log events to perfd(running as shell) via pipes.
Bug: 120921905
Test: locally tested
Change-Id: I23fda0f83daff8765f7946814a61588dac00c85a
2018-12-18 15:58:50 -08:00
Chong Zhang
fd59441275 Merge "Use hidl memory from allocator in CAS"
am: 490cbfdbd3

Change-Id: Ic6c910d263d6f372bcde186d266e1813e61774a4
2018-12-18 12:31:43 -08:00
Winson Chung
2a7cd0d1ea resolve merge conflicts of ac1a0a7bf5 to stage-aosp-master
Bug: None
Test: I solemnly swear I tested this conflict resolution.

Change-Id: I360ce12f33e333766f6f30614c87811d05e663a4
Merged-In: Ic0b3f85fad24ccedc0a8e9935c198bc8503bb415
2018-12-18 17:47:03 +00:00
Treehugger Robot
490cbfdbd3 Merge "Use hidl memory from allocator in CAS" 2018-12-18 05:34:20 +00:00
Winson Chung
ac1a0a7bf5 Adding policy for content suggestions.
Bug: 120865921
Test: Manual verification
Change-Id: Ic0b3f85fad24ccedc0a8e9935c198bc8503bb415
2018-12-18 00:30:34 +00:00
Chong Zhang
404e40c6c1 Use hidl memory from allocator in CAS
Make mediaextractor use hidl memory allocated by
hidl allocator, instead of constructing hidl memory
from IMemory.

bug: 112766913
bug: 111407253
Change-Id: I7902f18768005c995925bc9a7947299e9988b68a
(Needed for internal commit I39e131718ea41f9cb23177c28213ddf7b7741338)
2018-12-17 22:49:18 +00:00
Florian Mayer
2aae20137b Merge "Allow to signal perfetto from shell."
am: b209cb9670

Change-Id: I1cab94e3aff6fdb2502b40d275c413b24469205f
2018-12-17 14:10:40 -08:00
Treehugger Robot
b209cb9670 Merge "Allow to signal perfetto from shell." 2018-12-17 22:00:45 +00:00
Stan Iliev
82abb5bcce Merge "Add a property used to enable Vulkan as default render pipeline"
am: 5ca7847a87

Change-Id: Ie384653b732f3ea5d59c23388297a3ec8a8817a0
2018-12-17 13:31:38 -08:00
Treehugger Robot
5ca7847a87 Merge "Add a property used to enable Vulkan as default render pipeline" 2018-12-17 21:04:31 +00:00