Commit graph

10184 commits

Author SHA1 Message Date
Jeff Pu
a2ca79aff5 Merge "Support Face Virtual HAL operation latency randomization" into main 2024-01-16 20:05:41 +00:00
Pawan Wagh
25b1829463 Merge "Allow binder calls from system app to update engine" into main 2024-01-12 19:42:36 +00:00
Radu Solea
c477a4ad32 Merge "Add sepolicy for suspend.debug.wakestats_log.enabled" into main 2024-01-11 18:09:25 +00:00
Ján Sebechlebský
9416a4c91e Merge "Allow binder calls between virtual_camera / mediaserver & codecs." into main 2024-01-11 11:53:47 +00:00
Kangping Dong
582f3b2e34 Merge "[Thread] move Thread settings data to APEX data dir" into main 2024-01-09 11:58:42 +00:00
Akilesh Kailash
8765b78c68 Merge "snapuserd: sepolicy for setting task-profiles" into main 2024-01-09 04:51:32 +00:00
Pawan Wagh
c35c8affc3 Allow binder calls from system app to update engine
Allow system_app to call update engine and update engine
to call callback registered by system app.

Test: m Settings && adb install -r
$ANDROID_PRODUCT_OUT/system_ext/priv-app/Settings/Settings.apk,
Update using 16k dev option.
Bug: 295573133

Change-Id: Ice7e75f86283637ad67a675682ecd0d27038d9e7
2024-01-05 21:25:40 +00:00
Radu Solea
82db343e27 Add sepolicy for suspend.debug.wakestats_log.enabled
Add initial sepolicy for suspend.debug.wakestats_log.enabled
Allow set from init
Allow read by system suspend

Bug: 301657457
Test: manual
Change-Id: I1123e169d69eadb909ed474c0c246a8a45eab2f0
Signed-off-by: Radu Solea <radusolea@google.com>
2024-01-04 15:45:39 -08:00
Jeff Pu
16ea68ff90 Support Face Virtual HAL operation latency randomization
Bug: 294254230
Test: atest android.hardware.biometrics.face.*
Change-Id: I40b71a6eba91615d44b0bdcc977e3a51cec83ca1
2024-01-04 17:29:24 -05:00
Kyle Zhang
da5a09bcf9 Add neverallow rule for force l3 prop
Bug: 299987160
Change-Id: I17a02316a725578fbc5595ba88cb7ba9b1fd82e8
2024-01-04 01:07:41 +00:00
Kangping Dong
e21496b105 [Thread] move Thread settings data to APEX data dir
This commit includes two sepolicy changes:
1. change threadnetwork data file to
/data/misc/apexdata/com.android.tethering/threadnetwork
2. use apex_tethering_data_file for files under
   /data/misc/apexdata/com.android.tethering

The background is that the Thread daemon (ot_daemon) is merged into the
Tethering mainline module, which means the the Tehtering module now has
code running in both system_server and the standalone unprivileged
ot_daemon process. To prevent ot_daemon from accessing other
apex_system_server_data_file dirs, here use the specific
apex_tethering_data_file for both Tethering and Thread files (A
subdirectory threadnetwork/ will be created for Thread at runtime). This
is similar to apex_art_data_file and apex_virt_data_file.

Note that a file_contexts rule like
```
/data/misc/apexdata/com\.android\.tethering/threadnetwork(/.*)?  u:object_r:apex_threadnetwork_data_file:s0
```
won't work because the threadnetwork/ subdir doesn't exist before the
sepolicy rules are evaluated.

Bug: 309932508
Test: manually verified that Thread settings file can be written to
      /data/misc/apexdata/com.android.tethering/threadnetwork
Change-Id: I66539865ef388115c8e9b388b43291d8faf1f384
2024-01-03 23:01:24 +08:00
Inseob Kim
fb0ed7fcc4 Fix denial due to vfio_handler's IBoundDevice
As virtualizationmanager holds references to IBoundDevice returned by
vfio_handler, virtualizationmanager should also have permission to
binder_call.

