Commit graph

10487 commits

Author SHA1 Message Date
Thiébaud Weksteen
6772c50574 Define new kernel security classes
Define new classes and access vectors recognised by the kernel.

Bug: 340491179
Test: boot and check logs for undefined class or permission
Change-Id: I9b32916ea231cf396aa326ed7e08cb14e4eb2c9b
2024-05-15 04:45:20 +00:00
Jiakai Zhang
be2e719598 Allow mounting and unmounting functionfs.
Pixel has /dev/usb-ffs/adb, /dev/usb-ffs/mtp, and /dev/usb-ffs/ptp in
type functionfs.

Bug: 311377497
Change-Id: Id9388a0d420c712962804f6441c86cfb3c4e9e62
Test: adb shell cmd jobscheduler run android 27873781
2024-05-09 04:03:18 +00:00
Devin Moore
ba99b14c5c Merge "Allow crash_dump to read misctrl properties" into main 2024-05-07 19:55:51 +00:00
Eric Laurent
df665c694b Allow native audio server to access the virtual device manager service
This is needed when accessing SensorManager since commit 71db5f82

Bug: 336860810
Test: make
Ignore-AOSP-First: needed on internal branch first
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:caad49e71d927e021575c3051d7d10ff7917e09c)
Merged-In: I303c6e3418ca5179c615c2c643fdf9783d323c78
Change-Id: I303c6e3418ca5179c615c2c643fdf9783d323c78
2024-05-07 00:21:30 +00:00
Devin Moore
49a4a06264 Allow crash_dump to read misctrl properties
This is used to determine if the device has been in 16k page size mode
to help debug issues with that.

Test: debuggerd_test with ro.misctl.16kb_before="1"
Bug: 335247092
Change-Id: I7b5fcd39cc5b3247d866814fbcf53299d68846c2
2024-05-06 15:40:12 +00:00
Treehugger Robot
07dc4933ac Merge "Add policies for hal_codec2" into main 2024-05-03 17:20:45 +00:00
Dennis Shen
2ae5d42a79 Merge "selinux: allow system server access aconfigd socket" into main 2024-05-02 23:49:25 +00:00
Kalesh Singh
5f805d057e Merge "sepolicy: Add rules for /sys/kernel/mm/pgsize_migration/enabled" into main 2024-05-02 19:38:08 +00:00
Kalesh Singh
3a4c68dd83 sepolicy: Add rules for /sys/kernel/mm/pgsize_migration/enabled
The dynamic linker needs to read this node to determine how it should
load ELF files.

Allow the node to be enabled/disabled by init.

Bug: 330117029
Bug: 327600007
Bug: 330767927
Bug: 328266487
Bug: 329803029
Test: Free Fire Chaos App launches
Test: no avc deined in logcat
Change-Id: I2b35d6aebe39bf3e1e7489b47f23a817e477ef72
2024-05-02 19:34:36 +00:00
Pawan Wagh
c9b15f596b Merge "Allow system app and update_engine to read OTA from /vendor" into main 2024-05-02 19:28:44 +00:00
Dennis Shen
62f4363b39 selinux: allow system server access aconfigd socket
During storage migration, we need to route aconfig flag write requests
from settingsprovider to aconfig storage daemon via aconfigd unix domain
socket.

Bug: b/312444587
Test: m and avd
Change-Id: I051d1ed42bf51f2ebd90cbd590237cd9213f0bde
2024-05-02 18:20:25 +00:00
Sungtak Lee
8eed41c1aa Add policies for hal_codec2
Allow hal_codec2_server to read fifo_file from hal_codec2_client
Allow hal_codec2_client to find surfaceflinger_service:service_manager.

Bug: 337356582
Test: atest CtsMediaTranscodingTestCases
Change-Id: I76b2ca7d3caf7909d9d6df424eb5f68b1a0a6f03
2024-05-02 08:22:57 +00:00
Pawan Wagh
b071882d76 Allow system app and update_engine to read OTA from /vendor
Introuducing vendor_boot_ota_file which will be used to allow
reading OTAs from /vendor/boot_otas when BOARD_16K_OTA_MOVE_VENDOR := true
is set. These OTAs will be read from settings app(system_app) and update
engine.

