Commit graph

17905 commits

Author SHA1 Message Date
Suren Baghdasaryan
6155b2fd11 sepolicy for vendor cgroups.json and task_profiles.json files
Vendors should be able to specify additional cgroups and task profiles
without changing system files. Add access rules for /vendor/etc/cgroups.json
and /vendor/etc/task_profiles.json files which will augment cgroups and
task profiles specified in /etc/cgroups.json and /etc/task_profiles.json
system files. As with system files /vendor/etc/cgroups.json is readable
only by init process. task_profiles.json is readable by any process that
uses cgroups.

Bug: 124960615
Change-Id: I12fcff0159b4e7935ce15cc19ae36230da0524fc
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-03-01 00:32:15 +00:00
David Anderson
753225ce9c Merge "Allow system_server and shell to start gsid on-demand." 2019-02-28 22:08:10 +00:00
Tri Vo
e8cb09db42 Merge "ashmem: expand app access" 2019-02-28 22:00:50 +00:00
Treehugger Robot
412cc87475 Merge "Fix CTS neverallow violation." 2019-02-28 21:52:44 +00:00
Tri Vo
9fbc87c89f ashmem: expand app access
We are only interested in removing "open" access from apps, so leave
apps with (rw_file_perms - open) permissions to /dev/ashmem

Bug: 126627315
Test: emulator boots without denials to /dev/ashmem
Change-Id: I7f03fad5e4e82aebd1b6272e4956b16f86043637
2019-02-28 10:47:35 -08:00
Andreas Gampe
4c2d06c458 Sepolicy: Add base runtime APEX postinstall policies
Add art_apex_postinstall domain that is allowed to move
precreated AoT artifacts from /data/ota.

Bug: 125474642
Test: m
Change-Id: Id674e202737155a4ee31187f096d1dd655001fdd
2019-02-28 09:24:17 -08:00
David Anderson
64bbf05150 Allow system_server and shell to start gsid on-demand.
gsid is started lazily to reduce memory pressure. It can be started
either via gsi_tool (invoked by adb shell), or by DynamicAndroidService
via system_server.

Bug: 126622385
Test: no denials running "gsi_tool status"
Change-Id: I90a5f3f28fe4f294fb60e7c87a62e76716fbd5c0
2019-02-28 07:54:25 -08:00
Andreas Gampe
57346a0566 Sepolicy: Add runtime APEX preinstall fsverity permissions
Add rights to create and install fsverity data.

Bug: 125474642
Test: m
Change-Id: I752c40c7b396b2da082cb17641702a2c5c11b9c3
2019-02-28 05:12:56 -08:00
Andreas Gampe
ae127d8340 Sepolicy: Add base runtime APEX preinstall policies
Add art_apex_preinstall domain that is allowed to create AoT
artifacts in /data/ota.

Bug: 125474642
Test: m
Change-Id: Ia091d8df34c4be4f84c2052d3c333a0e36bcb036
2019-02-28 05:12:56 -08:00
Joel Galenson
a92753538f Fix CTS neverallow violation.
Fixes: 126604492
Test: Build userdebug and user.
Test: Test
android.cts.security.SELinuxNeverallowRulesTest#testNeverallowRules129
on userdebug.

Change-Id: I0716e566570114878842644339401331513bae22
2019-02-27 19:33:11 -08:00
Kevin Rocard
83f65ebbb2 Allow audioserver to access the package manager
This can not be done from the system server as there are native API that
do not go through it (aaudio, opensles).

Test: adb shell dumpsys media.audio_policy | grep -i 'Package manager'
Bug: 111453086
Signed-off-by: Kevin Rocard <krocard@google.com>
Change-Id: I0a4021f76b5937c6191859892fefaaf47b77967f
2019-02-28 01:50:22 +00:00
Tri Vo
7eb9143e46 Merge "Neverallow app open access to /dev/ashmem" 2019-02-28 00:02:14 +00:00
Tri Vo
c67a1ff8d9 Merge "Decouple system_suspend from hal attributes." 2019-02-27 21:25:27 +00:00
Tri Vo
8b12ff5f21 Neverallow app open access to /dev/ashmem
Apps are no longer allowed open access to /dev/ashmem, unless they
target API level < Q.