Bug: 278008519
Test: boot microdroid with assigned devices
Change-Id: I7b87de099b0731c386666cec215807dc39d8c89c
2024-01-03 09:35:43 +09:00
Akilesh Kailash
047bc6669f snapuserd: sepolicy for setting task-profiles
Post OTA reboot, snapshot-merge threads will be run in the background cgroup so that they don't run on big cores. Hence, use SetTaskProfiles() API to move the thread to the relavant cgroup.

When setting SetTaskProfile API, /dev/cpuset/background/tasks path
is accessed which requires process to be in system group.

Use setgid to move the task to system group.

Bug: 311233916
Test: OTA on Pixel 6 - Verify that merge threads are not run on big
cores
Change-Id: Ie4921910985292b0b05f4ffc70b0d08ad9e4a662
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-12-29 23:02:17 +00:00
Jan Sebechlebsky
0fd6d1bd26 Allow binder calls between virtual_camera / mediaserver &
codecs.

This is required to allow Surface originating from
virtual_camera to be used by mediaserver & writen
to by codecs(for example to decode video into the
surface usign MediaPlayer).

Bug: 301023410
Test: Virtual Camera Test app
Change-Id: I2cac88accd4e1777f6c441c012cd0d36579a55e5
2023-12-27 17:26:52 +01:00
Steven Moreland
c0b40ed274 Merge "dumpstate += config_gz permission" into main 2023-12-21 23:23:20 +00:00
Alan Stokes
4639e046bc Merge "Allow su to access virtualization" into main 2023-12-21 09:04:27 +00:00
Steven Moreland
832dc374a6 dumpstate += config_gz permission
Bug: 317262099
Test: bugreport & check contents
Change-Id: Idd7ab04954e26a7b210c232ae8ac114b7ff64bf7
2023-12-21 01:22:13 +00:00
Tom Chan
58a63988e3 Merge "Update wearable_sensing_service to app_api_service" into main 2023-12-20 18:44:31 +00:00
Devin Moore
babb7070a5 Merge "Allow hidl_allocator_default service to set its own prop" into main 2023-12-20 16:46:01 +00:00
Alan Stokes
8b4d612fd7 Allow su to access virtualization
Use our standard macro for granting all the necessary permissions
instead of copying a part of it.

Add ioctl access for all clients for Unix stream sockets & pipes; this
allows them to be used for stdin/stdout without triggering
denials. (Only unpriv_sock_ioctls can be used.)

Together this allows a root shell to use `vm run` without getting
spurious denials such as:

avc:  denied  { ioctl } for  comm="crosvm" path="socket:[835168]"
dev="sockfs" ino=835168 ioctlcmd=0x5401 scontext=u:r:crosvm:s0
tcontext=u:r:su:s0 tclass=unix_stream_socket permissive=0

Bug: 316048644
Test: adb root,  adb shell /apex/com.android.virt/bin/vm run-microdroid
Test: atest MicrodroidTests
Change-Id: Ib5186c70714e295a770896cf8b628384f410b94d
2023-12-20 14:55:28 +00:00
Jeff Pu
6f873ffe82 Merge "Face Virtual HAL lockout support" into main 2023-12-20 14:45:23 +00:00
Alan Stokes
b5061088c8 Merge "Tweak sysfs_dt_avf permissions" into main 2023-12-20 09:41:02 +00:00
Jeff Pu
3c79af1f7c Face Virtual HAL lockout support
Bug: 294254230
Test: atest android.hardware.biometrics.face.FakeLockoutTrackerTest
Change-Id: If7fb024b2ab5d017f5255edf484c487f5406bb9b
2023-12-19 13:28:25 -05:00
Alan Stokes
ac5044870b Tweak sysfs_dt_avf permissions
Allow r_file_perms rather than just open+read, mainly because I saw
this denial:

avc:  denied  { getattr } for  comm="binder:11247_2"
path="/sys/firmware/devicetree/base/avf/guest/common/log"
dev="sysfs" ino=16469 scontext=u:r:virtualizationmanager:s0
tcontext=u:object_r:sysfs_dt_avf:s0 tclass=file permissive=0

