Commit graph

47880 commits

Author SHA1 Message Date
Yakun Xu
c5f8e959d3 Thread: allow ot-rcp to bind a specific netif
This commit adds necessary permissions for ot-rcp to bind
to a network interface specified by its address or name.

Test: presubmit
Bug: 329188649
Change-Id: I6731df79c04eeeb2c39017b99b9c2acf315256e2
2024-05-09 17:05:04 +08:00
Treehugger Robot
fff886e374 Merge "Allow mounting and unmounting functionfs." into main 2024-05-09 08:46:08 +00:00
Nate Jiang
f4274ddf4b Change WifiScanner from system_api_service to app_api_service am: 229807f032
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/3080743

Change-Id: I1d64dcd03fb53a963bdde998ed7d9522a796a0f2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-09 06:30:17 +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
Nate Jiang
229807f032 Change WifiScanner from system_api_service to app_api_service
This will allow the CTS get the WifiScanner to test. Also WifiScanner is
a system API and all APIs are protected by the priviliged permissions.

Bug: 339527374
Test: CtsWifiTestCases

Change-Id: Ic06a5804fa81a952e9e8792e93df489a9d47d521
2024-05-09 00:13:26 +00:00
Devin Moore
e015381258 Merge "Allow crash_dump to read misctrl properties" into main am: ba99b14c5c
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/3073627

Change-Id: I13ca1825e3c62265d49f56a47ca968d405a87fda
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-07 20:18:49 +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
05cde4e744 Allow native audio server to access the virtual device manager service am: df665c694b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/3074638

Change-Id: Iadcf883ad9ce614116bd841ec963c64e2bcfd579
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-07 15:34:01 +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
Maciej Żenczykowski
28960d319a allow non bpfloader creation of bpf maps
In practice only bpf programs are critical to device security...

Normally there is basically no use for creating bpf maps outside
of the bpfloader, since they have to be tied directly into the bpf
programs (which is only ever done by the bpfloader during the boot
process) to be of any use.

This means that bpf maps created after the bpfloader is done,
can't actually be used by any bpf code...

Hence we had this restriction.

However, map-in-map support changes this:

It becomes possible to define a boot-time (bpfloader loaded)
bpf program which accesses an (initially empty) outer map
(created by the bpfloader).

This outer map can be populated with inner maps at run time by various
bpf using userspace code.  While it can be populated with bpfloader
created 'static' maps, it also makes sense to be able to create/destroy
these inner maps on demand 'dynamically'.

This allows bpf map memory utilization to be driven by actual runtime
device needs.  For example scaling with the number of users, apps,
or connected networks.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I93223c660463596c9e50065be819e2fd865da923
2024-05-04 11:02:13 +00:00
Treehugger Robot
d513960000 Merge "Use no_full_install: true instead of installable: false" into main am: 18eb855a0f
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/3069483

Change-Id: Ic871a3de158b39b1d66a844f999a1def39f28894
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-04 00:24:07 +00:00
Treehugger Robot
18eb855a0f Merge "Use no_full_install: true instead of installable: false" into main 2024-05-04 00:04:03 +00:00
Treehugger Robot
e01f52bd2f Merge "Add policies for hal_codec2" into main am: 07dc4933ac
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/3068058

Change-Id: I72cb72daedb8a7db9c299a3a4cab4a51c87ac04b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-03 17:39:26 +00:00
Treehugger Robot
07dc4933ac Merge "Add policies for hal_codec2" into main 2024-05-03 17:20:45 +00:00
Treehugger Robot
743f7ebb35 Merge "Add some new classes and access vectors" into main am: c567076228
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/3071644

Change-Id: I21606eadd3c6a73352e218c3ab8acd9ecfbfc9d0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-03 12:37:01 +00:00
Treehugger Robot
c567076228 Merge "Add some new classes and access vectors" into main 2024-05-03 12:19:14 +00:00
Inseob Kim
f51c4159a6 Merge "Move prebuilt_sepolicy_cts_data to system/sepolicy" into main am: 93da5387e8
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/3071303

Change-Id: Id4ab0d8e0e3bdadfc70a196639b09ee836c622a0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-03 02:01:51 +00:00
Inseob Kim
93da5387e8 Merge "Move prebuilt_sepolicy_cts_data to system/sepolicy" into main 2024-05-03 01:47:42 +00:00
Dennis Shen
506b78c29b Merge "selinux: allow system server access aconfigd socket" into main am: 2ae5d42a79
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/3072745