Bug: 113362644
Test: device boots, Chrome, instant apps work
Change-Id: I1cff08f26159fbf48a42afa7cfa08eafa1936f42
2019-02-27 21:17:25 +00:00
Alan Stokes
1c8b376f81 Merge "Audit execution of app_data_file by untrusted_app." 2019-02-27 21:07:19 +00:00
Alan Stokes
931623e5b9 Audit execution of app_data_file by untrusted_app.
Test: Builds
Bug: 126536482
Change-Id: I9fe7623353cbb980db3853a8979f03ba033c7f45
2019-02-27 18:07:09 +00:00
Andreas Gampe
025cab88ab Merge changes I6a76eba4,Iff1ecabc
* changes:
  Sepolicy: Move dex2oat and postinstall_dexopt to private
  Sepolicy: Move dac_override checks to private
2019-02-27 16:56:52 +00:00
Nikita Ioffe
53c0743d79 Merge "Allow apexd to reboot device" 2019-02-27 08:49:32 +00:00
Tri Vo
a532088e7f Decouple system_suspend from hal attributes.
System suspend service is not a HAL, so avoid using HAL-specific macros
and attributes.

Use system_suspend_server attribute for ISystemSuspend.hal permissions.
Use system_suspend type directly for internal .aidl interface
permissions.

Bug: 126259100
Test: m selinux_policy
Test: blueline boots; wakelocks can still be acquired; device suspends
if left alone.
Change-Id: Ie811e7da46023705c93ff4d76d15709a56706714
2019-02-26 18:10:28 -08:00
Andreas Gampe
6d5baca452 Sepolicy: Move dex2oat and postinstall_dexopt to private
In preparation for additions that should be private-only, move the
types to private. Both have to be moved as they are dependent.

Bug: 125474642
Test: m
Change-Id: I6a76eba41b036bc6fb83588adbe9d63767d3e159
2019-02-26 13:13:45 -08:00
Andreas Gampe
f77bcdcf57 Sepolicy: Move dac_override checks to private
In preparation for moving other components to private, so that
private-only components can stay private.

Bug: 125474642
Test: m
Change-Id: Iff1ecabc4f45051d06e062b3338a117c09b39ff9
2019-02-26 13:12:05 -08:00
Nick Kralevich
68e27caeb6 allow shell rs_exec:file rx_file_perms
Hostside tests depend on being able to execute /system/bin/bcc. Allow
it.

From bug:

In the NDK:

  $ ./checkbuild.py
  $ virtualenv -p ../out/bootstrap/bin/python3 env
  $ source env/bin/activate
  $ ./run_tests.py --filter rs-cpp-basic
  FAIL rs-cpp-basic.rstest-compute [armeabi-v7a-19]: android-28 marlin HT67L0200247 QPP1.190205.017
  New RS 0xee70f000
  Segmentation fault

  FAIL rs-cpp-basic.rstest-compute [arm64-v8a-21]: android-28 marlin HT67L0200247 QPP1.190205.017
  New RS 0x7a91e13000
  Segmentation fault

  02-23 23:00:45.635  9516  9518 V RenderScript: Successfully loaded runtime: libRSDriver_adreno.so
  02-23 23:00:45.650  9518  9518 W rstest-compute: type=1400 audit(0.0:15): avc: denied { read } for name="bcc" dev="dm-0" ino=390 scontext=u:r:shell:s0 tcontext=u:object_r:rs_exec:s0 tclass=file permissive=0
  02-23 23:00:45.651  9516  9518 E RenderScript: Cannot open file '/system/bin/bcc' to compute checksum
  02-23 23:00:45.652  9516  9516 E rsC++   : Internal error: Object id 0.

Test: compiles
Fixes: 126388046
Change-Id: I28e591d660c4ba9a33135e940d298d35474ef0b6
2019-02-26 13:09:28 -08:00
Treehugger Robot
4108c665a1 Merge "Game Driver: allow statsd to ask gpuservice for stats" 2019-02-26 18:26:19 +00:00
Bo Hu
67bce94bd4 Merge "adbd: do not audit vsock_socket create" 2019-02-26 17:10:11 +00:00
Nikita Ioffe
cfe7f7b2ab Allow apexd to reboot device
In some scenarios (native watchdog finding a regression, apexd failing
to mount apexes), a rollback of apexd will be triggered which requires
device reboot.