Test: m, m Settings && adb install -r $ANDROID_PRODUCT_OUT/system_ext/priv-app/Settings/Settings.apk
Bug: 335022191
Change-Id: Ie42e0de12694ed74f9a98cd115f72d207f67c834
2024-05-02 01:14:47 +00:00
Ellen Arteca
c1508ec794 Add read permission to storage_area_keys to installd
Installd needs the read permission on storage area
key directories. This only comes up in testing when the tests
are rerun on the same device.

Bug: 325129836
Test: atest StorageAreaTest
Change-Id: I74c776c52d66492552aaf8b61c7591fb19194f7a
2024-05-01 17:49:26 +00:00
Treehugger Robot
77a8ac9ab4 Merge "Allow shell read access to cgroup state" into main 2024-04-30 20:54:07 +00:00
Ellen Arteca
7dd36bbb29 Merge "Add SELinux policy for storage areas" into main 2024-04-30 20:32:53 +00:00
Ellen Arteca
27b515e70a Add SELinux policy for storage areas
We are adding the ability for apps to create "storage areas", which are
transparently encrypted directories that can only be opened when the
device is unlocked.
This CL makes the required SELinux policy changes.

First, assign the type "system_userdir_file" to the new top-level
directory /data/storage_area (non-recursively).  This is the same type
used by the other top-level directories containing app data, such as
/data/user, and it restricts access to the directory in the desired way.

Second, add new types to represent an app's directory of storage areas,
the storage areas themselves, and their contents:
`storage_area_app_dir`, `storage_area_dir`, and
`storage_area_content_file` respectively.
All are `app_data_file_type`s.
The directory structure and their associated labels is as follows (note
 that they also all get the categories of the user+package):
/data/storage_area/userId/pkgName
		storage_area_app_dir
/data/storage_area/userId/pkgName/storageAreaName
		storage_area_dir
/data/storage_area/userId/pkgName/storageAreaName/myFile.txt
		storage_area_content_file
/data/storage_area/userId/pkgName/storageAreaName/mySubDir
		storage_area_content_file

These new types allow us to restrict how and which processes interact
with storage areas.
The new type for the contents of storage areas allows us to add new,
desirable restrictions that we cannot add to the more general
`app_data_file` type in order to maintain backwards-compatibility,
e.g., we block apps from executing any files in their storage areas.

Third, allow:
-- vold_prepare_subdirs to create and delete
storage areas on behalf of apps, and assign them the SElinux type
`storage_area_dir`
i.e. create directories
/data/storage_area/$userId/$pkgName/$storageAreaName
-- vold to assign encryption policies to storage area directories
-- installd to create an app's directory of storage areas on app
install, and delete them on app uninstall, and assign them the SElinux
type `storage_area_app_dir`,
i.e. directories /data/storage_area/$userId/$pkgName

We also add a new SELinux type to represent the storage area encryption
keys: `storage_area_key_file`.
The keys are created by vold on storage area creation, and deleted
either by vold if an app calls
the `deleteStorageArea` API function explicitly, or by installd on
app uninstall.
These keys are stored in `/data/misc_ce/$userId/storage_area_keys`,
and only installd and vold have access to them.

Bug: 325121608
Test: atest StorageAreaTest
Change-Id: I74805d249f59226fc6963693f682c70949bfad93
2024-04-30 20:26:55 +00:00
Suren Baghdasaryan
32342bf854 Merge "lmkd: Add ro.lmkd.lowmem_min_oom_score property policies" into main 2024-04-30 20:08:35 +00:00
Suren Baghdasaryan
5c5ff28912 lmkd: Add ro.lmkd.lowmem_min_oom_score property policies
Add policies to control ro.lmkd.lowmem_min_oom_score lmkd property.

