Commit graph

7268 commits

Author SHA1 Message Date
Ytai Ben-Tsvi
c71b2c18cc Allow audioserver to access sensorservice
This is required for accessing sensor data in audioserver.

Bug: 188502620
Test: log-based verification of sensor data coming through.
Change-Id: I183ce5106401ae7853096e80a8650cc7919e6221
2021-09-08 11:44:11 -07:00
Alan Stokes
8d90131012 Merge "SEPolicy for compos_verify_key." am: d1ac340034
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1818452

Change-Id: I22c4c3ed09c2db1ee66f524b9ca1d5e4c26c0b91
2021-09-06 08:08:49 +00:00
Alan Stokes
d1ac340034 Merge "SEPolicy for compos_verify_key." 2021-09-06 07:55:58 +00:00
Bart Van Assche
5ebe643596 Add the 'bdev_type' attribute to all block device types am: d05534f3d5
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1816979

Change-Id: If14fc996690a70802f3e5ed4e807fc966de4d783
2021-09-03 22:28:44 +00:00
Alan Stokes
39f497013c SEPolicy for compos_verify_key.
Remove some allow rules for odsign, since it no longer directly
modifies CompOs files. Instead allow it to run compos_verify_key in
its own domain.

Grant compos_verify_key what it needs to access the CompOs files and
start up the VM.

Currently we directly connect to the CompOs VM; that will change once
some in-flight CLs have landed.

As part of this I moved the virtualizationservice_use macro to
te_macros so I can use it here. I also expanded it to include
additional grants needed by any VM client that were previously done
for individual domains (and then deleted those rules as now
redundant).

I also removed the grant of VM access to all apps; instead we allow it
for untrusted apps, on userdebug or eng builds only. (Temporarily at
least.)

Bug: 193603140
Test: Manual - odsign successfully runs the VM at boot when needed.
Change-Id: I62f9ad8c7ea2fb9ef2d468331e26822d08e3c828
2021-09-03 16:31:02 +01:00
Bart Van Assche
d05534f3d5 Add the 'bdev_type' attribute to all block device types
The following patch iterates over all block devices:
https://android-review.googlesource.com/c/platform/system/core/+/1783847/9

The following patch grants 'init' and 'apexd' permission to iterate over
all block devices:
https://android-review.googlesource.com/c/platform/system/sepolicy/+/1783947

The above SELinux policy change requires to add the 'bdev_type'
attribute to all block devices. Hence this patch.

Bug: 194450129
Test: Untested.
Change-Id: I706285544f348944ca0c24e031b7c4e1052ec390
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-09-02 10:13:16 -07:00
Treehugger Robot
3367996656 Merge "allow installd to kill dex2oat and dexoptanalyzer" am: 4442c1f7eb
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1798367

Change-Id: I8412c792979bc2a4f1aadb41016bdc210621d924
2021-09-01 17:24:58 +00:00
Treehugger Robot
4442c1f7eb Merge "allow installd to kill dex2oat and dexoptanalyzer" 2021-09-01 17:11:23 +00:00
Roshan Pius
fbfb4a8b89 Allow uwb HAL client/server to talk to service manager am: 3015324460
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1811079

Change-Id: Ia652e5350fd0cf86ad8648a04c4d27f50bd06c50
2021-08-28 00:26:44 +00:00
Roshan Pius
3015324460 Allow uwb HAL client/server to talk to service manager
Denial logs:
08-27 21:43:18.716   801   801 W android.hardwar: type=1400 audit(0.0:4): avc:
denied { call } for scontext=u:r:hal_uwb_default:s0 tcontext=u:r:servicemanager:s0
tclass=binder permissive=0

Bug: 195308730
Test: Bootup default UWB HAL implementation on cuttlefish & verify UCI stack
can talk to the HAL.

Change-Id: I493af52513fd5b8f89d1375f80226ffa10c34f48
2021-08-28 00:01:59 +00:00
Ankita Vyas
e0d6c3604f Merge "Add selinux changes for Locale Manager Service" am: 7ac013be94
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1810459

Change-Id: Idd51d097ffd18b7e0f4c47e4e83221d24b787b94
2021-08-27 04:13:38 +00:00
Ankita Vyas
7ac013be94 Merge "Add selinux changes for Locale Manager Service" 2021-08-27 03:59:42 +00:00
Treehugger Robot
209b78ab83 Merge "sepolicy: Change UWB HAL from HIDL to versioned AIDL" am: d7fc7bd30b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1809163

Change-Id: I423431ce2bee07fd3c2a968f4c59799b17fa71c6
2021-08-27 01:55:54 +00:00
Roshan Pius
7076dfaa4f Merge "sepolicy: Add UWB HAL interface in AOSP" am: ea6c84b560
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1808158

Change-Id: I8168654bf875acbec024e8a2d144cbfb0486ef17
2021-08-27 00:37:05 +00:00
Roshan Pius
cd8333b53a sepolicy: Change UWB HAL from HIDL to versioned AIDL
No new HIDL HAL's are allowed in Android T. UWB HAL converted to
versioned AIDL interface to be compliant.

Bug: 195308730
Test: Compiles
Change-Id: I35cf8edd244baa02778ee8eff46840ae26424869
2021-08-27 00:28:56 +00:00
“Ankita
623ece0386 Add selinux changes for Locale Manager Service
Test: build and booted device

Bug: 194094788

Change-Id: Ic3c1f135985a5003ed07a8da9dbd7a3f8b61ae71
2021-08-26 14:33:24 +00:00
Roshan Pius
37ee61f663 sepolicy: Rename hal_uwb -> hal_uwb_vendor
Since we are now creating an AOSP HAL for uwb. Rename Pixel specific
internal UWB HAL from Android S to hal_uwb_vendor to avoid conflicts
with the AOSP HAL sepolicy rules that are going to be added in
Android T.

Android S Architecture:
|Apps | AOSP API | Vendor Service | Vendor HAL Interface | Vendor HAL
Implementation | Vendor driver/firmware

Android T Architecture:
|Apps | AOSP API | AOSP Service | AOSP HAL Interface | Vendor HAL
Implementation | Vendor driver/firmware

Ignore-AOSP-First: Dependent changes in internal-only projects.

Bug: 195308730
Test: Compiles
Change-Id: I7bf4794232604372134ea299c8e2a6ba14a801d3
Merged-In: I7bf4794232604372134ea299c8e2a6ba14a801d3
(cherry picked from commit 40465250e4)
(cherry picked from commit 27ab309fad)
2021-08-26 05:20:39 +00:00
Roshan Pius
8a5370c5e4 sepolicy: Add UWB HAL interface in AOSP
Adding sepolicy rules for the AOSP HAL interface.

Ignore-AOSP-First: Dependent changes in internal-only projects.

Bug: 195308730
Test: Compiles
Change-Id: I56302b570a749f7d72b6fe8f4f4a8767ea4785c1
Merged-In: I56302b570a749f7d72b6fe8f4f4a8767ea4785c1
2021-08-24 20:10:21 -07:00
Roshan Pius
65e938e539 sepolicy: Rename hal_uwb -> hal_uwb_vendor
Since we are now creating an AOSP HAL for uwb. Rename Pixel specific
internal UWB HAL from Android S to hal_uwb_vendor to avoid conflicts
with the AOSP HAL sepolicy rules that are going to be added in
Android T.

Android S Architecture:
|Apps | AOSP API | Vendor Service | Vendor HAL Interface | Vendor HAL
Implementation | Vendor driver/firmware

Android T Architecture:
|Apps | AOSP API | AOSP Service | AOSP HAL Interface | Vendor HAL
Implementation | Vendor driver/firmware

Ignore-AOSP-First: Dependent changes in internal-only projects.

Bug: 195308730
Test: Compiles
Change-Id: I7bf4794232604372134ea299c8e2a6ba14a801d3
Merged-In: I7bf4794232604372134ea299c8e2a6ba14a801d3
2021-08-24 20:10:06 -07:00
Keith Mok
e3ace79b18 Merge "Revert "crash_dump: supress denials for files in /proc"" am: 97935f4898
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1789807

Change-Id: Ic2f8920b0c49fb19e70184395da7afb7e55d1f8e
2021-08-23 16:27:48 +00:00
Keith Mok
97935f4898 Merge "Revert "crash_dump: supress denials for files in /proc"" 2021-08-23 16:15:20 +00:00
Suren Baghdasaryan
a3152de04d Merge "Allow init to execute extra_free_kbytes.sh script" am: ce8e066761
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1782248

Change-Id: I53559bd04d3e65dec4ee2187636677e91ededc27
2021-08-17 19:24:23 +00:00
Suren Baghdasaryan
ce8e066761 Merge "Allow init to execute extra_free_kbytes.sh script" 2021-08-17 19:17:59 +00:00
Eric Biggers
2b7e9943d9 Merge "Restore permission for shell to list /sys/class/block" am: cc0f64416f
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1797007

Change-Id: I60b12f2a7cb088b8e648149d9356f9b00f97adbe
2021-08-17 19:17:07 +00:00
Suren Baghdasaryan
6988677f22 Allow init to execute extra_free_kbytes.sh script
extra_free_kbytes.sh is used by init to set /sys/vm/watermark_scale_factor
value. Allow init to execute extra_free_kbytes.sh and the script to access
/proc/sys/vm/watermark_scale_factor and /proc/sys/vm/extra_free_kbytes
files.

Bug: 109664768
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I55ec07e12a1cc5322cfdd4a48d0bdc607f45d832
2021-08-17 17:02:38 +00:00
Keun young Park
d577958598 allow installd to kill dex2oat and dexoptanalyzer
Bug: 179094324
Bug: 156537504

Test: confirm that installd killing those processes are not brininging
      selinux violation