Bug: 123622800
Test: manually triggered apexd rollback and verified it reboots phone
Change-Id: I4c5d785a69dd56a63348c75c1897601749db9bc5
2019-02-26 13:29:22 +00:00
Nicolas Geoffray
c8cb42e27d Allow installd to access device_config_runtime_native_boot_prop.
Test: m && boot
Bug: 119800099
Change-Id: I3d9c48b9474ed68c98cf65110ed9375a2c4c8aa1
2019-02-26 08:56:57 +00:00
Treehugger Robot
8f96c9fd67 Merge "Allow mediametrics to log records to statsd" 2019-02-26 08:40:42 +00:00
Ray Essick
7438ec0497 Allow mediametrics to log records to statsd
to integrate mediametrics' upload scheme into statsd transport/mechanism.

Bug: 118782504
Test: statsd test harness
Change-Id: I95bf4d2a5c257e4b9001d832f775032f4daeb5bb
2019-02-25 20:09:54 -08:00
Treehugger Robot
5946759331 Merge "Fix dl.exec_linker* tests" 2019-02-26 03:08:38 +00:00
Treehugger Robot
9ad7758c2e Merge "bug_map: remove tracking for b/79414024" 2019-02-26 00:08:18 +00:00
Nick Kralevich
905b4000cb Fix dl.exec_linker* tests
The dl.exec_linker* tests verify that the linker can invoked on an
executable. That feature still works, but not with the default
shell user, which is required for the CTS bionic tests.

Addresses the following denial:

audit(0.0:5493): avc: denied { execute_no_trans } for path="/bionic/bin/linker64" dev="loop3" ino=25 scontext=u:r:shell:s0 tcontext=u:object_r:system_linker_exec:s0 tclass=file permissive=0

Bug: 124789393
Test: compiles
Change-Id: I77772b2136fae97174eeba6542906c0802fce990
2019-02-25 15:11:40 -08:00
bohu
7c84772382 adbd: do not audit vsock_socket create
BUG: 123569840
Change-Id: I8f2b1dc05a0aef07ea5662b4febcbc3bc6f6a882
2019-02-25 14:55:27 -08:00
Hridya Valsaraju
da446bf952 Merge "Fastbootd must be able to erase logical partitions" 2019-02-25 21:54:45 +00:00
Jeff Vander Stoep
c37f2e854c bug_map: remove tracking for b/79414024
It was fixed in change  If630b53d32c3c0414939b1f8db8d486406003567.

Fixes: 79414024
Test: build
Change-Id: I33f749f370ae83581ac28cbefe42ba764da57cdd
2019-02-25 12:25:25 -08:00
shafik
9f8ff76e35 Allow installd to delete directories in staging dir
In order to support deleting session files after a staged session reaches
a final state, installd will need to delete the session directories from
/data/staging.

Bug: 123624108
Test: triggered 2 flows in which a staged session reaches a final state
and made sure installd can delete the session files

Change-Id: I76a7d4252d1e033791f67f268cf941672c5e6a3a
2019-02-25 12:02:20 +00:00
Yiwei Zhang
0b4b3e4d60 Game Driver: allow statsd to ask gpuservice for stats
Bug: 123529932
Test: adb shell cmd stats pull-source <GpuStats source ID>
Change-Id: Idbe34b598c611322468d5fe2162311a72175e574
2019-02-25 01:10:49 -08:00
Treehugger Robot
3e7ad0b081 Merge "Add ro.surface_flinger.display_primary*" 2019-02-25 01:02:34 +00:00
Andreas Gampe
2a9eaecf9a Sepolicy: Clean up moved files
Coalesce statements to clean up policies.

Test: m
Change-Id: I3794d6bf1bce04e700d2d8e3365249cf75bd527d
2019-02-22 08:36:41 -08:00
Andreas Gampe
4abfe60215 Sepolicy: Move some parts from public to private
Those should not have been public before, but were forced to by
old neverallow rules.

