Commit graph

30267 commits

Author SHA1 Message Date
Andrew Walbran
ae84b86799 virtualizationservice will clear its own temporary directory.
This means that toolbox doesn't need permission to delete it.

Bug: 192917795
Bug: 193365943
Test: flashed on a VIM3L and booted
Change-Id: Ic0182c1c4eb84eb94f4db27d00effcd906ebed09
2021-07-14 16:56:51 +00:00
Alan Stokes
01ac33d74a Merge "Add policy for CompOS APEX data files." 2021-07-14 10:00:15 +00:00
sunny.kuo
1535fbb0b0 Allow Zygote to unmount labeledfs
As "/storage/emulated/0/Android/obb, /storage/emulated/0/Android/data" might be labeledfs (f2fs),
Zygote needs to be allowed to unmount labeledfs while unmounting "/storage".

Here's the warning if we do not add it.
avc: denied { unmount } for scontext=u:r:zygote:s0 tcontext=u:object_r:labeledfs:s0 tclass=filesystem permissive=0

Bug:192989523
Test:adb shell stop; adb shell start; check no warning log
Change-Id: I74ce9bed29ec7da536a261a4fea25628f3d382ef
2021-07-14 10:09:20 +08:00
Paul Duffin
df49b3846f Merge "Stop using deprecated functionality for managing path deps" 2021-07-13 22:35:50 +00:00
David Anderson
00edd4b095 Merge "Fix e2fsck denials introduced by latest e2fsprogs merge." 2021-07-13 18:39:31 +00:00
David Anderson
8a525d768f Fix e2fsck denials introduced by latest e2fsprogs merge.
This resulted from changes in e2fsprogs logic which traverses
/proc/mounts to warn about fixing a mounted filesystem.

Denials:

        07-08 15:08:21.207   853   853 I auditd  : type=1400 audit(0.0:88): avc: denied { getattr } for comm="e2fsck" path="/metadata" dev="vda12" ino=2 scontext=u:r:fsck:s0 tcontext=u:object_r:metadata_file:s0 tclass=dir permissive=0
        07-08 15:08:21.207   853   853 I auditd  : type=1400 audit(0.0:89): avc: denied { search } for comm="e2fsck" name="/" dev="tmpfs" ino=1 scontext=u:r:fsck:s0 tcontext=u:object_r:mirror_data_file:s0 tclass=dir permissive=0

Bug: 193137337
Test: treehugger
Change-Id: Ib050463f7fa6ea453795c933ff388d3594bb7c23
2021-07-13 10:17:30 -07:00
Alan Stokes
10fbf239b8 Add policy for CompOS APEX data files.
Grant access to odsign to read & delete pending key files. Eventually
we will grant the CompOS daemon write access.

Bug: 190166662
Test: Via odsign; no denials seen.
Change-Id: I6d3c3e5b2aec8ef65bd28cbb274d18263534ce66
2021-07-13 15:35:53 +01:00
Treehugger Robot
4fea2f0e16 Merge "Refactor apex data file types." 2021-07-13 08:12:36 +00:00
Treehugger Robot
34df8fb682 Merge "Update default VHAL name in selinux policy." 2021-07-13 02:13:36 +00:00
Macpaul Lin
641c5ae99d Add FUNCTIONFS_ENDPOINT_ALLOC to ioctl_defines and mediaprovider.te
We've got a SELinux warning in kernel-5.10 when "File Transfer" (MTP)
has been enabled by user.

Error log:
avc: denied { ioctl } for  pid=5521 comm="MtpServer" path="/dev/usb-ffs/mtp/ep1" dev="functionfs" ino=102677 ioctlcmd=0x67e7 scontext=u:r:mediaprovider:s0:c512,c768 tcontext=u:object_r:functionfs:s0 tclass=file permissive=0

Repeat steps:
  1. Connect the phone to PC with USB cable.
  2. Select "File Transfer" (MTP) in "USB Preferences" Menu.
  3. Selinux warning will arise after "File Transfer" has been enabled by user
     due to an IOCTL access to /dev/usb-ffs/mtp/ep1.

