Commit graph

30159 commits

Author SHA1 Message Date
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
Hasini Gunasinghe
4334d35f01 Add keystore permission for metrics re-routing.
Keystore2 atoms need to be rounted to statsd via a proxy.
The proxy needs to have this permission in order to pull metrics from
keystore.

Ignore-AOSP-First: No mergepath to AOSP.
Bug: 188590587
Test: Statsd Testdrive script
Change-Id: Ic94f4bb19a08b6300cfd2d3ed09b31d5b7081bfd
Merged-In: Ic94f4bb19a08b6300cfd2d3ed09b31d5b7081bfd
(cherry picked from commit 61d07e7ce0)
2021-06-30 17:02:14 -07:00
rnlee
b6142ecc22 Add sepolicy SF native boot namespace.
Following go/android-native-flag-api-manual.

Bug: 190769260
Test: make.
Change-Id: I84fe7e9d046fbbe737f09043589b19e71981f521
2021-06-30 14:07:44 -07:00
Janis Danisevskis
4678660d83 Rename vpnprofilestore to legacykeystore.
Bug: 191373871
Test: N/A
Merged-In: I3f11827909bd37a2127069de82670776a8e192b3
Change-Id: I3f11827909bd37a2127069de82670776a8e192b3
2021-06-30 12:40:39 -07:00
Treehugger Robot
81a677b948 Merge "Add vehicle_binding_util SELinux context" 2021-06-30 18:44:00 +00:00
Jooyung Han
4b8ece3683 Allow the kernel to read shell_data_file
In ApexTestCases, a temp file in /data/local/tmp is used via a loop
device, which requires the kernel to read it.

This is only allowed in userdebug/eng.

Bug: 192259606
Test: ApexTestCases
Change-Id: Ic7d3e67a8a3e818b43b7caead9053d82cbcbccf7
2021-07-01 00:04:41 +09:00
Nikita Ioffe
ed3407eaac Allow otapreopt_chroot to call otadexopt binder service
Before otapreopt_script was indirectly interacting with otadexopt binder
service via `shell cmd otadexopt` interface, but now the interaction is
moved to otapreopt_chroot binary to reduce amount of times we need to
run this binary.

For more context see: aosp/1750143.

Test: m
Bug: 190223331
Change-Id: Ib32cbbbf8f3bd9b5c1b696e39f776631ae60d712
2021-06-30 15:37:05 +01:00
Paul Hobbs
f6fc9377ad Revert "untrusted_app_30: add new targetSdk domain"
Revert "Ignore SELinux denials for all untrusted_app domains"

Revert "Update tests to check RTM_GETNEIGH{TBL} restrictions"

Revert submission 1748045-getneigh-enable-restrictions

Reason for revert: Breaks android.net.netlink.NetlinkSocketTest#testBasicWorkingGetNeighborsQuery with permissions error.

Bug: 192406650

Reverted Changes:
Iea29a1b36:Ignore SELinux denials for all untrusted_app domai...
I14b755020:Update tests to check RTM_GETNEIGH{TBL} restrictio...
I32ebb407b:untrusted_app_30: add new targetSdk domain
I8598662b7:libsepol: trigger new RTM_GETNEIGH{TBL} behavior

Change-Id: I525544191520607fdd238b5ac55aa5132f679253
2021-06-30 07:41:39 +00:00
Bram Bonné
55badc22c1 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

Change-Id: I32ebb407b8dde1c872f53a1bc3c1ec20b9a5cb49
2021-06-29 17:50:22 +02:00