Test: m
Change-Id: If8430b9c8d42b7cbcd28bbfbc79d579c69067edd
2019-02-22 05:11:08 -08:00
Andreas Gampe
63c7b0fa18 Sepolicy: Move dalvik cache neverallow to private
In preparation for additions that should be private-only, move
the neverallows to domain's private part.

Bug: 125474642
Test: m
Change-Id: I7def500221701500956fc0b6948afc58aba5234e
2019-02-22 05:11:08 -08:00
Treehugger Robot
cac127c8fd Merge "Add sysfs_extcon for /sys/class/extcon" 2019-02-22 07:42:33 +00:00
Hridya Valsaraju
1912daf6a9 Fastbootd must be able to erase logical partitions
This CL adds permissions to allow fastbootd to erase
logical partitions.

[   33.423370] c5    587 audit: type=1400 audit(2073228.303:11): avc:  denied  { ioctl } for
pid=587 comm="fastbootd" path="/dev/block/dm-0" dev="tmpfs" ino=25433 ioctlcmd=0x127d
scontext=u:r:fastbootd:s0 tcontext=u:object_r:dm_device:s0 tclass=blk_file permissive=0^M
[   33.446927] c5    587 audit: type=1400 audit(2073228.326:12): avc:  denied  { ioctl }
for  pid=587 comm="fastbootd" path="/dev/block/dm-0" dev="tmpfs" ino=25433 ioctlcmd=0x1277
scontext=u:r:fastbootd:s0 tcontext=u:object_r:dm_device:s0 tclass=blk_file permissive=0^M

Test: fastboot erase system
Bug: 125391557

Change-Id: I0c99db123ed5357ceb7e16e192042e8e044e3557
2019-02-21 12:36:28 -08:00
Tri Vo
877fe9dea6 audit apps opening /dev/ashmem
Bug: 113362644
Test: boot device
Test: use Chrome app, no audit logs
Change-Id: I6c78c7ac258a4ea90d501a152b5c9e7851afcf08
2019-02-21 11:43:20 -08:00
Nick Chalko
4ccc8568ec Add sysfs_extcon for /sys/class/extcon
Bug: 124364409
Change-Id: Idc33732454674bbdc7f4ff6eda173acc24e318b3
Test: cherry picked to pi-tv-dr-dev and tested on JBL Link bar
2019-02-21 17:16:34 +00:00
Treehugger Robot
ba1be2c4bb Merge "Allow shell /proc/loadavg access" 2019-02-21 01:32:22 +00:00
Sundong Ahn
88bb57ec88 Add ro.surface_flinger.display_primary*
The ro.surface_flinger.display_primary* 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: 124531214
Test: m -j && boot test
Change-Id: If90c4bc75796d8966bbf3ee2e3bab39145395800
2019-02-21 09:54:13 +09:00
Daniel Rosenberg
f63fe72142 Allow postinstall scripts to trigger F2FS GC
Test: Add checkpoint_gc to postinstall scripts
Bug: 123367711
Change-Id: I24a0bd1c2c2086545f1587765bb9814da24ec7f2
2019-02-20 22:40:53 +00:00
Daniel Rosenberg
46c50683d6 Add Label to f2fs sysfs files
Test: ls -lZ /sys/fs/f2fs
Bug: 123367711
Change-Id: I0035feb8409b7ec8e11510795fb7d8845992694e
2019-02-20 22:40:40 +00:00
Nick Kralevich
28e4b83ec7 Allow shell /proc/loadavg access
Needed for the bionic stdlib.getloadavg test.

Access to /proc/loadavg was inadvertantly removed when a new label was
assigned to that file in system/sepolicy commit
8c2323d3f9.

Addresses the following denial:

  CtsBionicTestCa: type=1400 audit(0.0:188192): avc: denied { read } for name="loadavg" dev="proc" ino=4026531959 scontext=u:r:shell:s0 tcontext=u:object_r:proc_loadavg:s0 tclass=file permissive=0

Bug: 124024827
Test: compiles
Change-Id: Iadb5c98cb96f69ddc9418a64720370adae1bb51f
2019-02-20 13:56:52 -08:00
David Anderson
8bcd43a33e Merge "Add sepolicy for gsid properties, and allow system_server to read them." 2019-02-20 19:49:01 +00:00