Commit graph

6735 commits

Author SHA1 Message Date
Nicolas Geoffray
82bf10a79c Merge "Allow boot animation to update boot status." 2021-04-29 07:53:05 +00:00
Christian Wailes
6553a8dbe6 Merge "Add SELinux properties for artd" 2021-04-28 16:41:09 +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
98914119ae Merge "[incfs] Allow everyone read the IncFS sysfs features" 2021-04-26 22:19:37 +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
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
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
3b6a385137 Merge "Add crosvm domain and give virtmanager and crosvm necessary permissions." 2021-04-22 18:57:15 +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
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
7534762861 Merge "sepolicy: allow BINDER_ENABLE_ONEWAY_SPAM_DETECTION for all processes" 2021-04-21 16:42:26 +00:00
Treehugger Robot
c78b80667c Merge "Make suspend_prop system_vendor_config_prop" 2021-04-21 00:28:12 +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
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
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
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
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
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
Yi-Yo Chiang
2b708a2725 Allow health storage HAL to read default fstab
Fixes: 184797681
Bug: 181110285
Test: Presubmit
Test: atest VtsHalHealthStorageV1_0TargetTest
Change-Id: I87510bc82d742cd209846161cb73543308edcb09
2021-04-15 12:44:24 +08:00
Treehugger Robot
f40c8b67ca Merge "traced: move traced_tmpfs to public policy" 2021-04-14 23:40:03 +00:00
Jeff Vander Stoep
16ebb161eb traced: move traced_tmpfs to public policy
Allow the perfetto_producer macro to be used in device-specific
policy.

Bug: 185379881
Test: TH
Change-Id: I6932ff91a3ed095b5edce4076bdfd8607e925c6e
2021-04-14 22:18:41 +02:00
Michael Butler
19ae37f4ef Merge "Allow binder to send signals to hal_neuralnetworks_service" 2021-04-14 19:35:08 +00:00
Emilian Peev
87a3f24857 Merge "Define vendor side property "ro.camerax.extensions.enabled"" 2021-04-14 16:20:16 +00:00
Roshan Pius
0b8eafb54b Merge "Uwb: Create a new Uwb system service" 2021-04-14 00:52:10 +00:00
Emilian Peev
a974640390 Define vendor side property "ro.camerax.extensions.enabled"
Add "ro.camerax.extensions.enabled" vendor-specific property.
Allow public apps to read this property.

Bug: 171572972
Test: Camera CTS
Change-Id: Id5fadedff6baaaebe5306100c2a054e537aa61ed
2021-04-13 16:42:10 -07:00
Michael Butler
581fafffd3 Allow binder to send signals to hal_neuralnetworks_service
Bug: 170696939
Test: mma
Change-Id: Ic960f81854f5d9c913d09adcfba9782bc94c3c2b
2021-04-13 16:27:19 -07:00
Seth Moore
bad4165f25 Enable pull metrics from keystore
Allow keystore to call statsd.
Allow statsd to call back to keystore to pull atoms.

Bug: 172013262
Test: atest system/keystore/keystore2
Test: statsd_testdrive 10103
Change-Id: I2d1739e257e95b37cc61f655f98f7a2724df7d76
2021-04-13 22:45:01 +00:00
Alistair Delva
5bbeaa39d8 Merge "Suppress some su capability2 related denials" 2021-04-13 20:03:53 +00:00
Alistair Delva
124c77140d Suppress some su capability2 related denials
The su domain is always permissive. Operations which occur in this
domain should never be logged.

Addresses the following denials:

avc: denied { bpf } for comm="bpf_module_test" capability=39
scontext=u:r:su:s0 tcontext=u:r:su:s0 tclass=capability2 permissive=1

Bug: 185230825
Test: builds
Change-Id: Id8bd355a9636fb5e9d26ef570c2cf7e4273b08b5
2021-04-13 08:24:14 -07:00
Andrew Walbran
a995e84c18 Add crosvm domain and give virtmanager and crosvm necessary permissions.
Bug: 183583115
Test: make TARGET_KERNEL_USE=5.4 TARGET_VIM3L=true
Change-Id: I566436fa2d27597566014f2a63198a88d6d2dbd6
2021-04-13 09:30:20 +00:00
Jooyung Han
b62be12176 Allow apexd to access a new dev_type: virtual disk
In microdroid, apexd activates apexes which are passed as a virtual disk
to share apexes with host Android.

Bug: 184605708
Test: apexd running in microdroid can read /dev/block/vdb2
  when a disk image is passed to crosvm via --disk= option.
Change-Id: Ie27774868a0e0befb4c42cff795d1531b042654c
2021-04-13 15:46:16 +09:00
David Anderson
29e51c2095 Merge "Allow update_engine to scan /sys/fs and /sys/fs/f2fs." 2021-04-12 21:04:08 +00:00
Roshan Pius
2a1610b4e0 Uwb: Create a new Uwb system service
This service will intercept all UwbManager API calls and then perform
necessary permission checks before forwarding the call to the vendor
UWB service. Adding sepolicy permissions for exposing the service that
handles all public API's.

Bug: 183904955
Test: atest android.uwb.cts.UwbManagerTest
Change-Id: Icce4d2f586926421c06e8902a91533002c380b8d
2021-04-12 10:26:24 -07:00
Yabin Cui
bd4c9e8530 Add permissions in profcollectd to parse kernel etm data.
To parse etm data for kernel and kernel modules, add below permissions
to profcollectd:
1. Get kernel start address and module addresses from /proc/kallsyms
and /proc/modules.
2. Get kernel build id from /sys/kernel/notes.
3. Read kernel module files in vendor dir.

Bug: 166559473
Test: run profcollectd.

Change-Id: I2e0b346379271fadc20e720722f7c9a687335ee2
2021-04-08 16:03:59 -07:00
David Anderson
5a0d5ccdf7 Allow update_engine to scan /sys/fs and /sys/fs/f2fs.
When a bug causes us to leak a file descriptor or resource in the OTA
path, it can cause unremovable device-mapper devices. The companion CL
in this topic attempts to diagnose such problems by performing a quick
scan for things depending on an unremovable block device: mounts, loop
devices, and other device-mapper nodes.

To detect mounts it would normally be enough to scan /proc/mounts, but
with MNT_DETACH the filesystem may still be mounted but not visible to
update_engine. This is exactly what happened in b/184715543.

To scan for such cases, we look for /sys/fs/ext4/<name> or
/sys/fs/f2fs/<name> where <name> is the block device. To make this work,
we grant update_engine r_dir_perms to sysfs and sysfs_f2fs_dir. It
doesn't actually need to read the contents of any files, the presence of
the inode is good enough.

Bug: N/A
Test: manual test
Change-Id: Ib085c9c814180b360e2170135011261bbb7e35b6
2021-04-08 13:50:50 -07:00