Commit graph

10293 commits

Author SHA1 Message Date
Treehugger Robot
a3a3559743 Merge "tracefs: remove debugfs/tracing rules on release devices" into main 2024-03-05 13:33:02 +00:00
Ryan Savitski
d7a3de50a3 Merge "tracefs: allow using "/sys/kernel/tracing/buffer_percent" on release devices" into main 2024-03-05 12:04:12 +00:00
Kangping Dong
564f1296b8 Merge "[Thread] limit ot-daemon socket to ot-ctl" into main 2024-03-05 11:18:56 +00:00
Matt Buckley
19cb4c541f Merge "Allow apps to access PowerHAL for FMQ" into main 2024-03-04 22:22:41 +00:00
Stefan Andonian
79d1388d86 Merge "Enable platform_app to use perfetto/trace_data_file permissions in debug/eng builds." into main 2024-03-04 20:23:11 +00:00
Ján Sebechlebský
f8ab94fa08 Merge "Allow virtual camera to use fd's from graphic composer" into main 2024-03-04 15:20:49 +00:00
Dennis Shen
3041c33c91 Merge "aconfig_storage: setup RO partitions aconfig storage files SELinux policy" into main 2024-02-29 19:03:00 +00:00
Kangping Dong
90495cc79f [Thread] limit ot-daemon socket to ot-ctl
It's better to explicitly disallow access to ot-daemon from other than
ot-ctl.

Bug: 323502847
Change-Id: Ic46ad4e8f3a1d21bbfc9f4f01e6a692aafcdb815
2024-02-29 23:43:34 +08:00
Dennis Shen
f008c29e47 aconfig_storage: setup RO partitions aconfig storage files SELinux
policy

system, system_ext, product and vendor partitions have aconfig storage
files under /<partition>/etc/aconfig dir. need to grant access to
aconfigd.

Bug: b/312459182
Test: m and tested with AVD
Change-Id: I9750c24ffa26994e4f5deadd9d772e31211a446a
2024-02-29 15:28:48 +00:00
Stefan Andonian
ff413fd7d0 Enable platform_app to use perfetto/trace_data_file permissions in
debug/eng builds.

This change is to allow SystemUI, a platform_app, to start, stop,
and share Perfetto/Winscope traces.

Bug: 305049544
Test: Verified everything works on my local device.
Change-Id: I8fc35a5a570c2199cfdd95418a6caf0c48111c46
2024-02-28 20:31:44 +00:00
Dennis Shen
067f7db593 Merge "aconfigd: create aconfig daemon selinux policy" into main 2024-02-28 12:31:26 +00:00
Matt Buckley
52c9b3b9a9 Allow apps to access PowerHAL for FMQ
This patch allows apps to access PowerHAL FMQ memory to send ADPF
messages.

Test: n/a
Bug: 315894228
Change-Id: I2733955807c40e63b688fcb0624db8acc8f9a139
2024-02-27 16:35:55 -08:00
Florian Mayer
9d7d3c4a0e Merge "Allow shell and adb to read tombstones" into main 2024-02-26 21:12:25 +00:00
Dennis Shen
2659257c76 aconfigd: create aconfig daemon selinux policy
Bug: b/312444587
Test: m and launch avd
Change-Id: I0156a9dee05139ec84541e0dff2f95285c97cfb9
2024-02-26 19:58:48 +00:00
Jan Sebechlebsky
fd7e285504 Allow virtual camera to use fd's from graphic composer
This is causing denials in case the fence fd comes from
graphic composer.

Bug: 301023410
Test: atest CtsCameraTestCases with test virtual camera enabled
Change-Id: I14cb26c058342470aa2dc214ab47cc61aa2f3255
2024-02-26 11:55:16 +01:00
Thiébaud Weksteen
1fc3a6f955 Merge "Grant lockdown integrity to all processes" into main 2024-02-26 00:11:52 +00:00
Ryan Savitski
ce8959c851 tracefs: remove debugfs/tracing rules on release devices
The tracing filesystem used to be mounted on /sys/kernel/debug/tracing,
but is nowaways available at /sys/kernel/tracing.

Since debugfs itself is no longer mounted on release devices, there is
no need for rules that relax specific .../debug/tracing/... files to be
available on release devices. Leave them as debugfs_tracing_debug.

Not touching other labels such as debugfs_tracing_printk_formats in case
there are debug-only tools that grant themselves access to just that
label. Might revisit those in a different patch.