Also refactor slightly in microdroid_manager.te.

Test: TH
Change-Id: If2963441b3490a502c293c7a7cdd204d9db7d48a
2023-12-19 17:42:05 +00:00
Devin Moore
01b91e790d Allow hidl_allocator_default service to set its own prop
This prop is read in its .rc file to stop the service. Otherwise,
evertyime the service exits, it is restarted.
We don't want it to be `oneshot` because under normal operation, it
should be restarted if it exits/crashes.

Test: remove kTempHidlSupport && m && launch_cvd
Bug: 218588089

Change-Id: I9a4c61778c244a08ff753689604e79168058dd4c
2023-12-19 17:05:59 +00:00
Alessandra Loro
587d6a2846 Merge "Revert "bug_map selinux test failure"" into main 2023-12-19 14:47:37 +00:00
Hang Shi
cb24b4facf Merge "Bluetooth LMP Events: Add Lmp Events Hal" into main 2023-12-19 02:34:53 +00:00
Tom Chan
4409ea458f Update wearable_sensing_service to app_api_service
Being a system_api_service prevents non-privileged apps from getting a reference to WearableSensingManager via Context#getSystemService (it returns null). CTS tests are run as non-privileged apps, so we need this change to properly test the API.

The API methods are protected by a signature|privileged permission. CTS tests can gain this permission by adopting the Shell's permission identity, but it can't get around the SELinux policy.

wearable_sensing_service is mostly modelled after ambient_context_service, which is an app_api_service, so we believe this change is fine from a security's perspective.

Test: A CTS test can get a WearableSensingManager via Context#getSystemService after this change.

Change-Id: I9d854353f48ff7b3fa5a07527bee0bcc83cb6236
2023-12-18 22:02:06 +00:00
Peter Collingbourne
fe69f400db Merge "Mount /tmp as tmpfs." into main 2023-12-18 21:39:38 +00:00
Treehugger Robot
cbfdcc450e Merge "Revert "bugmap selinux failure"" into main 2023-12-18 16:01:25 +00:00
Alessandra Loro
b7d3e34182 Revert "bug_map selinux test failure"
This reverts commit 7a8028bbb4.

Reason for revert: Fixed via aosp/2869455

Bug: 308043377
Change-Id: I2b9a4094c1e19455ac135d204efe0811cb922ffa
2023-12-18 15:29:44 +00:00
Alessandra Loro
0a9f5d4c1f Revert "bugmap selinux failure"
This reverts commit 6aa75739d5.

Reason for revert: Fixed via aosp/2869455

Bug: 308043377
Change-Id: Id9d6e1abaa4b60b775123c0b7ba2f19368234848
2023-12-18 14:59:51 +00:00
Brian Lindahl
0027546b06 Merge "Revert "bugmap selinux failure"" into main 2023-12-18 14:29:22 +00:00
Peter Collingbourne
4912d266e1 Mount /tmp as tmpfs.
/tmp is a volatile temporary storage location for the shell user.
As with /data/local/tmp, it is owned by shell:shell and is chmod 771.