Solution:
  To solve this warning, add a sepolicy to allow this type of IOCTL is required.

Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Change-Id: Id340fb98062b3cee239343f3800f6dfceadeb572
Bug: 193473440
2021-07-13 09:33:15 +08:00
Hasini Gunasinghe
39f81c11d6 Merge "Allow keystore to read and write keystore.crash_count system property." 2021-07-12 19:00:16 +00:00
Jiyong Park
d76c98182c Merge "Allow virtualizationservice to use vsock" 2021-07-12 18:00:57 +00:00
Alan Stokes
fa10a14fac Refactor apex data file types.
We ended up with 4 labels for specific APEX files that were all
identical; I've replaced them with a single one
(apex_system_server_data_file).

Additionally I created an attribute to be applied to a "standard" APEX
module data file type that establishes the basics (it can be managed
by vold_prepare_subdirs and apexd), to make it easier to add new such
types - which I'm about to do.

Fix: 189415223
Test: Presubmits
Change-Id: I4406f6680aa8aa0e38afddb2f3ba75f8bfbb8c3c
2021-07-12 14:41:04 +01:00
Thiébaud Weksteen
145a91ff9c Merge "Allow llkd to stat() /proc/sysrq-trigger" 2021-07-12 08:20:19 +00:00
Jiyong Park
f408371097 Allow virtualizationservice to use vsock
... to connect to the programs running in the guest VM

Bug: 192904048
Test: atest MicrodroidHostTestCases
Change-Id: Iccb48c14ace11cc940bb9ab1e07cc4926182e06e
2021-07-12 15:08:08 +09:00
Paul Duffin
532bde121b Stop using deprecated functionality for managing path deps
This change stops using deprecated functionality and migrates this
repository's custom Soong code to support current practices to manage
path property related dependencies. i.e. when a property includes
something that looks like ":module".

ExtractSourcesDeps has been deprecated in favor of tagging properties
with `android:"path"` which will cause the pathDepsMutator to add the
dependencies automatically.

android.SourceDepTag has been deprecated as the underlying type needs
to be changed and this will no longer work for its current uses.

* ctx.GetDirectDepWithTag(moduleName, android.SourceDepTag) will not
  work to retrieve a reference to the module dependency added for
  path properties. GetModuleFromPathDep(ctx, moduleName, "") must be
  used instead.

* depTag == android.SourceDepTag can no longer be used to check to
  see if depTag was used to add a module dependency for a module
  reference in a path property without any output tag.
  IsSourceDepTagWithOutputTag(depTag, "") must be used instead.

Bug: 193228441
Test: m nothing
Change-Id: I307039612f0f2a541ac7dbfddd052ef78c290f60
2021-07-09 23:15:17 +01:00
Orion Hodson
2abf1e293b Add get_prop(odsign_prop) to incidentd.te
Prevents SELinux denial when capturing a bugreport.

Bug: 192895524
Bug: 193084909
Bug: 193096842
Bug: 193097008
Bug: 193097511
Bug: 193097845
Bug: 193097886
Test: adb bugreport and check no denial in logcat.
Change-Id: Ide5d95782929836cffc5b3921bffae3295773532
2021-07-09 14:54:27 +01:00
Hasini Gunasinghe
4fa6b1a037 Allow keystore to read and write keystore.crash_count system property.
Additionally, remove the obsolete permission which allows keystore to
register callbacks with statsd. There's no direct communication between
keystore and statsd now.

Ignore-AOSP-First: No mergepath to AOSP.
Bug: 188590587
Test: statsd TestDrive script.
Merged-In: I31d202751ba78bb547822020260a7e366cb8826e

Change-Id: I31d202751ba78bb547822020260a7e366cb8826e
2021-07-08 17:54:58 +00:00
Bram Bonné
c1d9d9a85c Merge "untrusted_app_30: add new targetSdk domain" 2021-07-08 11:01:41 +00:00
Rachel Lee
a455a1f6f0 Merge "Fix sepolicy get_prop for SF namespace." 2021-07-07 23:08:49 +00:00
Nikita Ioffe
1b5255dc91 Merge "Revert "Allow otapreopt_chroot to call otadexopt binder service"" 2021-07-07 13:40:43 +00:00
Andrew Walbran
a91240f691 Merge "Allow virtualizationservice and crosvm to access shell_data_file files." 2021-07-07 12:48:07 +00:00
Andrew Walbran
9b2fa1b94a Allow virtualizationservice and crosvm to access shell_data_file files.
This is necessary to run tests or run VMs manually with SELinux
enforcement enabled.

