Commit graph

47502 commits

Author SHA1 Message Date
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
Seungjae Yoo
41b4349206 [automerger skipped] Introduce vendor_microdroid_file for microdroid vendor image am: c3052c9ab0 -s ours am: 803f20b5a3 -s ours
am skip reason: Merged-In I6c966c92b238a2262d2eb7f41041ed4c359e9e0a with SHA-1 d2a0892121 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2974133

Change-Id: Ic9437442074bbdc06daa44a2d4041074ed2357d7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-26 02:21:02 +00:00
Seungjae Yoo
803f20b5a3 [automerger skipped] Introduce vendor_microdroid_file for microdroid vendor image am: c3052c9ab0 -s ours
am skip reason: Merged-In I6c966c92b238a2262d2eb7f41041ed4c359e9e0a with SHA-1 d2a0892121 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2974133

Change-Id: I6a8242a6da2ede1f9d3f27cfb3fc52bb452e7510
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-26 01:39:54 +00:00
Thiébaud Weksteen
66bb617447 Merge "Grant lockdown integrity to all processes" into main am: 1fc3a6f955
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2971071

Change-Id: I21f3e67d0b697a532f65e4e21b8a193accca521a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-26 00:34:52 +00:00
Jooyung Han
a53593f6fa Merge "Add input_device.config_file.apex property" into main am: 615aaf5998
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2974852

Change-Id: I08eec3e2cd297b70d84ea92aa07159bd1b70d91e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-26 00:34:01 +00:00
Thiébaud Weksteen
1fc3a6f955 Merge "Grant lockdown integrity to all processes" into main 2024-02-26 00:11:52 +00:00
Jooyung Han
615aaf5998 Merge "Add input_device.config_file.apex property" into main 2024-02-25 23:51:05 +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
Kiyoung Kim
3259d12935 Mark libft2.so and libpng.so installed in /vendor/lib as sphal am: 96ba523a8d
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2974851

Change-Id: I1dca4fd56c01a6a27785985341325b7e0cc2506b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-23 15:53:30 +00:00
Kiyoung Kim
96ba523a8d Mark libft2.so and libpng.so installed in /vendor/lib as sphal
libft2.so is removed from LLNDK, as it was LLNDK-private just because it is
referenced from VNDK-SPs, but it is no longer true because of VNDK
deprecation. This change adds libft2.so to have same sepolicy with other
sphal libraries, so it can be loaded from sphal libraries same as
before. Mark same to libpng.so as it is referenced from libft2.so