Change-Id: I81b0dfbfd9b7b0c5f468552e5b643b659415f2ff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-03 00:08:53 +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
62ef861ebc Merge "sepolicy: Add rules for /sys/kernel/mm/pgsize_migration/enabled" into main am: 5f805d057e
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/3036172

Change-Id: I9d0b24cc4bc0c7a02f4b01e89d854452240ad332
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-02 19:54:48 +00:00
Pawan Wagh
bae983dd89 Merge "Allow system app and update_engine to read OTA from /vendor" into main am: c9b15f596b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/3065885

Change-Id: I21ce9b408bdb48580e519e11739fb9e0b0306735
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-02 19:54: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
Alan Stokes
86a85c4e77 Add some new classes and access vectors
These have been added to the kernel and to Android sepolicy, but not
yet here. This doesn't make much difference, but it does avoid some
(harmless) warnings at policy load time.

While I'm here, remove some userspace classes which don't exist in
Microdroid and probably never will.

Bug: 215093641
Test: Policy still builds; TH
Change-Id: Id2f778919e492162c1a7d77822d74d7978522118
2024-05-02 14:03:29 +01:00
Inseob Kim
6faaf139a7 Move prebuilt_sepolicy_cts_data to system/sepolicy
This is a no-op now but it will make vintf finalization easier because
we'll only need system/sepolicy changes.

Bug: 337978860
Test: atest CtsSecurityHostTestCases
Change-Id: I242dcad7511e7c880b1e5434ba3de622f56bc1b3
2024-05-02 17:40:00 +09: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
cc66d38871 Add read permission to storage_area_keys to installd am: c1508ec794
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/3068060

Change-Id: Idc62086a03f1f3bec88f03bd0e1be00f01192d6f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-02 00:36:44 +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
Jiyong Park
2fcfc6f190 Use no_full_install: true instead of installable: false
So far, we have used `instalable: false` to avoid collision with the
other modules that are installed to the same path. A typical example was
<foo> and <foo>.microdroid. The latter is a modified version of the
former for the inclusion of the microdroid image. They however both have
the same instalation path (ex: system/bin) and stem (ex: foo) so that we
can reference them using the same path regardless of whether we are in
Android or microdroid.

However, the use of `installable: false` for the purpose is actually
incorrect, because `installable: false` also means, obviously, "this
module shouldn't be installed". The only reason this incorrect way has
worked is simply because packaging modules (ex: android_filesystem)
didn't respect the property when gathering the modules.

As packaging modules are now fixed to respect `installable: false`, we
need a correct way of avoiding the collision. `no_full_install: true` is
it.

If a module has this property set to true, it is never installed to the
full instal path like out/target/product/<partition>/... It can be
installed only via packaging modules.

Bug: 338160898
Test: m
Change-Id: I267031c68f2157a679a1fceb3ae684bb7580c77c
2024-05-01 21:14:22 +09:00
Treehugger Robot
7e4f16b0f7 Merge "Allow shell read access to cgroup state" into main am: 77a8ac9ab4
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/3044973

Change-Id: Iefb2518fb39c0cf0b67ca73c6f81ff1905b2323a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-30 21:15:58 +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
b21b673267 Merge "Add SELinux policy for storage areas" into main am: 7dd36bbb29
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2960065

Change-Id: I9caa86cba5a6e3943928f0f5a9918de7cdfe7734
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-30 20:46:18 +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
6fe75d3078 Merge "lmkd: Add ro.lmkd.lowmem_min_oom_score property policies" into main am: 32342bf854
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/3061983

Change-Id: Iacf6e687759288a004e4f40430d79f18c318a7f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-30 20:26:54 +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
763951fe75 Merge "Allow shell read access to MGLRU state" into main am: e7bdf818fc
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/3042245

Change-Id: I0e488d01bf90f3f4e875ba3da701e12ea9efaf20
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-30 16:49:57 +00: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
46a71c13e4 Merge "add internal vmlauncher into seapp_contexts" into main am: 66e2d56170
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/3064823

Change-Id: I7fbca5f145b9d1bf39816f37cff6b6747522b4b0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-29 09:03:56 +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
4d7627e3aa Allow priv_app to measure fs-verity on tmp apk files am: 6543cf9843
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/3063020

Change-Id: I0c6d644107aeab8233efd9460bdbe166e95644bb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-26 22:08:07 +00: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