Bug: 192256642
Test: atest VirtualizationTestCases
Change-Id: I03b12fefa4e79644bd2f3410cc255f923834aca4
2021-07-07 11:11:19 +00:00
Nikita Ioffe
7c808247a7 Revert "Allow otapreopt_chroot to call otadexopt binder service"
Revert submission 1750144-otapreopt_chroot_speed_up

Reason for revert: Breaks postinstall step on some devices
Reverted Changes:
I56dec13c8:Add ota_dexopt_aidl_interface
Ib32cbbbf8:Allow otapreopt_chroot to call otadexopt binder se...
I02e80a8e6:Move otadexopt-related logic to otapreopt_chroot b...

Bug: 190817237
Change-Id: I96e02566779cf16626354b0d71e6d48f2ab35490
2021-07-06 17:06:22 +00:00
Treehugger Robot
cb83d70584 Merge "Add persist.nfc property" 2021-07-06 08:05:46 +00:00
Treehugger Robot
e838fe2681 Merge "Allow odsign to rename apex_art_data_file:dir" 2021-07-05 11:49:15 +00:00
Bram Bonné
ea5460ab6e untrusted_app_30: add new targetSdk domain
Enforce new requirements on app with targetSdkVersion=32 including:
- No RTM_GETNEIGH on netlink route sockets.
- No RTM_GETNEIGHTBL on netlink route sockets.

Bug: 171572148
Test: atest NetworkInterfaceTest
Test: atest bionic-unit-tests-static
Test: atest CtsSelinuxTargetSdkCurrentTestCases
Test: atest CtsSelinuxTargetSdk30TestCases
Test: atest CtsSelinuxTargetSdk29TestCases
Test: atest CtsSelinuxTargetSdk28TestCases
Test: atest CtsSelinuxTargetSdk27TestCases
Test: atest CompatChangesSelinuxTest
Test: atest NetlinkSocketTest
Change-Id: I2167e6cd564854c2656ee06c2202cfff2b727af5
2021-07-05 11:42:31 +02:00
Orion Hodson
829f582107 Merge "Allow app_zygote to read zygote_tmpfs." 2021-07-05 09:10:23 +00:00
Treehugger Robot
6ab599ec46 Merge "allow init to access watermark_boost_factor" 2021-07-04 08:16:08 +00:00
Yu Shan
d70654bdf9 Update default VHAL name in selinux policy.
Test: Presubmit
Bug: 192276902
Change-Id: I0851826f69b22a06830b40c72c7e9fa720810053
2021-07-02 18:04:11 -07:00
Rachel Lee
e0cbab2d4d Fix sepolicy get_prop for SF namespace.
Bug: 190769260
Test: make.
Change-Id: I5d86beaa392b009d0aae37c7a3dd7f90e7cf5f70
2021-07-02 16:31:13 -07:00
Treehugger Robot
8ea29cd4de Merge "Allow the kernel to read shell_data_file" 2021-07-02 19:13:46 +00:00
Yabin Cui
e43222e19b Merge changes Ia2defe72,Icef1ebdd
* changes:
  allow simpleperf to profile more app types.
  simpleperf_app_runner: move rules to private.
2021-07-02 16:37:38 +00:00
Treehugger Robot
59c063b866 Merge "Allow AudioServer find for mediaprovider_app" 2021-07-02 15:04:11 +00:00
Orion Hodson
57907a87dc Allow app_zygote to read zygote_tmpfs.
app_zygote inherits tmpfs files from zygote, and needs to be able to
stat them after fork.

Bug: 192634726
Bug: 192572973
Bug: 119800099
Test: manually configure JIT zygote and run
 atest \
   CtsExternalServiceTestCases:\
   android.externalservice.cts.ExternalServiceTest\
   #testBindExternalServiceWithZygote
Change-Id: I401808c984edd4e3e4ef335f6a75cecc5cf69eca
2021-07-02 14:36:00 +00:00
Nikita Ioffe
1f1db28719 Merge "Allow otapreopt_chroot to call otadexopt binder service" 2021-07-02 14:20:12 +00:00
Thiébaud Weksteen
40dd3b3004 Allow llkd to stat() /proc/sysrq-trigger
06-26 20:01:16.860   971   971 I auditd  : type=1400 audit(0.0:8): avc: denied { getattr } for comm="llkd" path="/proc/sysrq-trigger" dev="proc" ino=4026532062 scontext=u:r:llkd:s0 tcontext=u:object_r:proc_sysrq:s0 tclass=file permissive=0