Bug: 326402649
Test: Barbet boot succeeded without sepolicy error
Change-Id: Id8c1194da478bd4fc02e701230fd1a3c0b3c00be
2024-02-23 05:31:59 +00: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
Seungjae Yoo
c3052c9ab0 Introduce vendor_microdroid_file for microdroid vendor image
In AVF, virtualizationmanager checks the selinux label of given disk
image for proving whether the given image is edited maliciously.
Existing one(vendor_configs_file, /vendor/etc/*) was too wide to
use for this purpose.

Bug: 325709490
Bug: 285854379
Test: m
Merged-In: I6c966c92b238a2262d2eb7f41041ed4c359e9e0a
Change-Id: I6c966c92b238a2262d2eb7f41041ed4c359e9e0a
(cherry picked from commit d2a0892121)
2024-02-23 11:36:29 +09:00
Steven Moreland
cfed32d4ff Merge changes from topic "misctrl" into main am: 9fca32695a
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2966594

Change-Id: Id68b57052b905fd3aab14f17f1eb7e81913d7e05
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-22 19:16:50 +00:00
Steven Moreland
d7c3bf781e intro misctrl am: b4f42d449b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2966593

Change-Id: Ie652cf5516fe3c1042931bb07162f39996180e66
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-22 19:16:46 +00: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
d02b052624 Merge "Add virtualization_maintenance_service" into main am: d2bc72b7eb
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2967637

Change-Id: Ib5539a82cb00a141c3c4d9877acb7195f853107d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-22 10:33:00 +00:00
Alan Stokes
d2bc72b7eb Merge "Add virtualization_maintenance_service" into main 2024-02-22 09:45:13 +00:00
Treehugger Robot
444ca3ef45 Merge "Reland "[res] Allow accessing idmap files in all zygotes"" into main am: b4d6657a5c
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2970351

Change-Id: I61de789991aeb6254b9d2f80bff9a65f06c4b533
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-22 09:07:53 +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
3fbbe8f2ab Merge "Allow shell/toolbox for all domains" into main am: b08b54e735
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2968882

Change-Id: I27a83570324b203d1c2eb86adc82dcc5fec1db8e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-22 06:19:57 +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
Yisroel Forta
dc79d84476 Add context that system server can access and perfetto can save traces to am: c5cb5a248d
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2965922

Change-Id: I3e286eb5cfb4de9fc80eb8462fb183d67898db98
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-21 22:38:05 +00: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
David Drysdale
bd6d03f58b Allow virtualizationservice to check parent dir am: a9d70d7ba8
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2967573

Change-Id: I915ec4bc0144cc9a1a9ac20525f48ad1b33af3d7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-21 11:39:06 +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
d63c142e10 Allow virtualizationserver->ISecretkeeper am: 3242c6a271
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2967566

Change-Id: I4c11744bb369f0fb72869f7a74f2adda7ec40079
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-20 09:03:00 +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
Treehugger Robot
8dae0dd2db Merge "Support multiple se_flags modules" into main am: f9f826fb30
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2963582

Change-Id: Ie6758c95131388b40c8731151529672e271dc430
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-19 05:01:22 +00:00
Treehugger Robot
f9f826fb30 Merge "Support multiple se_flags modules" into main 2024-02-19 04:30:04 +00:00
Jooyung Han
454fadc9bf Merge "Revert^2 "Relax neverallows for vendor to use /system/bin/sh"" into main am: 77b2a438fc
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2967262

Change-Id: Ifc691316b223ba8bf5ddb3f2a4fad43afb580fdb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-19 02:12:48 +00:00
Jooyung Han
77b2a438fc Merge "Revert^2 "Relax neverallows for vendor to use /system/bin/sh"" into main 2024-02-19 02:03:06 +00:00
Inseob Kim
b42fd4cb3d Merge "label boot animations on oem with bootanim_oem_file" into main am: d1fada7e61
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2964524

Change-Id: I281fea83a7dc0144e7dc4383a61d7485688808f8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-19 01:51:41 +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
Jooyung Han
9a123be434 Revert^2 "Relax neverallows for vendor to use /system/bin/sh"
This reverts commit f77cf6780c.

Reason for revert: sepolicy change is still necessary. (won't break things)

Change-Id: If47218b39ac34c21f3e09d29a5e713b240c4f0a6
2024-02-16 11:06:40 +00:00
Jernej Virag
dd1b00fa71 Merge "Revert "Relax neverallows for vendor to use /system/bin/sh"" into main am: bbff9f5ea1
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2967124

Change-Id: I41a1e6a99a393eaada22f0df0ce0a86b90200d11
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-16 10:49:56 +00:00
Jernej Virag
bbff9f5ea1 Merge "Revert "Relax neverallows for vendor to use /system/bin/sh"" into main 2024-02-16 10:13:22 +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
Joonhun Shin
f77cf6780c Revert "Relax neverallows for vendor to use /system/bin/sh"
Revert submission 2964802-sh_path

Reason for revert: <b/325569171>

Reverted changes: /q/submissionid:2964802-sh_path

Change-Id: I89e635e742d8f4f8a79afa1bb2646c7621705994
2024-02-16 09:22:42 +00:00
Jooyung Han
7f41c9d97c Merge "Relax neverallows for vendor to use /system/bin/sh" into main am: 0ae95839d3
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2964802

Change-Id: If2cb6ee085b393d62a4884b2c3959fbb2a0bb078
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-16 07:58:34 +00:00
Inseob Kim
bf7f4a4401 Support multiple se_flags modules
Instead of centralized one se_flags module under system/sepolicy,
additional se_flags modules can be defined anywhere to support defining
downstream branches' own flagging.

Bug: 321875465
Test: TH
Test: soong test
Change-Id: I6e45c859b7f09e27ba1d60033b0db1424472cb63
2024-02-16 16:14:40 +09:00
Jooyung Han
0ae95839d3 Merge "Relax neverallows for vendor to use /system/bin/sh" into main 2024-02-16 06:56:45 +00:00