Bug: 303590268
Change-Id: Ic234c73ac7256117179c4b3eb35da0eac9a50eaa
2024-02-25 19:16:56 +00:00
Ryan Savitski
bdf0a56bf3 tracefs: allow using "/sys/kernel/tracing/buffer_percent" on release devices
This is a tracing control file that userspace can read/write an ascii
number (e.g. "50"). In turn, it controls the behaviour of blocking
read(), splice(), and poll() on the tracing kernel ring buffer fds.
A blocked syscall will only be woken up once the kernel fills the buffer
past the "buffer_percent" watermark (so 50% -> half-full).

We'll be using this file in perfetto's traced_probes, but it should also
be safe to expose to other users of the tracing file system (aka
debugfs_tracing in sepolicy) on release builds.

Added to linux in:
  https://android.googlesource.com/kernel/common/+/03329f99

Change-Id: Ifcdc73cb0162e8cdadf2e7c16b0215410134ccae
2024-02-25 19:00:07 +00:00
Florian Mayer
6c689e8438 Allow shell and adb to read tombstones
tombstones are now openable by these domains:

allow adbd tombstone_data_file:dir { getattr ioctl lock open read search watch watch_reads };
allow adbd tombstone_data_file:file { getattr ioctl lock map open read watch watch_reads };
allow dumpstate tombstone_data_file:dir { getattr ioctl lock open read search watch watch_reads };
allow dumpstate tombstone_data_file:file { getattr ioctl lock map open read watch watch_reads };
allow init tombstone_data_file:dir { add_name create getattr ioctl open read relabelfrom relabelto remove_name rmdir search setattr write };
allow init tombstone_data_file:fifo_file { create getattr open read relabelfrom relabelto setattr unlink };
allow init tombstone_data_file:file { create getattr map open read relabelfrom relabelto setattr unlink write };
allow init tombstone_data_file:sock_file { create getattr open read relabelfrom relabelto setattr unlink };
allow shell tombstone_data_file:dir { getattr ioctl lock open read search watch watch_reads };
allow shell tombstone_data_file:file { getattr ioctl lock map open read watch watch_reads };
allow system_server tombstone_data_file:dir { add_name getattr ioctl lock open read remove_name search watch watch_reads write };
allow system_server tombstone_data_file:file { append create getattr ioctl lock map open read rename setattr unlink watch watch_reads write };
allow tombstoned tombstone_data_file:dir { add_name getattr ioctl lock open read remove_name search watch watch_reads write };
allow tombstoned tombstone_data_file:file { append create getattr ioctl link lock map open read rename setattr unlink watch watch_reads write };

Test: adb unroot, ls, cat, adb pull
Bug: 312740614
Change-Id: I4a1af4fbdc48c5c5f4b0b33f124cea31af74dd87
2024-02-23 15:44:20 -08:00
Jooyung Han
c6d75293b9 Add input_device.config_file.apex property
This new property is to set an apex name when input configuration files
are bundled in an apex.

libinput checks the new sysprop when loading input configuration.

This removes hard-coded apex name (com.android.input.config).

Bug: 315080500
Test: adb shell dumpsys input
  # set "touch.orientationAware = 0" in Touchscreen_0.idc
  # build/install the input config apex
  # Observe the Input configuration
  # "Touch Input Mapper" shows "OrientationAware: false"
Change-Id: Ie0bf30bff2ed7f983caa5b893994a5bd2759e192
2024-02-23 14:31:58 +09:00
Steven Moreland
9fca32695a Merge changes from topic "misctrl" into main
* changes:
  misctrl: add a property
  intro misctrl
2024-02-22 18:57:01 +00:00
Alan Stokes
d2bc72b7eb Merge "Add virtualization_maintenance_service" into main 2024-02-22 09:45:13 +00:00
Treehugger Robot
b4d6657a5c Merge "Reland "[res] Allow accessing idmap files in all zygotes"" into main 2024-02-22 08:42:02 +00:00
Treehugger Robot
b08b54e735 Merge "Allow shell/toolbox for all domains" into main 2024-02-22 05:48:44 +00:00
Thiébaud Weksteen
99a4cbcee7 Grant lockdown integrity to all processes
The default policy for the "lockdown" access vector on Android was
introduced in commit bcfca1a6. While the "confidentiality" permission
was granted to all processes, the "integrity" was marked as
neverallowed.

Upstream, the support for that access vector was removed from kernel
5.16 onwards.

It was found that the "integrity" permission either does not apply to
Android or duplicates other access control (e.g., capabilities
sys_admin).