Bug: 192305350
Test: Build for aosp_arm64-eng
Change-Id: Ia6342ebc974f469e0e5d5e2f527d870c8a686b87
2021-07-02 15:55:38 +02:00
Alan Stokes
b7fb7ae7c2 Allow odsign to rename apex_art_data_file:dir
This is needed to allow us to promote pending artifacts from compos to
active, otherwise we get:

odsign  : Can't rename /data/misc/apexdata/com.android.art/pending to /data/misc/apexdata/com.android.art/dalvik-cache: Permission denied
odsign  : type=1400 audit(0.0:9): avc: denied { rename } for name="pending" dev="dm-35" ino=14965 scontext=u:r:odsign:s0 tcontext=u:object_r:apex_art_data_file:s0 tclass=dir permissive=0

Test: Manual, running modified odsign with (bogus) pending artfiacts
Bug: 190166662
Change-Id: I3efafa62d3444f967c0b5eab5516a00daf64f8ef
2021-07-02 11:49:43 +01:00
Orion Hodson
0b8ab878b4 Merge "Allow zygotes and installd to read odsign properties" 2021-07-02 10:19:45 +00:00
Andrew Walbran
3e85e8e5a5 Merge "Allow more permissions for removing VirtualizationService data directory." 2021-07-02 09:34:42 +00:00
Sahana Rao
21d69b1222 Allow AudioServer find for mediaprovider_app
As part of PhotoPicker, we will be playing the video. To allow video
playback, allow AudioServer `find` access for mediaprovider_app.

Bug: 169737802
Test: Verified that video playback works in PhotoPicker
Change-Id: Ie5acb77b2f446ee8af6cf384fd5a66bf64a15752
2021-07-02 10:23:04 +01:00
Orion Hodson
f135ce393c Allow zygotes and installd to read odsign properties
Bug: 192049377
Test: manual
Change-Id: I88cfd0b7fa63f195a1ec8f498c106cbf95f649ec
2021-07-01 14:18:51 +01:00
Hasini Gunasinghe
3e20b2895f Merge "Add keystore permission for metrics re-routing." 2021-07-01 12:30:08 +00:00
Treehugger Robot
0aab569bd3 Merge "seapp_contexts: Remove unused selectors" 2021-07-01 10:44:49 +00:00
Andrew Walbran
dc5f1a90db Allow more permissions for removing VirtualizationService data directory.
Bug: 192506182
Bug: 184131523
Test: mm
Change-Id: I40c94f124d55508d038346d7dd3234cad428819a
2021-07-01 10:12:03 +00:00
Jeff Vander Stoep
35779f082f seapp_contexts: Remove unused selectors
These have never been used in AOSP. Looking at ~10,000 Android
build images confirms that these are not used elsewhere within
the Android ecosystem.

Bug: 192532348
Test: build (failures here would be at build-time)
Change-Id: I787b14b531df31fbb9995156eb2e84719b7c90da
2021-07-01 10:51:12 +02:00
Martin Liu
4db56b0b52 allow init to access watermark_boost_factor
Bug: 189938926
Test: boot
Signed-off-by: Martin Liu <liumartin@google.com>
Change-Id: I07c8490c94c837952921e95f12efa6213edbf056
2021-07-01 12:24:52 +08:00
Rachel Lee
cf8f6ef363 Merge "Add sepolicy SF native boot namespace." 2021-07-01 01:05:22 +00:00
Yabin Cui
26de4c4ecc allow simpleperf to profile more app types.
So simpleperf can profile these apps when they are marked to be
profileable/debuggable.

Bug: 192404394
Test: build and run simpleperf to profile com.android.systemui.
Change-Id: Ia2defe725a8fafbcb6c2d20e771b343d8822ccbc
2021-06-30 17:24:05 -07:00
Yabin Cui
41a18f5bf3 simpleperf_app_runner: move rules to private.
Bug: 192404394
Test: build
Change-Id: Icef1ebdd59668b31a07ac0a5aea30a87eac1da45
2021-06-30 17:24:05 -07:00