Test: m
Bug: 334867461
Change-Id: I6a84d2d045fee431173374aab174e50f493e1858
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2024-04-30 11:40:12 -07:00
Treehugger Robot
e7bdf818fc Merge "Allow shell read access to MGLRU state" into main 2024-04-30 16:34:04 +00:00
T.J. Mercier
716260ac6b Allow shell read access to cgroup state
at /proc/cgroups.

Test: adb shell cat /proc/cgroups
Bug: 335278695
Change-Id: I52773c63200a2a048a4c5497c338ddcbe0f23593
2024-04-29 14:59:03 +00:00
Treehugger Robot
66e2d56170 Merge "add internal vmlauncher into seapp_contexts" into main 2024-04-29 08:49:13 +00:00
Jeongik Cha
f256b80c2b add internal vmlauncher into seapp_contexts
Bug: 336718836
Test: build & run
Change-Id: I3d746eefef6971b3378dcb3e9a70a0da88f9702d
2024-04-29 16:17:27 +09:00
Victor Hsieh
6543cf9843 Allow priv_app to measure fs-verity on tmp apk files
An APK installing with .idsig gets fs-verity enabled during the package
install. As a step of package install, a package verifier may inspect
the APK. A v4 signature check requires calling FS_IOC_MEASURE_VERITY.
This change gives priv_app the permission (which appdomain already has).

Bug: 337307333
Test: no longer seeing the verifier error
Change-Id: I49b721f229c30677f633dc1e425022ac54801668
2024-04-26 13:04:00 -07:00
T.J. Mercier
12878e5f13 Allow shell read access to MGLRU state
at /sys/kernel/mm/lru_gen/enabled. This can be inferred without reading
the file anyways. Writes remain restricted to init.

Test: adb shell cat /sys/kernel/mm/lru_gen/enabled
Bug: 335516770
Change-Id: Ibc8d86f932ecad21c6a07b44aad3517c22fa7843
2024-04-26 19:30:17 +00:00
William Loh
38b57bcc47 Add policy for /data/app-metadata
Bug: 336618214
Test: manual
Change-Id: If2da435f6622c6bc28a867c9a70e8efafe6524b0
2024-04-25 04:06:45 +00:00
Martin Liu
13f4811f5e Allow vendor init to access compaction_proactiveness
Bug: 330670954
Test: boot
Change-Id: Id274910e84d36cb662cea45d3b701c5fecada327
Merged-In: Id274910e84d36cb662cea45d3b701c5fecada327
Signed-off-by: Martin Liu <liumartin@google.com>
2024-04-23 11:18:28 +00:00
Treehugger Robot
7ea1dd6dd1 Merge "c2: add default1 and default2" into main 2024-04-20 00:07:33 +00:00
Steven Moreland
f877f5dbec c2: add default1 and default2
This is causing some targets to fail.

Bug: 335897540
Test: N/A
Change-Id: Ia077fc6bee952ff06ed13a555b96a00d6b5216e4
2024-04-19 22:02:34 +00:00
Song Chun Fan
38f029ee7b Merge "Remove the usage of the pm.archiving.enabled system property" into main 2024-04-19 16:55:52 +00:00
Song Chun Fan
015429cc84 Remove the usage of the pm.archiving.enabled system property
This property is no long used.

BUG: 331165939
FIXES: 331165939
Change-Id: Ifaa8c14e8452a5ebf32c3fe39d7953fe7c16d543
2024-04-18 20:15:49 +00:00
Treehugger Robot
4b94b1f5d0 Merge "Fix selinux denial when running adb shell cmd virtual_camera commands" into main 2024-04-16 12:18:35 +00:00
Inseob Kim
edf58243dd Add debugfs permission to 29.0 and 30.0 compat cil
Since Android S, we started to enforce the debugfs restrictions. However,
GSI had it turned off (PRODUCT_SET_DEBUGFS_RESTRICTIONS := false) in order
to support pre-S vendor images.

This has an undesirable side effect that the restriction is turned off even
for S+ vendors.

This CL fixes it by

1) re-enabling the restriction for GSI and