Change-Id: Icac3f5acc3d4d398bbe1431bb02140f3fe9cdc45
2021-08-17 09:48:47 -07:00
Eric Biggers
8b2b951349 Restore permission for shell to list /sys/class/block
As a side effect, commit ec50aa5180 ("Allow the init and apexd
processes to read all block device properties") removed permission for
the shell context to list the /sys/class/block directory.  There is a
CTS test that relies on this (CtsNativeEncryptionTestCases), so grant
permission to do this again.

Bug: 196521739
Bug: 194450129
Test: Before this change, 'adb shell ls /sys/class/block' fails.
      After this change, 'adb shell ls /sys/class/block' succeeds.
Change-Id: I87cb90880f927db1385887b35c84f4dd7f95021b
2021-08-16 10:54:44 -07:00
Arthur Ishiguro
cfa6d86d50 Context Hub stable AIDL sepolicy am: e1ced2f4d8 am: 779c996ebd
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1792668

Change-Id: Icdfb36f33e59953f6f13eb9901803ff61d2d4c90
2021-08-11 03:28:18 +00:00
Arthur Ishiguro
e1ced2f4d8 Context Hub stable AIDL sepolicy
Bug: 194285834
Test: TreeHugger
Change-Id: I88675f7f61821619abbff87fa5ee321836745324
2021-08-10 22:06:43 +00:00
Keith Mok
0e486b6c6f Merge "Allow crash_dump to read uptime" am: 6e9494af08 am: 1f349fd8a9
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1789687

Change-Id: Ifa0f57b9200743166aa20ce3ee9bbd0aa96bc8b7
2021-08-10 07:45:19 +00:00
Keith Mok
6e9494af08 Merge "Allow crash_dump to read uptime" 2021-08-10 07:25:46 +00:00
Jiyong Park
047e5af29b Merge "Don't prevent crosvm from accessing vendor-owned VM disk images" am: 11d2b1c5c9 am: 88e069900e
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1789271

Change-Id: I06bef31e792e6f8c6e6745e9281dbaf518674016
2021-08-10 01:54:59 +00:00
Bart Van Assche
7efcbf568c Allow the init and apexd processes to read all block device properties am: ec50aa5180 am: b00618fb9f
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1783947

Change-Id: Iac344ff86cae6870c6f29fc2b4fb5529482a4219
2021-08-10 01:54:52 +00:00
Jiyong Park
11d2b1c5c9 Merge "Don't prevent crosvm from accessing vendor-owned VM disk images" 2021-08-10 01:34:08 +00:00
Bart Van Assche
ec50aa5180 Allow the init and apexd processes to read all block device properties
Addressing b/194450129 requires configuring the I/O scheduler and the
queue depth of loop devices. Doing this in a generic way requires
iterating over the block devices under /sys/class/block and also to
examine the properties of the boot device (/dev/sda). Hence this patch
that allows 'init' and 'apexd' to read the properties of all block
devices. The patch that configures the queue depth is available at
https://android-review.googlesource.com/c/platform/system/core/+/1783847.

Test: Built Android images, installed these on an Android device and verified that modified init and apexd processes do not trigger any SELinux complaints.
Change-Id: Icb62449fe0d21b3790198768a2bb8e808c7b968e
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-09 13:46:41 -07:00
Jiyong Park
3fee5a43c1 Don't prevent crosvm from accessing vendor-owned VM disk images
There can be VM disk images that are specific to the underlying SoC.
e.g. in case where SoC-specific hardware is dedicated to a VM and the VM
needs drivers (or HALs) for the hardware.

Don't prevent crosvm from reading such a SoC-specific VM disk images.

Note that this doesn't actually allow crosvm to do that in AOSP. Such an
allow rule could be added in downstreams where such use cases exist.

Bug: 193605879
Test: m
Change-Id: If19c0b6adae4c91676b142324c2903879548a135
2021-08-09 11:13:54 +09:00
Keith Mok
c3e42c0034 Revert "crash_dump: supress denials for files in /proc"
This reverts commit bd247bc88a.

Bug: 193159611
Bug: 183575981
Test: manual

Change-Id: Id79f623d7aa759862a519411f95ab364e9916f6b
2021-08-07 18:01:21 +00:00
Keith Mok
a03659044b Allow crash_dump to read uptime
crash_dump need to read process uptime
which need to be calc by minus the system uptime

Bug: 193159611
Bug: 183575981
Test: manual
Change-Id: I9f071007f31b8101d2d67db19b5d2b2835e6c5a4
2021-08-07 17:59:54 +00:00
Rick Yiu
e7d3b3d499 Merge "Move vendor_sched to common sepolicy" am: 2e8a281466 am: 2daa7d932b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1781205

Change-Id: Ic0104cc1606286dba5066dceea8b66c75f4480f0
2021-07-30 04:11:22 +00:00
Rick Yiu
2e8a281466 Merge "Move vendor_sched to common sepolicy" 2021-07-30 03:47:38 +00:00
Rick Yiu
b31ec34eef Move vendor_sched to common sepolicy
Previously vendor_sched is put under product area which will be replaced
by GSI. To solve it, move it to system/sepolicy.

Bug: 194656257
Test: build pass
Change-Id: Ia0b855e3a876a58b58f79b4fba09293419797b47
2021-07-30 03:01:32 +00:00
Linzhao Ye
b2abee1922 Merge "Add SeLinux policy for hostapd AIDL service." am: f023c126fc am: ded1063fd2
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1781487

Change-Id: Id5fd54b83225a7e7caa5d3c102dff6a68753cdbd
2021-07-29 16:42:16 +00:00
Linzhao Ye
f023c126fc Merge "Add SeLinux policy for hostapd AIDL service." 2021-07-29 16:12:41 +00:00
Chris Ye
b7bb89b551 Add SeLinux policy for hostapd AIDL service.
Bug: 194806512
Test: Manual test wifi hotspot.
Change-Id: I12b3e93650fcc6f2ea8794970fa8cf62c0a82475
2021-07-28 23:37:46 -07:00
David Anderson
8429ed5bdf Merge "Add new snapuserd socket and property rules." am: f595435798 am: f9d4e5003b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1778706

Change-Id: Ie1d65724b6b8e4e3cfb2413bd7838c27c310559c
2021-07-28 22:25:06 +00:00
David Anderson
bf5b6ce422 Add new snapuserd socket and property rules.
This adds a new property prefix owned by snapuserd, for communicating
when the service is ready to accept connections (snapuserd.ready and
snapuserd.proxy_ready).

This also adds a new socket context. This is a seqpacket socket used to
communicate with a special instance of snapuserd that bridges to the
first-stage daemon.

Bug: 193833730
Test: no denials after OTA applies and boots
Change-Id: Ibad03659eba5c25e205ba00f27d0b4f98585a84b
2021-07-27 10:50:59 -07:00
Hongguang
e6b51cec20 Allow Tuner AIDL sample HAL. am: 2179e112e1 am: cc12e7bf00
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1760683

Change-Id: I66bb1ec1efe05f6e0725fb25c09984cbc33c7bd7
2021-07-26 22:17:05 +00:00
Hongguang
2179e112e1 Allow Tuner AIDL sample HAL.
Bug: 191825295
Test: tuner HAL can run
Change-Id: I069da68cb4fec535c6549a9a0f89202eb17ef003
2021-07-26 11:35:18 -07:00
Jiyong Park
c9996ffadd Merge "Add rules for virtualizationservice and crosvm" am: d59b429b63 am: cf84b7571b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1763405

Change-Id: Ie906fccde2e3e120627d780fe6c4eaa215068f7d
2021-07-26 13:58:07 +00:00
Jiyong Park
d59b429b63 Merge "Add rules for virtualizationservice and crosvm" 2021-07-26 13:25:39 +00:00
Jiyong Park
5e20d83cfb Add rules for virtualizationservice and crosvm
The test for the services has been running with selinux disabled. To
turn selinux on, required rules are allowed.

Below is the summary of the added rules.

* crosvm can read the composite disk files and other files (APKs,
APEXes) that serve as backing store of the composite disks.
* virtualizationservice has access to several binder services
  - permission_service: to check Android permission
  - apexd: to get apex files list (this will be removed eventually)
* Both have read access to shell_data_file (/data/local/tmp/...) for
testing purpose. This is not allowed for the user build.
* virtualizationservice has access to the pseudo terminal opened by adbd
so that it can write output to the terminal when the 'vm' tool is
invoked in shell.

Bug: 168588769
Test: /apex/com.android.virt/bin/vm run-app --log /dev/null
/data/local/tmp/virt/MicrodroidDemoApp.apk
/data/local/tmp/virt/MicrodroidDemoApp.apk.idsig
/data/local/tmp/virt/instance.img
assets/vm_config.json

without disabling selinux.

Change-Id: I54ca7c255ef301232c6e8e828517bd92c1fd8a04
2021-07-26 10:45:08 +09:00
Kalesh Singh
a51fc2334e Merge changes from topic "suspend-aidl-1" am: 792d519b56 am: 7929a9faa8
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1772909

Change-Id: I81ddd1984dff94fe62c89e65fe375996a7141ed4
2021-07-23 21:25:42 +00:00
Kalesh Singh
21baa7a9cd sepolicy: Serve suspend AIDL hal from system_suspend am: 0e903620a5 am: 599387666b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1772908

Change-Id: I4d55e0a02f283fd1405d406cddf0a967fd5d4528
2021-07-23 21:25:40 +00:00
Joel Galenson
406090c009 Merge "Correctly alphabetize a newly-added ioctl definition." am: d055774b74 am: 03300f05ab
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1774790

Change-Id: I455ef4562da245f5d22dbd265f5ca30310d80e12
2021-07-23 21:25:29 +00:00
Kalesh Singh
599387666b sepolicy: Serve suspend AIDL hal from system_suspend am: 0e903620a5
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1772908

Change-Id: If424997bdb78a1b14b78b6ffcaf0d7f3cc2c8380
2021-07-23 20:56:44 +00:00
Kalesh Singh
792d519b56 Merge changes from topic "suspend-aidl-1"
* changes:
  sepolicy: Update wakelock_use macro
  sepolicy: Serve suspend AIDL hal from system_suspend
2021-07-23 17:16:28 +00:00
Joel Galenson
6dd5117864 Correctly alphabetize a newly-added ioctl definition.
Thanks to nnk for noticing this!

Test: Build
Change-Id: I3d6e5b223aabcf3ec93dc62112fc194af13e6a60
2021-07-22 09:38:53 -07:00
Kalesh Singh
d86bcd1dfd sepolicy: Update wakelock_use macro
Update wakelock_use macro to allow requesting wakelocks from system
supend AIDL hal.

Bug: 170260236
Test: boot; Check logcat for avc denials
Change-Id: I43b69cd39b3f1c858b3f0133ea317800b796fd9c
2021-07-21 00:03:36 +00:00
Kalesh Singh
0e903620a5 sepolicy: Serve suspend AIDL hal from system_suspend
Allow system_suspend to server the suspend AIDL hal service.

Bug: 170260236
Test: Check logcat for supend avc denials
Change-Id: Ie4c07e2e8d75fd4b12e55db15511060e09be59cf
2021-07-20 18:54:55 +00:00
Joel Galenson
998299d40a Merge "Add FUNCTIONFS_ENDPOINT_ALLOC to ioctl_defines and mediaprovider.te" am: 6d20ea2095 am: da51d74a17
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1762745

Change-Id: Iaa012198476ce0249ffd9bc492faf58e90baa186
2021-07-20 15:39:47 +00:00
Joel Galenson
6d20ea2095 Merge "Add FUNCTIONFS_ENDPOINT_ALLOC to ioctl_defines and mediaprovider.te" 2021-07-20 15:11:58 +00:00
Treehugger Robot
ce3a4de8d8 Merge "Add TARE service to SE policy." am: 9daeadb31e am: ba23828e12
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1766506

Change-Id: I7498a860b4dae6e1f5c4e4b4cd38fe700794558b
2021-07-17 02:03:39 +00:00
Kweku Adams
988d073012 Add TARE service to SE policy.
Bug: 158300259
Test: adb shell dumpsys tare
Change-Id: I30c11631110d6bc4f291357dda639449aa9c39d3
2021-07-14 10:25:14 -07:00
David Anderson
7adb8aa5cb Merge "Fix e2fsck denials introduced by latest e2fsprogs merge." am: 00edd4b095 am: d2a3b73672
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1764018

Change-Id: Ia26f8c4b013b10ec34b8cd85939f9fbcbc88427e
2021-07-13 19:15:57 +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
Treehugger Robot
7406fa45c1 Merge "Refactor apex data file types." am: 4fea2f0e16 am: cafed410aa
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1763205

Change-Id: I47fec594b7f8af80f46c15c4502105e9b8836211
2021-07-13 08:48:26 +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
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
Bram Bonné
3f36b24504 Merge "untrusted_app_30: add new targetSdk domain" am: c1d9d9a85c am: 86943d839a
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1752122

Change-Id: I243310bb512309a3bf0cb3dc0267cec78e430925
2021-07-08 11:41:10 +00:00
Bram Bonné
c1d9d9a85c Merge "untrusted_app_30: add new targetSdk domain" 2021-07-08 11:01:41 +00:00
Treehugger Robot
01bfd5d032 Merge "Add persist.nfc property" am: cb83d70584 am: 41ac67c619
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1733494

Change-Id: I2b3d1c2374533b3f5946a735e8e359ad12d624a2
2021-07-06 08:52:25 +00:00
Treehugger Robot
cb83d70584 Merge "Add persist.nfc property" 2021-07-06 08:05:46 +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
Treehugger Robot
2422d8c87d Merge "allow init to access watermark_boost_factor" am: 6ab599ec46 am: c74f64278b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1753820

Change-Id: I2f71652ec00855267ac02fc239d9a4af96c5b127
2021-07-04 08:42:17 +00:00
Treehugger Robot
6ab599ec46 Merge "allow init to access watermark_boost_factor" 2021-07-04 08:16:08 +00:00
Treehugger Robot
2614dd1bbe Merge "Allow the kernel to read shell_data_file" am: 8ea29cd4de am: d2c7fb074b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1752600

Change-Id: Ie6b38ae5aef42b658ca9440e72f9856dde982e3e
2021-07-02 19:38:24 +00:00
Treehugger Robot
8ea29cd4de Merge "Allow the kernel to read shell_data_file" 2021-07-02 19:13:46 +00:00
Yabin Cui
5edae0da4d Merge changes Ia2defe72,Icef1ebdd am: e43222e19b am: 93bb35adf9
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1753148

Change-Id: Ia74495af553bf3977d14ae0c62e0730f70f1d6b8
2021-07-02 16:59:13 +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
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
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
Janis Danisevskis
e1a289b66f Merge "Rename vpnprofilestore to legacykeystore." into sc-dev am: adb49d3df6
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/14981212

Change-Id: Ie341418b9491cd93e2af1ebe354f943e8ff85499
2021-06-30 19:57:20 +00: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
Janis Danisevskis
ab433c765b Rename vpnprofilestore to legacykeystore.
Ignore-AOSP-First: No mergepath from AOSP.
Bug: 191373871
Test: N/A
Change-Id: I3f11827909bd37a2127069de82670776a8e192b3
2021-06-30 09:36:30 -07: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
Hasini Gunasinghe
7611870f49 Merge "Add keystore permission for metrics re-routing." into sc-dev am: 898fc5b39b
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/14937250

Change-Id: I881b239515d17f81099ed16d519e1071e80c68ea
2021-06-30 13:32:33 +00:00
Hasini Gunasinghe
898fc5b39b Merge "Add keystore permission for metrics re-routing." into sc-dev 2021-06-30 13:07:22 +00:00
Paul Hobbs
2dec873de0 Revert "untrusted_app_30: add new targetSdk domain" am: f6fc9377ad am: dc26e38e21
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1750189

Change-Id: I1a771e26fca7a9ec98f5434918416eb9dcb3a961
2021-06-30 08:18:40 +00: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é
040fa575e0 untrusted_app_30: add new targetSdk domain am: 55badc22c1 am: d9fea8c063
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1728087

Change-Id: I7ff99f17fcf264e071e42dc65e6df5779ac744d4
2021-06-29 19:24:52 +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
Treehugger Robot
ec30c418f9 Merge "Extend hal_uwb_server neverallow" 2021-06-29 05:22:39 +00:00
Thiébaud Weksteen
d631804671 Merge "Add fusefs_type for FUSE filesystems" am: 53ef2e85e2 am: 93749a5278
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1742996

Change-Id: I927bec927c8d531c59820c46cb280b700c64ced4
2021-06-28 13:03:20 +00:00
Thiébaud Weksteen
53ef2e85e2 Merge "Add fusefs_type for FUSE filesystems" 2021-06-28 12:39:58 +00:00
Thiébaud Weksteen
9ec532752d Add fusefs_type for FUSE filesystems
Any FUSE filesystem will receive the 'fuse' type when mounted. It is
possible to change this behaviour by specifying the "context=" or
"fscontext=" option in mount().

Because 'fuse' has historically been used only for the emulated storage,
it also received the 'sdcard_type' attribute. Replace the 'sdcard_type'
attribute from 'fuse' with the new 'fusefs_type'. This attribute can be
attached on derived types (such as app_fusefs).

This change:
- Remove the neverallow restriction on this new type. This means any
  custom FUSE implementation can be mounted/unmounted (if the correct
  allow rule is added). See domain.te.
- Change the attribute of 'fuse' from 'sdcard_type' to 'fusefs_type'.
  See file.te.
- Modify all references to 'sdcard_type' to explicitly include 'fuse'
  for compatibility reason.

Bug: 177481425
Bug: 190804537
Test: Build and boot aosp_cf_x86_64_phone-userdebug
Change-Id: Id4e410a049f72647accd4c3cf43eaa55e94c318f
2021-06-28 13:18:46 +02:00
Michael Ayoubi
07aa892503 Extend hal_uwb_server neverallow
Bug: 187386527
Test: Boot and confirm HAL is up

Signed-off-by: Michael Ayoubi <mayoubi@google.com>
Change-Id: I2abf108f2504997b06c0269f905608d8063cb3b4
Merged-In: I2abf108f2504997b06c0269f905608d8063cb3b4
2021-06-28 03:10:49 +00:00
Michael Ayoubi
c3af66222b Extend hal_uwb_server neverallow
Bug: 187386527
Test: Boot and confirm HAL is up
Signed-off-by: Michael Ayoubi <mayoubi@google.com>
Change-Id: I2abf108f2504997b06c0269f905608d8063cb3b4
Merged-In: I2abf108f2504997b06c0269f905608d8063cb3b4
2021-06-25 17:31:09 +09:00
Treehugger Robot
757bfdfa04 Merge "Allow keymint to access tee-device" 2021-06-24 18:38:40 +00:00
TreeHugger Robot
bf5c56e796 Merge "sepolicy: Allow to receive FDs from app_zygote" into sc-dev 2021-06-24 17:48:21 +00:00
Egor Pasko
271e63bbd0 sepolicy: Allow to receive FDs from app_zygote
The primary goal is to have an ashmem region shared between the main app
process in Chrome (=Browser Process) and the app zygote. It can only be
passed from the App Zygote, since there is no communication in the other
direction. Passing of the file descriptor should happen by:
(A) inheriting via fork(2)
(B) using binder IPC

Currently ashmem FDs are sufficiently allowed to be mmap(2)-ed in all
Chrome processes. The mode of mapping (read-only, read-write etc.) is
controlled by the settings of the region itself, not by sepolicy.

This change additionally allows an FD created in the app zygote to be
passed to the 'untrusted_app' domain.

Note: This change allows *any* FD, not just an ashmem one to be passed.
This is on purpose: in the future we will likely want to return to the
memfd story.  Other usecases (pipes, sockets) might appear.

The app zygote preload takes the responsibility not to share
capabilities in the form of FDs unintentionally with other app
processes.

Historical note: we tried to enable this for memfd (using additional
rules), but it required a 'write' permission when sending an FD. Reasons
for that are still puzzling, and there seems to be no easy workaround
for it. Decision: use ashmem.

Bug: 184808875
Test: Manual: Build and install Chrome (trichrome_chrome_google_bundle)
      from [1]. Make sure FileDescriptorAllowlist allows the FD, like
      [2]. Reach a NewTabPage, click on a suggested page, observe no
      errors related to binder transactions and selinux violations.

[1] A change in Chrome to create an ashmem region during app zygote
    preload and pass it to the browser process:
    https://crrev.com/c/2752872/29

[2] Allowlist change in review:
     https://android-review.googlesource.com/c/platform/frameworks/base/+/1739393
    (Alternatively: Remove gOpenFdTable checks in ForkCommon() in
    com_android_internal_os_Zygote.cpp)

Change-Id: Ide085f472c8fb6ae76ab0b094319d6924552fc02
Ignore-AOSP-First: in addition to changes in AOSP, copied to prebuilts
2021-06-24 13:06:43 +00:00
Treehugger Robot
3651e08779 Merge "sepolicy: allow recovery to operate devpts and kmsg" am: 097a8b4e29 am: 1bce0abd27
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1726491

Change-Id: Ia9c706a2edfe588b3bc7749694da968531e7013b
2021-06-24 02:23:54 +00:00
Treehugger Robot
097a8b4e29 Merge "sepolicy: allow recovery to operate devpts and kmsg" 2021-06-24 01:33:52 +00:00
Thierry Strudel
b65cd0a1d6 Merge "Add support for hal_uwb" into sc-dev 2021-06-24 00:45:50 +00:00
Michael Ayoubi
142f375055 Add support for hal_uwb
Bug: 187386527
Test: Boot and confirm HAL is up
Signed-off-by: Michael Ayoubi <mayoubi@google.com>
Change-Id: Ia866a9a72b6f2ea5b31de25baefd13c2fd0b9c22
Merged-In: Ia866a9a72b6f2ea5b31de25baefd13c2fd0b9c22
2021-06-23 01:25:09 +00:00
Diego Wilson
11d810a7fb Add camera2 extension property policies
These properties allow to vendors to provide their
own camera2 extensions service. The properties
must be accesible to any android app that wishes
to use camera2 extensions.

Bug: 183533362
Change-Id: I94c7ac336b3103355124830320787472f0d2a8b6
Merged-In: I94c7ac336b3103355124830320787472f0d2a8b6
2021-06-21 22:34:29 +00:00
Treehugger Robot
046b657fc3 Merge "sepolicy: Allow to receive FDs from app_zygote" am: 79f1fc195c am: 99dfffed32
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1739055

Change-Id: Ic815e9a178e2d8f3001768811ed757597c373b49
2021-06-21 13:57:14 +00:00
Treehugger Robot
79f1fc195c Merge "sepolicy: Allow to receive FDs from app_zygote" 2021-06-21 10:58:13 +00:00
Diego Wilson
0bc6711577 Merge "Add camera2 extension property policies" am: 1c1525198a am: 5df6558de9
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1736939

Change-Id: I216c3230210c7b182ab922475afa24fbe2574fbb
2021-06-19 01:52:38 +00:00
Diego Wilson
5908c353e3 Add camera2 extension property policies
These properties allow to vendors to provide their
own camera2 extensions service. The properties
must be accesible to any android app that wishes
to use camera2 extensions.

Change-Id: I94c7ac336b3103355124830320787472f0d2a8b6
2021-06-18 23:59:41 +00:00
Shawn Willden
216245497b Allow keymint to access tee-device
Bug: 177729159
Test: build & boot w/keymint
Merged-In: I16a291d04c5dd951fede0ed9136af94718cac41f
Change-Id: I16a291d04c5dd951fede0ed9136af94718cac41f
2021-06-18 07:15:30 -06:00
Joanne Chung
a079c3a9a8 Merge "[Sepolicy] Change sepolicy name back to formal name." 2021-06-18 06:56:05 +00:00
xiaohuin
660d81b676 sepolicy: allow recovery to operate devpts and kmsg
Fix recovery hang when factory reset.

1. Recovery needs devpts permission to call liblogwrap to operate child_ptty for e2fsck
avc:  denied  { read write } scontext=u:r:recovery:s0 tcontext=u:object_r:devpts:s0 tclass=chr_file permissive=0
2. Recovery needs kmsg_device permission to redirect logs from e2fsck to kmsg
avc:  denied  { getattr } scontext=u:r:recovery:s0 tcontext=u:object_r:kmsg_device:s0 tclass=chr_file permissive=0

Bug: 189805577
Test: Manual. Erase all data(factory reset)
Change-Id: I86ad2109c5199c897462be8b9f1c1cb3d78bc294
2021-06-18 14:20:31 +08:00
Michael Ayoubi
727fbf07e3 Merge "Add support for hal_uwb" am: 26c35067d5 am: 4958ba6d47
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1732953

Change-Id: I4f1ecf4193670628f57b53b3d632009ff1a3e334
2021-06-18 05:15:36 +00:00
Michael Ayoubi
26c35067d5 Merge "Add support for hal_uwb" 2021-06-18 04:53:19 +00:00
Egor Pasko
c45bcd3cab sepolicy: Allow to receive FDs from app_zygote
The primary goal is to have an ashmem region shared between the main app
process in Chrome (=Browser Process) and the app zygote. It can only be
passed from the App Zygote, since there is no communication in the other
direction. Passing of the file descriptor should happen by:
(A) inheriting via fork(2)
(B) using binder IPC

Currently ashmem FDs are sufficiently allowed to be mmap(2)-ed in all
Chrome processes. The mode of mapping (read-only, read-write etc.) is
controlled by the settings of the region itself, not by sepolicy.

This change additionally allows an FD created in the app zygote to be
passed to the 'untrusted_app' domain.

Note: This change allows *any* FD, not just an ashmem one to be passed.
This is on purpose: in the future we will likely want to return to the
memfd story.  Other usecases (pipes, sockets) might appear.

The app zygote preload takes the responsibility not to share
capabilities in the form of FDs unintentionally with other app
processes.

Historical note: we tried to enable this for memfd (using additional
rules), but it required a 'write' permission when sending an FD. Reasons
for that are still puzzling, and there seems to be no easy workaround
for it. Decision: use ashmem.

Bug: 184808875
Test: Manual: Build and install Chrome (trichrome_chrome_google_bundle)
      from [1]. Make sure FileDescriptorAllowlist allows the FD, like
      [2]. Reach a NewTabPage, click on a suggested page, observe no
      errors related to binder transactions and selinux violations.

[1] A change in Chrome to create an ashmem region during app zygote
    preload and pass it to the browser process:
    https://crrev.com/c/2752872/29

[2] Allowlist change in review:
     https://android-review.googlesource.com/c/platform/frameworks/base/+/1739393
    (Alternatively: Remove gOpenFdTable checks in ForkCommon() in
    com_android_internal_os_Zygote.cpp)

Change-Id: Ide085f472c8fb6ae76ab0b094319d6924552fc02
2021-06-17 17:20:41 +02:00
Aaron Huang
aec8574ecf Add app_api_service to pac_proxy_service
Add app_api_service to pac_proxy_service so that
it can be reach by Cts tests.

Ignore-AOSP-First: this is cherry-pick and add a change in
    prebuilts/api/31.0 which is a path doesn't exist in AOSP
Bug: 181745786
Test: build, CtsNetTestCases:PacProxyManagetTest
Change-Id: I9bf4ff810635aa5b3cbf984b77b547aa96cdd543
2021-06-17 16:31:59 +08:00
Adam Shih
6039a6c782 Merge "make system_app_data_file shareable over binder" into sc-dev 2021-06-17 00:34:23 +00:00
Adam Shih
5603d9e8d1 make system_app_data_file shareable over binder
Apps should be able to share their private files over binder,
including system_app.

Bug: 188869889
Test: go to setting ==> system ==> multi-users ==> tap icon to change
profile photo with camera

Change-Id: I3dc732f727b9b697c9a73f6089392690109ae035
Merged-In: I3dc732f727b9b697c9a73f6089392690109ae035
2021-06-16 14:00:50 +08:00
Adam Shih
1853087363 Merge "make system_app_data_file shareable over binder" am: 7216b3aa00 am: 5c90c86b4f
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1736243

Change-Id: I35d02c0a2dfe045b536fcb9f4bb87cb9655653e9
2021-06-16 02:06:30 +00:00
Adam Shih
ff7ba7e301 make system_app_data_file shareable over binder
Apps should be able to share their private files over binder,
including system_app.

Bug: 188869889
Test: go to setting ==> system ==> multi-users ==> tap icon to change
profile photo with camera

Change-Id: I3dc732f727b9b697c9a73f6089392690109ae035
2021-06-16 00:49:53 +00:00
Hasini Gunasinghe
61d07e7ce0 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
2021-06-15 22:19:39 +00:00
Aaron Huang
e1ec55d075 Merge "Add app_api_service to pac_proxy_service" am: 0f69ba0cfe am: 7b1ee34d57
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1705195

Change-Id: I11219d8773103fb6ff09063714481e24c7da19d6
2021-06-15 05:27:12 +00:00
Aaron Huang
0f69ba0cfe Merge "Add app_api_service to pac_proxy_service" 2021-06-15 05:00:05 +00:00
Songchun Fan
a357042fa5 [sepolicy] allow installd to query apps installed on Incremental File System
[Cherry-pick from AOSP]

Addresses denial messages like:
06-10 19:36:56.269  1214  1214 I Binder:1214_5: type=1400 audit(0.0:58): avc: denied { use } for path="/data/incremental/MT_data_app_vmdl199/backing_store/st_2_1/com.unity.megacity-HlbmeQJjThgePchBlByuoQ==" dev="dm-5" ino=10445 scontext=u:r:installd:s0 tcontext=u:r:vold:s0 tclass=fd permissive=1
06-10 19:36:56.516  1214  1214 I Binder:1214_6: type=1400 audit(0.0:59): avc: denied { use } for path="/data/incremental/MT_data_app_vmdl199/backing_store/st_2_1/com.unity.megacity-HlbmeQJjThgePchBlByuoQ==" dev="dm-5" ino=10445 scontext=u:r:installd:s0 tcontext=u:r:vold:s0 tclass=fd permissive=1

BUG: 190699430
Test: manual

Change-Id: Iee4bdb382b6af5bc8cd63fde2c0db5f0b9b4f02b
Merged-In: Iee4bdb382b6af5bc8cd63fde2c0db5f0b9b4f02b
2021-06-14 09:18:22 -07:00
Treehugger Robot
c4f6625d5b Merge "Allow cameraserver to access permission checker" am: 0e1f6a5ddf am: d8c269b321
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1734253

Change-Id: I5551a68c21175043b5a61cd5e34a815ea372d289
2021-06-14 06:09:07 +00:00
Treehugger Robot
0e1f6a5ddf Merge "Allow cameraserver to access permission checker" 2021-06-14 05:47:01 +00:00
Songchun Fan
d2b89d9cc1 [sepolicy] allow installd to query apps installed on Incremental File System am: f1a60ca2fe am: 87b1f6ad2b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1734272

Change-Id: Ibf925e86fd43e5668d47d93cdc60eda0ce392953
2021-06-12 10:31:27 +00:00
Svet Ganov
da0c8923f7 Allow cameraserver to access permission checker
Test: No SELinux errors and can access

Change-Id: Id7884e0fde4afc235b097be640ffde45fd067f33
2021-06-12 02:56:00 +00:00
Songchun Fan
f1a60ca2fe [sepolicy] allow installd to query apps installed on Incremental File System
Addresses denial messages like:
06-10 19:36:56.269  1214  1214 I Binder:1214_5: type=1400 audit(0.0:58): avc: denied { use } for path="/data/incremental/MT_data_app_vmdl199/backing_store/st_2_1/com.unity.megacity-HlbmeQJjThgePchBlByuoQ==" dev="dm-5" ino=10445 scontext=u:r:installd:s0 tcontext=u:r:vold:s0 tclass=fd permissive=1
06-10 19:36:56.516  1214  1214 I Binder:1214_6: type=1400 audit(0.0:59): avc: denied { use } for path="/data/incremental/MT_data_app_vmdl199/backing_store/st_2_1/com.unity.megacity-HlbmeQJjThgePchBlByuoQ==" dev="dm-5" ino=10445 scontext=u:r:installd:s0 tcontext=u:r:vold:s0 tclass=fd permissive=1

BUG: 190699430
Test: manual
Change-Id: Iee4bdb382b6af5bc8cd63fde2c0db5f0b9b4f02b
2021-06-10 13:16:28 -07:00
Michael Ayoubi
0be7c67da0 Add support for hal_uwb
Bug: 187386527
Test: Boot and confirm HAL is up
Signed-off-by: Michael Ayoubi <mayoubi@google.com>
Change-Id: Ia866a9a72b6f2ea5b31de25baefd13c2fd0b9c22
2021-06-10 17:46:23 +00:00
Jack Yu
4412ba4942 Add persist.nfc property
Allow system_app to set and get system property persist.nfc..

Bug: 187083201
Test: access persist.nfc.debug_enabled
Change-Id: Ia952f83d6206be458bcb56a9c4d44bc3e6db5e73
2021-06-11 00:28:31 +08:00
Joanne Chung
a6657178f4 [Sepolicy] Change sepolicy name back to formal name.
The feature is public, we can change the fake name to formal name.

Bug: 185550380
Test: build pass and can run service correctly
Merged-In: I956d916077f9a71cdf1df2f0be6f83e6f1f30a98

Change-Id: Idc29942eee6c2fd7658beb69ba62a70397176a66
2021-06-10 11:02:27 +00:00
Yifan Hong
7b47931f4f Merge "Allow binder services to r/w su:tcp_socket" am: a66a5df13d am: 34f017a2d0
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1729830

Change-Id: I1d09a4e59e99dbecff3e6b5e7f2dbda18e9c9f3c
2021-06-08 22:52:06 +00:00
Yifan Hong
a66a5df13d Merge "Allow binder services to r/w su:tcp_socket" 2021-06-08 22:13:23 +00:00
Yifan Hong
be04b091bb Allow binder services to r/w su:tcp_socket
Test: binderHostDeviceTest
Bug: 182914638
Change-Id: I1c8d3b2194bc20bd2bcde566190aa5c73d7e7db9
2021-06-08 10:39:02 -07:00
Inseob Kim
d5fa12d116 Merge "Remove microdroid specific rules and files" am: af2697a452 am: bf48ef246a
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1728032

Change-Id: Ib4907f64558ac6efbf5fb05051bbcfb0c7075be8
2021-06-08 01:17:42 +00:00
Inseob Kim
5d269aaa55 Remove microdroid specific rules and files
These are moved to packages/modules/Virtualization.

Bug: 189165759
Test: boot device and microdroid
Test: atest MicrodroidHostTestCases
Change-Id: I050add7fef56ced4787117f338e7b5d1fda1c193
2021-06-07 19:22:18 +09:00
Jeff Vander Stoep
ff0dc89527 uncrypt: allow reading /proc/bootconfig
It's needed when calling ReadDefaultFstab.

Fixes: 189509028
Test: build
Change-Id: I0d4bac7f2e3a25faa921c8d77cbf92f7808f0ab7
(cherry picked from commit e4116b4e44)
2021-06-03 21:29:57 +02:00
Calin Juravle
6084060fef Merge "Enable ART properties modularization" into sc-dev 2021-06-03 16:05:40 +00:00
Svetoslav Ganov
3ee45181ab Merge "Allow mediaserver/audioserver to access permission checker service" into sc-dev 2021-06-02 23:07:23 +00:00
Calin Juravle
d802bd8964 Enable ART properties modularization
ART is becoming a module and we need to be able to add new properties
without modifying the non updatable part of the platform:

- convert ART properties to use prefix in the namespace of
[ro].dalvik.vm.
- enable appdomain and coredomain to read device_config properties
that configure ART

(cherry picked from commit 0b2ca6c22c)

Test: boot
Bug: 181748174
Merged-In: Id23ff78474dba947301e1b6243a112b0f5b4a832
Change-Id: Id23ff78474dba947301e1b6243a112b0f5b4a832
2021-06-02 21:18:13 +00:00
Alexander Dorokhine
c694413562 Allow the appsearch apex access to the apexdata misc_ce dir.
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1715470

Bug: 177685938
Test: AppSearchSessionCtsTest
Ignore-AOSP-First: Already submitted in aosp/1715470; being cherry-picked into S

Change-Id: I61282b1cd6c9e46b02f66425f39183c63ee1919b
(cherry picked from commit d0e63d0127)
2021-06-02 17:01:41 +00:00
Calin Juravle
cc3a1f61da Merge "Enable ART properties modularization" am: c4efcbdc06 am: e6bf8c1409
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1710967

Change-Id: Ie7eb5d035677f7021851679909e9b075799fde8d
2021-06-02 15:04:25 +00:00
Calin Juravle
c4efcbdc06 Merge "Enable ART properties modularization" 2021-06-02 14:39:36 +00:00
Treehugger Robot
1766f3e915 Merge "uncrypt: allow reading /proc/bootconfig" am: 17a5e930cb am: dd539387a5
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1723311

Change-Id: I7c846e73ea779b6a3ceda908f2f65bef2f0efa82
2021-06-02 11:17:14 +00:00
Treehugger Robot
17a5e930cb Merge "uncrypt: allow reading /proc/bootconfig" 2021-06-02 10:35:28 +00:00
Jeff Vander Stoep
e4116b4e44 uncrypt: allow reading /proc/bootconfig
It's needed when calling ReadDefaultFstab.

Fixes: 189509028
Test: build
Change-Id: I0d4bac7f2e3a25faa921c8d77cbf92f7808f0ab7
2021-06-02 08:46:59 +02:00
Svet Ganov
a326c79cc9 Allow mediaserver/audioserver to access permission checker service
bug: 158792096

Test: atest CtsMediaTestCases
      atest CtsPermissionTestCases
      atest CtsPermission2TestCases
      atest CtsPermission3TestCases
      atest CtsPermission4TestCases

Merged-In: I392c87f0a85a09d891bceaaefeae1b3f9acff55a

Change-Id: I392c87f0a85a09d891bceaaefeae1b3f9acff55a
2021-06-01 23:42:26 +00:00
Calin Juravle
0b2ca6c22c Enable ART properties modularization
ART is becoming a module and we need to be able to add new properties
without modifying the non updatable part of the platform:

- convert ART properties to use prefix in the namespace of
[ro].dalvik.vm.
- enable appdomain and coredomain to read device_config properties
that configure ART

Test: boot
Bug: 181748174
Change-Id: Id23ff78474dba947301e1b6243a112b0f5b4a832
2021-06-01 16:14:55 -07:00
Alexander Dorokhine
d0e63d0127 Merge "Allow the appsearch apex access to the apexdata misc_ce dir." am: 73854e626d am: 9eeb72826c
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1715470

Change-Id: I61282b1cd6c9e46b02f66425f39183c63ee1919b
2021-05-27 21:35:55 +00:00
Alexander Dorokhine
73854e626d Merge "Allow the appsearch apex access to the apexdata misc_ce dir." 2021-05-27 20:39:03 +00:00
Alexander Dorokhine
0b2553a32b Allow the appsearch apex access to the apexdata misc_ce dir.
Bug: 177685938
Test: AppSearchSessionCtsTest
Change-Id: I727860a02cb9e612ce6c322662d418cddc2ff358
2021-05-26 09:47:19 -07:00
TreeHugger Robot
23904a5ff6 Merge "Allow keymint to access tee-device" into sc-dev am: 7af3eaca6d
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/14370516

Change-Id: I5528e6d0cbb26f893cc289ca50b2fa54819e4f8b
2021-05-26 13:53:57 +00:00
TreeHugger Robot
7af3eaca6d Merge "Allow keymint to access tee-device" into sc-dev 2021-05-26 13:37:36 +00:00
Shawn Willden
b69b0f7874 Allow keymint to access tee-device
Ignore-AOSP-First: No merge path from AOSP
Bug: 177729159
Test: build & boot w/keymint
Change-Id: I16a291d04c5dd951fede0ed9136af94718cac41f
2021-05-26 06:24:12 -06:00
Treehugger Robot
e9af16b277 Merge "Allow mke2fs to format virtual block devices in microdroid" am: b8c6055b6f am: 3a4ca4e4fe
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1717690

Change-Id: I8eae0dca5db8810a5c2f27ff765b3644241b93c9
2021-05-26 00:37:11 +00:00
Treehugger Robot
b8c6055b6f Merge "Allow mke2fs to format virtual block devices in microdroid" 2021-05-26 00:03:08 +00:00
Michael Ayoubi
45333650ec Add DCK eligibility properties
Bug: 186488185
Test: Confirm GMSCore access
Change-Id: I20baf5c9ae9fbebc9e43d2798401ad49776fb74a
Merged-In: I20baf5c9ae9fbebc9e43d2798401ad49776fb74a
2021-05-25 21:39:51 +00:00
Jiyong Park
e1bfe4332f Allow mke2fs to format virtual block devices in microdroid
Bug: 185767624
Test: atest MicrodroidHostTestCases
Change-Id: I324064a8b58eb07a34f5724f36865865156d0db5
2021-05-26 00:40:24 +09:00
Treehugger Robot
d2fb5c2905 Merge "sepolicy: add f2fs ioctls" am: 3040e15baa am: 1e7b6902d7
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1717550

Change-Id: Idbd59fce934b6d50578350b5a813c38804632a92
2021-05-25 14:52:49 +00:00
Jaegeuk Kim
f9637194a0 sepolicy: add f2fs ioctls
This cleans up ioctl definitions.

Bug: 189169940
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I8cf2daa11911ef2fb817e125fcfc4f8ad91af0ed
Merged-In: I8cf2daa11911ef2fb817e125fcfc4f8ad91af0ed
2021-05-25 14:35:59 +00:00
Jaegeuk Kim
da1d8a3ce6 sepolicy: add f2fs ioctls
This cleans up ioctl definitions.

Bug: 189169940
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I8cf2daa11911ef2fb817e125fcfc4f8ad91af0ed
2021-05-25 05:54:14 -07:00
Michael Ayoubi
6080fdc9ec Merge "Add DCK eligibility properties" am: 20af5f1e4e am: 64c125adc0
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1715931

Change-Id: I1765b987167e49e102f6725af797e2ce6e7857be
2021-05-25 01:48:39 +00:00
Michael Ayoubi
77c10eff1e Add DCK eligibility properties
Bug: 186488185
Test: Confirm GMSCore access
Change-Id: I20baf5c9ae9fbebc9e43d2798401ad49776fb74a
2021-05-21 23:31:09 +00:00
Svet Ganov
fb898b105e Allow mediaserver/audioserver to access permission checker service am: 365c57f338 am: 15f5651570
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1714769

Change-Id: I8de07dd66b207279abe4059ed0b17abd76b5eadb
2021-05-20 21:46:50 +00:00
Svet Ganov
365c57f338 Allow mediaserver/audioserver to access permission checker service
bug: 158792096

Test: atest CtsMediaTestCases
      atest CtsPermissionTestCases
      atest CtsPermission2TestCases
      atest CtsPermission3TestCases
      atest CtsPermission4TestCases

Change-Id: I392c87f0a85a09d891bceaaefeae1b3f9acff55a
2021-05-20 19:07:29 +00:00
Chris Wailes
27cc792529 RESTRICT AUTOMERGE: Revert "Add SELinux properties for artd"
This reverts commit 467d8a80ea.

Test: m
Bug: 184281926
Change-Id: Ie95c5f65645d8d372bae9e7ebc325a42b777c1e8
2021-05-19 19:28:39 +00:00
Yabin Cui
88050312be Merge "Allow simpleperf_app_runner to write to shell pipe fds." am: 4c26361472 am: 642d69dbdc am: c7e09a418a
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1707486

Change-Id: I4ffe9a0457a63db93a29cef49999e2d7db19fa19
2021-05-14 21:19:54 +00:00
Yabin Cui
b2c1674f03 Merge "Allow simpleperf_app_runner to write to shell pipe fds." am: 4c26361472 am: 642d69dbdc
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1707486

Change-Id: Idc465113a2b5f4f5af534b6777511c29bd7e9f38
2021-05-14 21:18:31 +00:00
Yabin Cui
4c26361472 Merge "Allow simpleperf_app_runner to write to shell pipe fds." 2021-05-14 20:45:39 +00:00
Yabin Cui
d34a1dd223 Allow simpleperf_app_runner to write to shell pipe fds.
Currently simpleperf knows whether an app is debuggable or profileable
by running commands via run-as and simpleperf_app_runner and seeing if
they fail. This isn't convenient. So we want simpleperf_app_runner to
pass app type to simpleperf through pipe fds.

Bug: 186469540
Test: run CtsSimpleperfTestCases.
Change-Id: Ia2d276def83361336bb25d9cf367073a01cb4932
2021-05-14 10:16:24 -07:00
Treehugger Robot
5f0869cdf5 Merge "Allow /dev/dma_heap directory to be readable" am: 9327c4f1cc am: 76038444d8 am: 8a6512d43a
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1705996

Change-Id: Ia310905d6fbe399979e148b226e4892f596fc9d1
2021-05-14 06:12:35 +00:00
Treehugger Robot
9327c4f1cc Merge "Allow /dev/dma_heap directory to be readable" 2021-05-14 05:10:33 +00:00
Hridya Valsaraju
920939df71 Allow /dev/dma_heap directory to be readable
Allow everyone to read /dev/dma_heap so that they can query the set of
available heaps with the GetDmabufHeapList() API in libdmabufheap.
This patch fixes the following denials that happen when clients use the
API:

avc: denied { read } for name="dma_heap" dev="tmpfs" ino=369
scontext=u:r:mediaswcodec:s0 tcontext=u:object_r:dmabuf_heap_device:s0
tclass=dir permissive=0
9507:05-12 17:19:59.567  1647  1647 W com.android.systemui: type=1400
audit(0.0:93): avc: denied { read } for
comm=4E444B204D65646961436F6465635F name="dma_heap" dev="tmpfs" ino=369
scontext=u:r:platform_app:s0:c512,c768
tcontext=u:object_r:dmabuf_heap_device:s0 tclass=dir permissive=0
app=com.android.systemui

Test: manual
Bug: 184397788
Change-Id: I84672bc0be5b409cd49080501d0bf3c269ca610c
2021-05-14 05:09:30 +00:00
liuyg
87fc7e06db Revert "Allow the MediaProvider app to set FUSE passthrough property" am: 04c85dcfc4 am: 97e0c02e9e am: bdfad42b09
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1705066

Change-Id: I07875bd5e07c5b2b45fb5fdd064790b50ad7eeb7
2021-05-13 19:55:46 +00:00
Alessio Balsini
4e758d5a43 Allow the MediaProvider app to set FUSE passthrough property am: c1e2918fd9 am: bafbd5eeb0 am: 3c7f9b1c7a
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1693545

Change-Id: I4340d1aa457cf190eba110b74ef63f76abe6613d
2021-05-13 19:55:35 +00:00
liuyg
04c85dcfc4 Revert "Allow the MediaProvider app to set FUSE passthrough property"
This reverts commit c1e2918fd9.

Reason for revert: Build broke

Change-Id: I4b95e977cf66c586b0d0b465f1b3654c01074152
2021-05-13 18:18:28 +00:00
Alessio Balsini
c1e2918fd9 Allow the MediaProvider app to set FUSE passthrough property
Allow the MediaProvider app to write the system property
fuse.passthrough.enabled in case FUSE passthrough is enabled.
The need for this additional system property is due to the ScopedStorage
CTS tests that are assuming FUSE passtrhough is always on for devices
supporting it, but there may be some cases (e.g., GSI mixed builds)
where this is not possible true and the feature is disabled at runtime,
thus causing the tests to fail.
This additional system property is only set when FUSE passthrough is
actually being used by the system.

Bug: 186635810
Test: CtsScopedStorageDeviceOnlyTest
Signed-off-by: Alessio Balsini <balsini@google.com>
Change-Id: I623042d67399253a9167188c3748d93eb0f2d41f
2021-05-13 17:38:16 +00:00
Aaron Huang
0bcca11b72 Add app_api_service to pac_proxy_service
Add app_api_service to pac_proxy_service so that
it can be reach by Cts tests.

Bug: 181745786
Test: CtsNetTestCases:PacProxyManagetTest
Change-Id: I9bf4ff810635aa5b3cbf984b77b547aa96cdd543
2021-05-13 17:28:04 +08:00
Vova Sharaienko
8f2377b827 Merge "Stats: Marked service as app_api_service" am: ad8cf2fe1b am: 0fa219044b am: 24f79747ff
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1698879

Change-Id: I495e724efa509f61a6dfa98e47850cdb062aadaa
2021-05-07 17:06:12 +00:00
Vova Sharaienko
ad8cf2fe1b Merge "Stats: Marked service as app_api_service" 2021-05-07 16:05:57 +00:00
David Anderson
4bc55b88b7 Merge "Allow fastbootd to mount /metadata in recovery." am: deef325f8f am: 8b039a7b43 am: e408a10f4a
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1674731

Change-Id: Ia153a27b1d4834279566e332630ddf1f8d74a0e9
2021-05-06 23:57:38 +00:00
Vova Sharaienko
a96cb4d339 Stats: Marked service as app_api_service
Marked the fwk_stats_service service as app_api_service so that
it can be reached by apps (also means that it's stable)

Bug: 185789914
Test: Build, flash, boot & and logcat | grep "SELinux"
Change-Id: Ifbb111dbee0429d8aaea4688c0390ee80e25cb22
2021-05-06 22:03:47 +00:00
David Anderson
018004d9d1 Allow fastbootd to mount /metadata in recovery.
It is important that fastbootd is able to mount /metadata in recovery, in
order to check whether Virtual A/B snapshots are present. This is
enabled on userdebug builds, but currently fails on user builds.

Fixes:

        audit: type=1400 audit(7258310.023:24): avc:  denied  { mount } for pid=511 comm="fastbootd" name="/" dev="sda15" ino=2 scontext=u:r:fastbootd:s0 tcontext=u:object_r:labeledfs:s0 tclass=filesystem permissive=0

Bug: 181097763
Test: fastboot flash on user build
Change-Id: I1abeeaa3109e08755a1ba44623a46b12d9bfdedc
2021-05-05 16:37:56 -07:00
Hridya Valsaraju
037300eb6b Merge changes If26ba23d,Ibea38822 am: f35c70b0dd am: 09665a69c3 am: 9413e4b62f
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1696318

Change-Id: Ia4af31c21970786ef65764e0d3c2af6fe72c5634
2021-05-05 18:41:01 +00:00
Hridya Valsaraju
f35c70b0dd Merge changes If26ba23d,Ibea38822
* changes:
  Revert "Revert "Exclude vendor_modprobe from debugfs neverallow restrictions""
  Revert "Revert "Add neverallows for debugfs access""
2021-05-05 17:31:35 +00:00
Songchun Fan
c201aff5a9 [sepolicy] allow system server to read incfs metrics from sysfs am: 633f7ca868 am: 5ba48ae269 am: 73793c2fcd
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1696320

Change-Id: I3f62c003ce2f3111f779617343f4ca0c7325a390
2021-05-05 15:55:45 +00:00
Songchun Fan
633f7ca868 [sepolicy] allow system server to read incfs metrics from sysfs
Address denial messages like:

05-05 05:02:21.480  1597  1597 W Binder:1597_12: type=1400 audit(0.0:140): avc: denied { read } for name="reads_delayed_min" dev="sysfs" ino=107358 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0

BUG: 184844615
Test: atest android.cts.statsdatom.incremental.AppErrorAtomTests#testAppCrashOnIncremental
Change-Id: I201e27e48a08f99f41a030e06c6f22518294e056
2021-05-04 22:56:41 -07:00
Hridya Valsaraju
498318cc65 Revert "Revert "Exclude vendor_modprobe from debugfs neverallow restrictions""
This reverts commit 231c04b2b9.

Now that b/186727553 is fixed, it should be safe to revert this revert.

Test: build
Bug: 184381659
Change-Id: If26ba23df19e9854a121bbcf10a027c738006515
2021-05-04 22:07:08 -07:00
Hridya Valsaraju
23f9f51fcd Revert "Revert "Add neverallows for debugfs access""
This reverts commit e95e0ec0a5.

Now that b/186727553 is fixed, it should be safe to revert this revert.

Test: build
Bug: 184381659
Change-Id: Ibea3882296db880f5cafe4f9efa36d79a183c8a1
2021-05-04 22:06:46 -07:00
Treehugger Robot
8b0c44e44b Merge "Revert "Revert "Add a neverallow for debugfs mounting""" am: 22c7415dbf am: 5e0fb52f82 am: f800594f26
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1687093

Change-Id: I47b538de326e4bae314ee64a140caedc18a19d66
2021-05-04 17:43:24 +00:00
Hridya Valsaraju
a885dd84c7 Revert "Revert "Add a neverallow for debugfs mounting""
This reverts commit f9dbb72654.
Issues with GSI testing fixed with
https://android-review.googlesource.com/c/platform/build/+/1686425/

Bug: 184381659
Test: manual
Change-Id: Icd07430c606e294dfaad2fc9b37d34e3dae8cbfc
2021-05-02 21:41:53 -07:00
Shawn Willden
3ca8160351 Merge "Allowing userdebug/eng builds crash dump access to ks" am: bdc4f744da am: a4b0853bbc am: 0ceabfe4b2
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1692507

Change-Id: If31bf6b037ab32d736e3f83fef238a28a91454b6
2021-04-30 23:20:25 +00:00
Shawn Willden
bdc4f744da Merge "Allowing userdebug/eng builds crash dump access to ks" 2021-04-30 22:19:04 +00:00
Max Bires
f09391624a Allowing userdebug/eng builds crash dump access to ks
This will make debugging of keystore issues in dogfood populations much
easier than it previously was, as developers will have detailed crash
dump reporting on any issues that do occur.

Bug: 186868271
Bug: 184006658
Test: crash dumps appear if keystore2 explodes
Change-Id: Ifb36cbf96eb063c9290905178b2fdc5934050b99
2021-04-30 18:50:54 +00:00
Songchun Fan
05eac935cb [sepolicy] allow system_server to ioctl INCFS_IOC_GET_LAST_READ_ERROR am: 979a1f8f34 am: 94242d39fb am: f31a9e7cf2
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1690659

Change-Id: Id76ec2909c795dd69994ddb2ee3990a2b8264a95
2021-04-30 17:49:51 +00:00
Songchun Fan
979a1f8f34 [sepolicy] allow system_server to ioctl INCFS_IOC_GET_LAST_READ_ERROR
Solves the denial message like:

04-30 03:54:46.972 21944 21944 I Binder:21944_17: type=1400 audit(0.0:502): avc: denied { ioctl } for path=2F646174612F696E6372656D656E74616C2F4D545F646174615F6170705F766D646C3133352F6D6F756E742F2E70656E64696E675F7265616473202864656C6574656429 dev="incremental-fs" ino=2 ioctlcmd=0x6727 scontext=u:r:system_server:s0 tcontext=u:object_r:incremental_control_file:s0 tclass=file permissive=1

BUG: 184844615
Test: manual
Change-Id: I3ef32613de348bca1d58cddf4ec1296d4828b51a
2021-04-30 16:46:06 +00:00
Nicolas Geoffray
882537a989 Merge "Allow boot animation to update boot status." am: 82bf10a79c am: 75de97b2e4 am: 1f652713d1
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1687883

Change-Id: I791ffa1d83a1bf9bbb5a15f69ffce6e7e86441ce
2021-04-29 09:32:32 +00:00
Nicolas Geoffray
82bf10a79c Merge "Allow boot animation to update boot status." 2021-04-29 07:53:05 +00:00
Christian Wailes
6de8e5debe Merge "Add SELinux properties for artd" am: 6553a8dbe6 am: b9502c818f am: b921e1dac4
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1663786

Change-Id: Ie4bd8ae58edc80993c56ba3cf806135c716526fc
2021-04-28 20:23:52 +00:00
Christian Wailes
6553a8dbe6 Merge "Add SELinux properties for artd" 2021-04-28 16:41:09 +00:00
Xusong Wang
2f1e25ec74 Merge "Allow NN HAL service to read files from apk data files" am: c5bae6f802 am: 7dfd4783bc am: c4ffadb18e
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1679971

Change-Id: I46c0db3dbaf2621ad737ea9973219a8fa161e139
2021-04-28 16:26:05 +00:00
Xusong Wang
c5bae6f802 Merge "Allow NN HAL service to read files from apk data files" 2021-04-28 15:09:42 +00:00
Nicolas Geoffray
6a311471a6 Allow boot animation to update boot status.
This CL was missed from the topic:
https://android-review.googlesource.com/q/topic:bootanim-percent

Test: update ART module, see animation go to 100%
Bug: 184881321
Change-Id: I59706718af11751a7e1f4b5ab1ff2793f554fb19
2021-04-28 15:17:09 +01:00
Chris Wailes
467d8a80ea Add SELinux properties for artd
Test: boot device and check for artd process
Change-Id: I2a161701102ecbde3e293af0346d1db0b11d4aab
2021-04-27 14:49:13 -07:00
Treehugger Robot
36bcb00ddf Merge "[incfs] Allow everyone read the IncFS sysfs features" am: 98914119ae am: 5fc200133c am: 8dc1f81981
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1683348

Change-Id: I147dd4ce4bb92294a60d98b7f840d17b5117f2b7
2021-04-26 23:28:56 +00:00
Treehugger Robot
98914119ae Merge "[incfs] Allow everyone read the IncFS sysfs features" 2021-04-26 22:19:37 +00:00
Treehugger Robot
88903b91a9 Merge "Fix permissions for vold.post_fs_data_done" am: 206d6d80a1 am: e85d0ef89c am: b99fe5711a
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1684054

Change-Id: I0921af74d1309fcaa3f36e53476090da085ab07f
2021-04-26 22:09:08 +00:00
Treehugger Robot
206d6d80a1 Merge "Fix permissions for vold.post_fs_data_done" 2021-04-26 20:36:34 +00:00
Eric Biggers
040ce199b2 Fix permissions for vold.post_fs_data_done
The system property "vold.post_fs_data_done" is used by init and vold to
communicate with each other in order to set up FDE on devices that use
FDE.  It needs to be gettable and settable by vold, and settable by init
and vendor_init.  This was the case in Android 11 and earlier; however,
the change
https://android-review.googlesource.com/c/platform/system/sepolicy/+/1277447
("Rename exported and exported2 vold prop") broke this by giving this
property the type "vold_config_prop", which made it no longer settable
by vold.

Since none of the existing property types appear to be appropriate for
this particular property, define a new type "vold_post_fs_data_prop" and
grant the needed domains permission to get/set it.

This is one of a set of changes that is needed to get FDE working again
so that devices that launched with FDE can be upgraded to Android 12.

Bug: 186165644
Test: Tested FDE on Cuttlefish
Change-Id: I2fd8af0091f8b921ec37381ad3b85a156d074566
2021-04-26 12:43:05 -07:00
Hridya Valsaraju
4d8e3b032b Merge changes from topic "revert-1668411-MWQWEZISXF" am: 7362f58895 am: b4fe53980f am: cb7c75c028
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1685768

Change-Id: I1cb8c339e1f75e3d9c0a8dc5d8c96c7b9ded79a6
2021-04-23 23:05:26 +00:00
Hridya Valsaraju
7362f58895 Merge changes from topic "revert-1668411-MWQWEZISXF"
* changes:
  Revert "Add a neverallow for debugfs mounting"
  Revert "Add neverallows for debugfs access"
  Revert "Exclude vendor_modprobe from debugfs neverallow restrictions"
  Revert "Check that tracefs files are labelled as tracefs_type"
2021-04-23 22:06:31 +00:00
Robert Horvath
f0989714ca Merge "Add bootanim property context, ro.bootanim.quiescent.enabled property" am: dbfe4809ba am: 03070a86ec am: 0b1d2a7385
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1676224

Change-Id: I6b7b8419e27ce03fae35451ba3e7cc842ee67335
2021-04-23 17:46:15 +00:00
Robert Horvath
dbfe4809ba Merge "Add bootanim property context, ro.bootanim.quiescent.enabled property" 2021-04-23 16:45:32 +00:00
Hridya Valsaraju
f9dbb72654 Revert "Add a neverallow for debugfs mounting"
Revert submission 1668411

Reason for revert: Suspect for b/186173384
Reverted Changes:
Iaa4fce9f0:Check that tracefs files are labelled as tracefs_t...
I743a81489:Exclude vendor_modprobe from debugfs neverallow re...
I63a22402c:Add neverallows for debugfs access
I289f2d256:Add a neverallow for debugfs mounting

Change-Id: Ie04d7a4265ace43ba21a108af85f82ec137c6af0
2021-04-23 16:38:20 +00:00
Hridya Valsaraju
e95e0ec0a5 Revert "Add neverallows for debugfs access"
Revert submission 1668411

Reason for revert: Suspect for b/186173384
Reverted Changes:
Iaa4fce9f0:Check that tracefs files are labelled as tracefs_t...
I743a81489:Exclude vendor_modprobe from debugfs neverallow re...
I63a22402c:Add neverallows for debugfs access
I289f2d256:Add a neverallow for debugfs mounting

Change-Id: I9b7d43ac7e2ead2d175b265e97c749570c95e075
2021-04-23 16:38:20 +00:00
Hridya Valsaraju
231c04b2b9 Revert "Exclude vendor_modprobe from debugfs neverallow restrictions"
Revert submission 1668411

Reason for revert: Suspect for b/186173384
Reverted Changes:
Iaa4fce9f0:Check that tracefs files are labelled as tracefs_t...
I743a81489:Exclude vendor_modprobe from debugfs neverallow re...
I63a22402c:Add neverallows for debugfs access
I289f2d256:Add a neverallow for debugfs mounting

Change-Id: I04f8bfdc0e5fe8d2f7d6596ed7b840332d611485
2021-04-23 16:38:20 +00:00
Andrew Walbran
92c28f9237 Merge "Add crosvm domain and give virtmanager and crosvm necessary permissions." am: 3b6a385137 am: 787c8b3320 am: b52306081a
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1655917

Change-Id: I359389015cba2eed89c2b03c7d65af1c38f49f02
2021-04-22 21:05:08 +00:00
Andrew Walbran
3b6a385137 Merge "Add crosvm domain and give virtmanager and crosvm necessary permissions." 2021-04-22 18:57:15 +00:00
Treehugger Robot
d21e4d0980 Merge changes from topic "debugfs_neverallow" am: 005ae599cd am: 95fef2b070 am: cf2b67a243
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1668411

Change-Id: I1fe5c7c31f12e0a68c76dde8810aba465d499922
2021-04-22 17:30:53 +00:00
Treehugger Robot
005ae599cd Merge changes from topic "debugfs_neverallow"
* changes:
  Check that tracefs files are labelled as tracefs_type
  Exclude vendor_modprobe from debugfs neverallow restrictions
  Add neverallows for debugfs access
  Add a neverallow for debugfs mounting
2021-04-22 16:41:06 +00:00
David Massoud
d84abac63b Merge "Allow traced_probes to read devfreq" am: 47b6227134 am: eeb537fcb8 am: 418070b5ac
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1676945

Change-Id: Ibe3c1ff8ed58ec1dc514802ca5c82bf9f14f2c67
2021-04-22 01:35:16 +00:00
David Massoud
47b6227134 Merge "Allow traced_probes to read devfreq" 2021-04-22 00:18:35 +00:00
Yurii Zubrytskyi
b382f02bf4 [incfs] Allow everyone read the IncFS sysfs features
Every process needs to be able to determine the IncFS features
to choose the most efficient APIs to call

Bug: 184357957
Test: build + atest PackageManagerShellCommandTest
Change-Id: Ia84e3fecfd7be1209af076452cc27cc68aefd80d
2021-04-21 15:15:40 -07:00
Hridya Valsaraju
4b6d50dcb4 Exclude vendor_modprobe from debugfs neverallow restrictions
vendor_modprobe loads kernel modules which may create files in
debugfs during module_init().

Bug: 179760914
Test: build
Change-Id: I743a81489f469d52f94a88166f8583a7d797db16
2021-04-21 14:13:41 -07:00
Hridya Valsaraju
a0b504a484 Add neverallows for debugfs access
Android R launching devices and newer must not ship with debugfs
mounted. For Android S launching devices and newer, debugfs must only be
mounted in userdebug/eng builds by init(for boot time initializations)
and dumpstate(for grabbing debug information from debugfs using the
dumpstate HAL).

This patch adds neverallow statements to prevent othe processes
being provided access to debugfs when the flag PRODUCT_SET_DEBUGFS_RESTRICTIONS
is set to true.

Test: make with/without PRODUCT_SET_DEBUGFS_RESTRICTIONS
Bug: 184381659
Change-Id: I63a22402cf6b1f57af7ace50000acff3f06a49be
2021-04-21 14:13:22 -07:00
Hridya Valsaraju
1c3d898d87 Add a neverallow for debugfs mounting
Android R launching devices and newer must not ship with debugfs
mounted. For Android S launching devices and newer, debugfs must only be
mounted in userdebug/eng builds by init(for boot time initializations)
and dumpstate(for grabbing debug information from debugfs). This patch
adds a neverallow statement that prevents processes other than init
from being provided access to mount debugfs in non-user builds
when the flag PRODUCT_SET_DEBUGFS_RESTRICTIONS is set to true.

Test: make with/without PRODUCT_SET_DEBUGFS_RESTRICTIONS
Bug: 184381659
Change-Id: I289f2d25662a78678929e29f83cb31cebd8ca737
2021-04-21 14:13:02 -07:00
Steven Moreland
74c1a3524f Merge "sepolicy: allow BINDER_ENABLE_ONEWAY_SPAM_DETECTION for all processes" am: 7534762861 am: b1406bc54a am: 7b9b618f67
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1679693

Change-Id: I6bb69fffb9c3604e7e114f15291370eab3fcb4a9
2021-04-21 17:53:34 +00:00
Steven Moreland
7534762861 Merge "sepolicy: allow BINDER_ENABLE_ONEWAY_SPAM_DETECTION for all processes" 2021-04-21 16:42:26 +00:00
Treehugger Robot
b632648cc5 Merge "Make suspend_prop system_vendor_config_prop" am: c78b80667c am: bed8f2ac24 am: 93119b8340
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1681505

Change-Id: I179e81f0dd8990d0888e8b3e69b704fea8874a88
2021-04-21 01:42:02 +00:00
Treehugger Robot
c78b80667c Merge "Make suspend_prop system_vendor_config_prop" 2021-04-21 00:28:12 +00:00
Seth Moore
b2e17d8067 Merge "Enable pull metrics from keystore" am: 84742a3d92 am: ec3d371038 am: 742361a571
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1674808

Change-Id: I0bc41204d247fff7121d8c77b7d28d3f129c352f
2021-04-20 17:13:21 +00:00
Benjamin Schwartz
c171a1d9b6 Make suspend_prop system_vendor_config_prop
Bug: 185810834
Test: adb shell getprop suspend.short_suspend_threshold_millis
Change-Id: I270057e5f81b220b7168573b516dd102650f11e1
2021-04-20 09:13:02 -07:00
Seth Moore
84742a3d92 Merge "Enable pull metrics from keystore" 2021-04-20 16:00:46 +00:00
Treehugger Robot
588c0f11d9 Merge "Add a property to enable runtime debugfs restrictions in non-user builds" am: f5ec134342 am: b9f8fd42d5 am: efb6c0b1b6
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1663701

Change-Id: I3a8ea3bf524dd26e9bd1804898c7f4ca3c3a61be
2021-04-20 07:29:53 +00:00
Hang Lu
a251b7ed65 sepolicy: allow BINDER_ENABLE_ONEWAY_SPAM_DETECTION for all processes
BINDER_ENABLE_ONEWAY_SPAM_DETECTION is used to enable/disable oneway
spamming detection in binder driver, and can be set per-proc.

Bug: 181190340
Change-Id: Id799b19ee5a74b458e286dc29122c140a047bdad
2021-04-20 14:07:56 +08:00
Treehugger Robot
f5ec134342 Merge "Add a property to enable runtime debugfs restrictions in non-user builds" 2021-04-20 06:07:53 +00:00
Yo Chiang
70d99ca9b4 Merge "Allow health storage HAL to read default fstab" am: 9c66e3dfa3 am: 305a726d77 am: b21fd0b819
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1673195

Change-Id: Ie8f1a6556a4181ba00b6e412d69fb08abdf4dfca
2021-04-20 03:59:59 +00:00
Yo Chiang
9c66e3dfa3 Merge "Allow health storage HAL to read default fstab" 2021-04-20 02:36:06 +00:00
Xusong Wang
c4e559e04f Allow NN HAL service to read files from apk data files
This allows NNAPI users to pass in model data from the asset folder.

Bug: 184880878
Test: nnapi demo app with model data from asset file
Test: NNAPI benchmark CTS
Change-Id: I79ded4e9f35eb15e1f9f0d91308840e8b318d218
2021-04-19 16:39:49 -07:00
Treehugger Robot
f4014837fa Merge "Add permission checker service" am: 644639584b am: e8a381e3e4 am: 82d927bad8
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1678585

Change-Id: I85473ed47a9ad47ba1356149644464821bd84a25
2021-04-19 19:35:30 +00:00
Svet Ganov
214a65213a Add permission checker service
bug: 158792096

Test: atest CtsPermission5TestCases

Change-Id: I9dbbf2fe84131ba38ac70e7171e3bd826c150640
2021-04-17 23:41:50 +00:00
David Massoud
c50fecd8ef Allow traced_probes to read devfreq
- Add dir read access to /sys/class/devfreq/
- Add file read access to /sys/class/devfreq/$DEVICE/cur_freq

Resolves the following denials:
W traced_probes: type=1400 audit(0.0:8):
avc: denied { read } for name="devfreq" dev="sysfs"
ino=28076 scontext=u:r:traced_probes:s0
tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0

W traced_probes: type=1400 audit(0.0:226):
avc: denied { read } for name="cur_freq" dev="sysfs"
ino=54729 scontext=u:r:traced_probes:s0
tcontext=u:object_r:sysfs:s0 tclass=file permissive=0

See ag/14187061 for device specific sysfs_devfreq_cur labels

Bug: 181850306
Test: ls -Z, record perfetto trace
Change-Id: I23cebb16505313160e14b49e82e24da9b81cad70
2021-04-16 20:02:06 +08:00
Joanne Chung
ece98d7cf7 Merge "[Sepolicy] Change sepolicy name back to formal name." into sc-dev 2021-04-16 07:16:26 +00:00
Hridya Valsaraju
8403ed70de Add a property to enable runtime debugfs restrictions in non-user builds
This patch adds ro.product.enforce_debugfs_restrictions to
property_contexts. When the property is set to true in non-user builds,
init mounts debugfs in early-init to enable boot-time debugfs
initializations and unmounts it on boot complete. Similarly dumpstate
will mount debugfs to collect information from debugfs during bugreport
collection via the dumpstate HAL and unmount debugfs once done. Doing
so will allow non-user builds to keep debugfs disabled during runtime.

Test: make with/without PRODUCT_SET_DEBUGFS_RESTRICTIONS, adb shell am
bugreport
Bug: 184381659

Change-Id: Ib720523c7f94a4f9ce944d46977a3c01ed829414
2021-04-15 22:38:23 -07:00
Treehugger Robot
cdd84f56e6 Merge "Allow apexd to access a new dev_type: virtual disk" am: 1c996021a5 am: 76fc5c9fa5 am: b8561bf122
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1673185

Change-Id: Ia8b48874bdba28757a38c7633f6e6c362888de93
2021-04-16 02:26:05 +00:00
Treehugger Robot
1c996021a5 Merge "Allow apexd to access a new dev_type: virtual disk" 2021-04-16 00:54:40 +00:00
Robert Horvath
8504938690 Add bootanim property context, ro.bootanim.quiescent.enabled property
Add property & property context to configure whether the bootanimation
should be played in a quiescent boot.

Bug: 185118020
Test: Set property through PRODUCT_PRODUCT_PROPERTIES
Test: Read property from bootanimation process
Change-Id: Ib9e88444da7f5e8000d7367199f5230f1e4d26d9
2021-04-15 14:56:17 +00:00