Instead of simply removing the neverallow rule, the access is granted to
all processes. This will prevent the proliferation of references to this
access vector in vendors' policies and ultimately facilitate its
removal.

Test: presubmit
Bug: 285443587
Bug: 269377822
Bug: 319390252
Change-Id: If2ad34fbbf2c0d29ac54ab5d1be430623f86f1f7
2024-02-22 12:20:38 +11:00
Steven Moreland
9f41fc081f misctrl: add a property
misctrl can set properties which can be injected into
bugreports.

Limit visibility of these properties so that no device
code can branch based off these properties.

Bug: 317262681
Test: bugreport
Change-Id: I74f6f240b08b2681540bca262dcc76bcdca9cdad
2024-02-21 18:16:49 +00:00
Yisroel Forta
c5cb5a248d Add context that system server can access and perfetto can save traces to
Give perfetto rw dir and create file permissions for new directory.
Give system server control to read, write, search, unlink files from new directory.

Test: locally ensure traces can be written by perfetto and accessed and deleted by system server
Bug: 293957254
Change-Id: Id015429b48ffffb73e7a71addddd48a22e4740bf
2024-02-21 16:43:57 +00:00
Jooyung Han
66c5beaecc Allow shell/toolbox for all domains
Bug: 324142245
Test: m (presubmit)
Change-Id: If408294d31c66241eca938ee2a681e6a9cf37ee2
2024-02-21 11:13:14 +09:00
Yurii Zubrytskyi
9128735f1f Reland "[res] Allow accessing idmap files in all zygotes"
This reverts commit 7ee66a0391.

Reason for revert: The change is supposed to be a noop, trying it as a separate CL now

Change-Id: I0a1befb0015f39596423da7049040de6be18db65
2024-02-20 20:49:37 +00:00
Steven Moreland
b4f42d449b intro misctrl
Generic binary for managing the misc partition.

Bug: 317262681
Test: boot, check bugreport
Change-Id: Ib172d101d68409f2500b507df50b02953c392448
2024-02-20 18:56:05 +00:00
Alan Stokes
38131e7ba8 Add virtualization_maintenance_service
This is an AIDL service exposed by Virtualization Service to system
server (VirtualizationSystemService).

The implementation is Rust so no fuzzer is required.

I've put this behind the flag on general principle.

Bug: 294177871
Test: atest MicrodroidTests
Change-Id: Ia867fe27fb2e76d9688e4ba650ebf7b3f51ee597
2024-02-20 17:08:28 +00:00
David Drysdale
a9d70d7ba8 Allow virtualizationservice to check parent dir
Needed for SQLite database creation

Test: boot Cuttlefish, printf debugging
Bug: 294177871
Change-Id: I9ec2a8956c501ddea9514ea07a7c89d09b027dd3
2024-02-20 12:04:39 +00:00
David Drysdale
3242c6a271 Allow virtualizationserver->ISecretkeeper
Test: build and run in CF, see connection
Change-Id: I2d6f0c3836c4de061a456039ded899b4d3a3e7f5
2024-02-19 15:29:33 +00:00
Inseob Kim
d1fada7e61 Merge "label boot animations on oem with bootanim_oem_file" into main 2024-02-19 01:21:00 +00:00
Håkan Kvist
1f915b4b13 label boot animations on oem with bootanim_oem_file
Bootanimation only access boot animation files on oem. Label
these files with bootanim_oem_file and remove oemfs file allow rule.

Also allow mediaserver and app to read this new label as they can access
/oem/media folder.

Bug: 324437684
Test: Confirm that boot animation on oem is shown without violations
Change-Id: I940ccde9391a5daa920f31926d32e68b1de5b7eb
2024-02-16 11:08:30 +01:00
Trevor David Black
4105da26f9 Add fifo_file read access to enable gpuservice within device cts
Bug: 299537644
Test: atest -c CtsGraphicsTestCases:VulkanFeaturesTest#testAndroidBaselineProfile2021Support
Change-Id: Iab5c4255f01317c197488158ef8cc63fcf0ebb3b
2024-02-15 22:21:30 +00:00
Mikhail Naganov
ead55ce93a Merge "Add ro.audio.ihaladaptervendorextension_enabled property" into main 2024-02-15 17:08:10 +00:00
Dennis Shen
537a704088 Merge "selinux setup for files under /metadata/aconfig dir" into main 2024-02-15 13:20:02 +00:00
Tej Singh
aebd92592a Merge "stats_service: only disallow untrusted access" into main 2024-02-15 08:30:19 +00:00
Tej Singh
000b251c7d stats_service: only disallow untrusted access
Allow device-specific domains to access stats_service. All access must
be done over proper APIs (StatsManager, AStatsManager) instead of
accessing the AIDL interfaces directly.