2) manually adding the debugfs permissions only to the compat cil for the
pre-S (29 and 30) vendors, effectively turning the restriction off for
them.

Bug: 330671086
Test: build
Test: run neverallow CTS
Change-Id: I5cd554b1b9f729a540e6b0f2aa0662091b691f0c
2024-04-16 01:24:41 +00:00
Jan Sebechlebsky
7f271ce061 Fix selinux denial when running adb shell cmd virtual_camera commands
Bug: 333889277
Test: forrest
Change-Id: I195125b907f56e9a50d13e3ca4c28a1cfcc257b1
2024-04-15 08:30:53 +00:00
Shrinidhi Hegde
1f24c3788d Merge "Adding a new property" into main 2024-04-12 14:30:23 +00:00
Shrinidhi Hegde
24aba1e127 Adding a new property
Adding a property to store time at which reboot was triggered from
native watchdog.

Test: manual
Bug: 291137901
Change-Id: Ied48c3690d0481fd8b08c9789cbfcb205759876c
2024-04-11 15:27:52 +00:00
Treehugger Robot
949b5d7e4e Merge "Revert^2 "Add pm.archiving.enabled system property"" into main 2024-04-11 03:34:52 +00:00
Inseob Kim
e972e936da Revert^2 "Add pm.archiving.enabled system property"
This reverts commit 840041d5d2.

Reason for revert: 202404 prebuilts must not be changed since freeze.

Change-Id: I320fde8de611ad4ae1546f4ce754871a0646dcc4
2024-04-11 00:56:13 +00:00
Treehugger Robot
808a734c09 Merge "Revert "Add pm.archiving.enabled system property"" into main 2024-04-11 00:12:11 +00:00
Treehugger Robot
64a23c81f3 Merge "add compaction_proactiveness type" into main 2024-04-10 23:24:33 +00:00
Ted Bauer
ba5998d7a2 Merge "Let system server set permissions on marker file" into main 2024-04-10 21:16:43 +00:00
Song Chun Fan
840041d5d2 Revert "Add pm.archiving.enabled system property"
This reverts commit 32ab868eac.

Reason for revert: no longer needed

Change-Id: I2ce46773503d39f843038fca3bb8527eb5bb53eb
BUG: 331165939
2024-04-10 17:39:43 +00:00
Ted Bauer
86405531d5 Let system server set permissions on marker file
System server needs to create a file in /metadata/aconfig, and set its
permissions.

Bug: 328444881
Test: m
Change-Id: I30aa576e46d8963e78ff21ad328160a99bd5d523
2024-04-10 15:26:01 +00:00
Martin Liu
f7396914b0 add compaction_proactiveness type
Bug: 332916849
Test: boot
Change-Id: I41c0da22ed5ad738c75fb00e2ac8a22c35dff2d3
Signed-off-by: Martin Liu <liumartin@google.com>
2024-04-10 13:48:15 +00:00
Vikram Gaur
d51e54db82 Merge "Add remote_provisioning.connect_timeout_millis as sysprop" into main 2024-04-09 23:55:00 +00:00
Vikram Gaur
3999879dde Add remote_provisioning.connect_timeout_millis as sysprop
Allow some services to control connection_timeout for testing purposes.

Test: atest RkpdAppUnitTests
Change-Id: Id70ed60c4f67e8f7910870a0b28a2b409fe97f62
2024-04-09 22:20:48 +00:00
Treehugger Robot
5752116370 Merge "Introduce vmlauncher_app domain" into main 2024-04-09 14:04:38 +00:00
Jeongik Cha
77a3ca6b4c Introduce vmlauncher_app domain
Bug: 333485208
Test: check display
Change-Id: I64c09f09615e89cf24398c01b8f87b0136be0a7f
2024-04-09 22:01:06 +09:00
Treehugger Robot
015384b110 Merge "Fix docs in seapp_contexts to point to right file" into main 2024-04-09 07:53:17 +00:00
Nikolay Elenkov
c9d42b5533 Merge "Allow system_server to call ISecretKeeper.deleteAll()" into main 2024-04-09 01:59:35 +00:00