Bug: 311263616
Change-Id: Ice0229d937989b097971d9db434d5589ac2da99a
2023-12-15 16:46:46 -08:00
Treehugger Robot
f336eec750 Merge "traced_probes: allow perfetto to read /proc/pressure entries" into main 2023-12-15 23:06:32 +00:00
Jared Duke
8db0b2be1e traced_probes: allow perfetto to read /proc/pressure entries
Allow perfetto to read /proc/pressure/* entries for cpu/io/memory.

Test: Capture perfetto psi traces manually
Bug: 315152880
Change-Id: I08c3d3eca39ee65eb3f93d609a8ef7cf9c25f6a0
2023-12-15 19:15:57 +00:00
Yu-Ting Tseng
4de7a537b0 Merge "Revert^2 "Update uprobestats SELinux policy"" into main 2023-12-15 18:02:57 +00:00
Jiakai Zhang
32c47c94be Merge "Allow watchdog to dump artd." into main 2023-12-15 15:27:26 +00:00
Treehugger Robot
c45d9f8263 Merge "Revert^2 "virtualizationmanager is a client of secretkeeper"" into main 2023-12-15 12:37:43 +00:00
Shikha Panwar
c9b992126c Revert^2 "virtualizationmanager is a client of secretkeeper"
It ferries SecretManagement messages to/from Sk. Reflect this is
sepolicies.

Test: With topic, check selinux denials
Bug: 291213394
Change-Id: Ia0d25e46232d56c59fb18f8642767bfa2d5ffab1
2023-12-15 11:23:54 +00:00
Treehugger Robot
d5f372ff3c Merge "Add lmk pressure_after_kill_min_score prop" into main 2023-12-15 06:27:08 +00:00
Treehugger Robot
28b5f9afd4 Merge "Allow remount to update the super partition." into main 2023-12-15 01:43:49 +00:00
Yu-Ting Tseng
43cae4ea24 Revert^2 "Update uprobestats SELinux policy"
This reverts commit 5e1d7f1c85.

Reason for revert: retry with a fix to the failed tests

Test: atest art_standalone_oatdump_tests
Change-Id: I28872c643ba4ec07ef41b1f9be86036c592a6e4e
2023-12-14 17:17:18 -08:00
Matt Stephenson
531cdc930f Add lmk pressure_after_kill_min_score prop
Add ro.lmk.pressure_after_kill_min_score property to config.

Test: pressure_after_kill_min_score applies if SELinux is enabled
Bug: 316242513
Change-Id: Ie974fb3eddc0c1bc5c28b2c11d516b152c390396
2023-12-14 23:36:56 +00:00
Trevor Black
dcef23db69 Revert "virtualizationmanager is a client of secretkeeper"
Revert submission 2705357-sk_vm

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.corp.google.com/builds/quarterdeck?branch=git_aosp-main-with-phones&target=aosp_oriole-trunk_staging-userdebug&lkgb=11221468&lkbb=11221626&fkbb=11221480

Reverted changes: /q/submissionid:2705357-sk_vm

Bug: 316391577
Change-Id: Ibc92e4b2c578cdf210e873d82af0f413d6a37dc0
2023-12-14 20:29:33 +00:00
Shikha Panwar
e6c5f205e0 virtualizationmanager is a client of secretkeeper
It ferries SecretManagement messages to/from Sk. Reflect this is
sepolicies.

Test: With topic, check selinux denials
Bug: 291213394
Change-Id: I0acc06424eb834d66a85f9d4f6b8b632d95c4190
2023-12-14 17:05:16 +00:00
Treehugger Robot
cc90a2a0c6 Merge "sepolicy: grant network_stack CAP_WAKE_ALARM" into main 2023-12-13 20:55:37 +00:00
David Anderson
17fbd9c607 Allow remount to update the super partition.
"adb remount" runs the remount command, which needs to be able to update
bits in the super partition metadata. This change only affects
userdebug_or_eng policy.

Bug: 297923468
Test: adb-remount-test.sh
Change-Id: Ia78d4b0ea942a139c8a4070dc63a0eed218e3e18
2023-12-13 12:09:30 -08:00
Franklin Abreu Bueno
a3bfb1485e Bluetooth LMP Events: Add Lmp Events Hal
Bug: 281503650
Change-Id: Ie9fa616d4142c554c30e5b45b625203387edb9a7
2023-12-13 12:02:33 -08:00
Maciej Żenczykowski
fd0efeb043 sepolicy: grant network_stack CAP_WAKE_ALARM
It is effectively an oversight that bluetooth has this
but network stack does not.

This prevents the network stack process from (for example)
using timerfd_create with CLOCK_{REAL,BOOT}TIME_ALARM,
without trampolining through parts of the mainline module
which are shipped as part of the system server.

See:
  https://man7.org/linux/man-pages/man2/timerfd_create.2.html

Bug: 316171727
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iba95c80f830784a587fa4df6867a99bcb96ace79
2023-12-13 18:52:51 +00:00