Test: build
Bug: 318788254
Change-Id: I98ddc1900350daf755372be7249f25a462e3242d
2024-02-14 15:07:21 -08:00
Mikhail Naganov
8b69e5fd48 Add ro.audio.ihaladaptervendorextension_enabled property
This property is used by libaudiohal@aidl to detect whether
the system_ext partition provides an instance of
IHalAdapterVendorExtension. This is a "system internal"
property because it belongs to `system_ext`.

Bug: 323989070
Test: atest audiorouting_test
Ignore-AOSP-First: coupled with Pixel change, will upstream
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:17406cd0a723cb89a03705709ec78d37b3d66042)
Merged-In: I81267da070958a70f2f3c4882718cac4600e3476
Change-Id: I81267da070958a70f2f3c4882718cac4600e3476
2024-02-14 18:53:37 +00:00
Dennis Shen
6c8210da20 selinux setup for files under /metadata/aconfig dir
1, /metadata/aconfig is the directory that stores aconfig storage
related protobuf files and flag value files boot copy. Grant read
access to everybody. But limit the write access only to init and
aconfig storage service process (to be created later)

2, /metadata/aconfig/flags is the sub directory that stores persistent
aconfig value files.Initially set it up to be accessible by
system_server process only . When aconfig storage service process is
created, will add another permission to storage service process.

Context to why we are hosting flag data on /metadata partition:

Android is adopting trunk stable workflow, flagging and A/B testing is
essential to every platform component. We need some place to host the
flag that are accessible to system processes that starts before /data
partition becomes available.

In addition, there has been a long discussion regarding utilizing
/metadata partition for some process data, another example is mainline
modules, we are trying to make them to be able to be mounted earlier,
but cannot due to /data availability.

Bug: 312444587
Test: m
Change-Id: I7e7dae5cf8c4268d71229c770af31b5e9f071428
2024-02-14 17:56:29 +00:00
Patrick Baumann
7ee66a0391 Revert "[res] Allow accessing idmap files in all zygotes"
This reverts commit 1195b5eb14.

Reason for revert: b/325161357

Change-Id: I7e6846791020938fb732311105e0f692c648a0f1
2024-02-14 16:24:59 +00:00
Yurii Zubrytskyi
1195b5eb14 [res] Allow accessing idmap files in all zygotes
Resources now cache open idmap fds to speed up the up-to-date
checks, and this requires zygote processes to be able to access
them

Bug: 282215580
Test: atest android.text.cts.EmojiTest
Change-Id: I808be8a5d321a01193e7f76e316f5f64d4235753
2024-02-14 02:04:55 +00:00
Seungjae Yoo
01c4f57431 Allow appdomain to read dir and files under vendor_microdroid_file
For testing purpose, now we need to use microdroid vendor image for the
production due to vendor hashtree digest value comes from the
bootloader. In the past, we've used distinguished image file for testing
purpose, but we can't now.

Bug: 323768068
Test: atest MicrodroidTests#bootsWithVendorPartition
Test: atest MicrodroidBenchmarks#testMicrodroidDebugBootTime_withVendorPartition
Change-Id: Ic58e51466da0273cf27219d9228f33000e0ecb88
2024-02-13 05:44:15 +00:00
Treehugger Robot
f80a830b32 Merge "Add rules for Perfetto to be used from system_server" into main 2024-02-12 20:51:16 +00:00
Nate Myren
a8f2bbf7c2 Merge "Remove mounton from app and web zygote" into main 2024-02-12 20:13:33 +00:00
Carmen Jackson
28b811df1c Add rules for Perfetto to be used from system_server
This includes rules for starting Perfetto as well as rules for
communicating over stdio between Perfetto and system_server.

Bug: 293957254
Test: Presubmit & tested in conjunction with internal change
Change-Id: I7e4c044a6a2afb48c33d65cc421e797d77aacc12
2024-02-12 18:33:32 +00:00
Yisroel Forta
e510cb8696 Merge "SELinux permissions for ProfilingService" into main 2024-02-12 14:22:31 +00:00
Yisroel Forta
aa9d0bf24c SELinux permissions for ProfilingService
Test: Presubmit, manually confirm service accessible
Bug: 293957254
Change-Id: I7103be95ff49eb87b4c7164a38a481034d72a9aa
2024-02-09 19:25:32 +00:00