Commit graph

908 commits

Author SHA1 Message Date
Rubin Xu
ab73c8f1c8 Merge "Allow Bluetooth stack to read security log sysprop" 2022-05-25 11:43:49 +00:00
Sanjana Sunil
898723d045 Allow zygote to relabel sdk_sandbox_system_data_file
To perform sdk sandbox data isolation, the zygote gets the selinux label
of SDK sandbox storage (e.g. /data/misc_{ce,de}/<user-id>/sdksandbox)
before tmpfs is mounted onto /data/misc_{ce,de} (or other volumes). It
relabels it back once bind mounting of required sandbox data is done.
This change allows for the zygote to perform these operations.

Bug: 214241165
Test: atest SdkSandboxStorageHostTest
Ignore-AOSP-First: Already merged in aosp

Change-Id: Ie8fd1f478fd12141bd6240cee96d0c3da55ba7a0
Merged-In: I28d1709ab4601f0fb1788435453ed19d023dc80b
2022-05-24 14:11:50 +00:00
Sanjana Sunil
79f75ae826 Merge "Allow zygote to relabel sdk_sandbox_system_data_file" am: 26750b9a0c am: 8f37c1b762
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2101653

Change-Id: Id33dbed2e2a956c4f82054a06148ba0509cc70cb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 22:54:13 +00:00
Sanjana Sunil
8f37c1b762 Merge "Allow zygote to relabel sdk_sandbox_system_data_file" am: 26750b9a0c
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2101653

Change-Id: I0762945569e84d4a9cb6f98553c4e641812955c7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 22:34:10 +00:00
Samiul Islam
6b309bd4e3 Merge "Create a separate label for sandbox root directory" am: 61bd67072c
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2098133

Change-Id: I667c2888a2c4f82cd3a891c03b273b477ccd79d6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 12:48:30 +00:00
Sanjana Sunil
563016314c Allow zygote to relabel sdk_sandbox_system_data_file
To perform sdk sandbox data isolation, the zygote gets the selinux label
of SDK sandbox storage (e.g. /data/misc_{ce,de}/<user-id>/sdksandbox)
before tmpfs is mounted onto /data/misc_{ce,de} (or other volumes). It
relabels it back once bind mounting of required sandbox data is done.
This change allows for the zygote to perform these operations.

Bug: 214241165
Test: atest SdkSandboxStorageHostTest
Change-Id: I28d1709ab4601f0fb1788435453ed19d023dc80b
2022-05-20 11:24:32 +00:00
Samiul Islam
61bd67072c Merge "Create a separate label for sandbox root directory" 2022-05-20 07:21:19 +00:00
Nicolas Geoffray
c90a5313a7 sysfs_fs_f2fs for zygote. am: 36c1ef6672
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2100138

Change-Id: I0afc1d81d4d485c88fee6e2d4a99fe3abf93d9da
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 18:03:17 +00:00
Nicolas Geoffray
36c1ef6672 sysfs_fs_f2fs for zygote.
Test: boot
Bug: 223366272

(cherry picked from commit d68b089d59)

Merged-In: I163c343d8af9c578c840d7c710854fce15c29903
Change-Id: Ia67bbe89d61e8badb128d4c13570d8049f91d7a2
2022-05-19 16:53:41 +01:00
Mohammad Samiul Islam
d2ffd35cc0 Create a separate label for sandbox root directory
Currently, app process can freely execute path at
`/data/misc_ce/0/sdksandbox/<package-name>` since it's labeled as system
file. They can't read or write, but use 403/404
error to figure out if an app is installed or not.

By changing the selinux label of the parent directory:
`/data/misc_ce/0/sdksandbox`, we can restrict app process from executing
inside the directory and avoid the privacy leak.

Sandbox process should only have "search" permission on the new label so
that it can pass through it to its data directory located in
`/data/misc_ce/0/sdksandbox/<package-name>/<per-sdk-dir>`.

Bug: 214241165
Test: atest SdkSandboxStorageHostTest
Test: `adb shell cd /data/misc_ce/0/sdksandbox` gives error
Test: manual test to verify webview still works
Change-Id: Id8771b322d4eb5532eaf719f203ca94035e2a8ed
Merged-In: Id8771b322d4eb5532eaf719f203ca94035e2a8ed
2022-05-19 16:01:15 +01:00
Nicolas Geoffray
e8d4a6077b Merge "sysfs_fs_f2fs for zygote." into tm-dev am: 5c8171c478
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/18437090

Change-Id: I873b65d3fa0a409d4010e0c09e8f1f78296eeb7a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 14:10:06 +00:00
Nicolas Geoffray
5c8171c478 Merge "sysfs_fs_f2fs for zygote." into tm-dev 2022-05-19 13:39:17 +00:00
Samiul Islam
d8ffd4cdd8 Merge "Create a separate label for sandbox root directory" into tm-dev am: 7accd9ad70
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/18344445

Change-Id: I07313fb72cd13e9ae2ab24e1b72e0b211f353468
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 13:24:36 +00:00
Samiul Islam
7accd9ad70 Merge "Create a separate label for sandbox root directory" into tm-dev 2022-05-19 13:11:37 +00:00
Treehugger Robot
3b660a7982 Merge "Allow vendor_init to read device config vendor_system_native properties" am: 1fa1ef4e0d
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2099111

Change-Id: I73fbfddbc4658b8aafca11645f114d3a4111e4d1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 08:34:15 +00:00
Treehugger Robot
1fa1ef4e0d Merge "Allow vendor_init to read device config vendor_system_native properties" 2022-05-19 08:05:16 +00:00
TreeHugger Robot
7467534c2c Merge "Allow vendor_init to read device config vendor_system_native properties" into tm-dev am: 3669484abd
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/18400350

Change-Id: Ife1dbb50f5c07a1ee12bd9ec327dfe73e2cbeeaf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 07:55:22 +00:00
Nicolas Geoffray
d68b089d59 sysfs_fs_f2fs for zygote.
Test: boot
Bug: 223366272
Ignore-AOSP-First: will merge in aosp
Change-Id: I163c343d8af9c578c840d7c710854fce15c29903
2022-05-18 17:24:44 +01:00
Richard Chang
07e43db528 Merge "Update sepolicy prebuilts to sync vendor_system_native prop changes" am: e14ad82c98 am: 8073874dc4
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2098910

Change-Id: Ia9908a6a616d83bf8b0cb7761e5b81f71c8b589d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 13:56:00 +00:00
Richard Chang
8073874dc4 Merge "Update sepolicy prebuilts to sync vendor_system_native prop changes" am: e14ad82c98
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2098910

Change-Id: I809c92aac30e65a855a0e5f2180f5e8a76529dd2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 13:29:30 +00:00
Richard Chang
6c29066f65 Allow vendor_init to read device config vendor_system_native properties
Let vendor_init can react Vendor System Native Experiment
changes via persist.device_config.vendor_system_native.* properties.

Bug: 223685902
Test: Build and check no avc denied messages in dmesg
Change-Id: If69d1dab02d6c36cdb1f6e668887f8afe03e5b0e
Merged-In: If69d1dab02d6c36cdb1f6e668887f8afe03e5b0e
2022-05-18 05:16:12 +00:00
Richard Chang
5eca1a0bf7 Allow vendor_init to read device config vendor_system_native properties
Let vendor_init can react Vendor System Native Experiment
changes via persist.device_config.vendor_system_native.* properties.

Ignore-AOSP-First: Will cherry-pick
Bug: 223685902
Test: Build and check no avc denied messages in dmesg
Change-Id: If69d1dab02d6c36cdb1f6e668887f8afe03e5b0e
2022-05-18 05:09:21 +00:00
Mohammad Samiul Islam
ef1698a878 Create a separate label for sandbox root directory
Currently, app process can freely execute path at
`/data/misc_ce/0/sdksandbox/<package-name>` since it's labeled as system
file. They can't read or write, but use 403/404
error to figure out if an app is installed or not.

By changing the selinux label of the parent directory:
`/data/misc_ce/0/sdksandbox`, we can restrict app process from executing
inside the directory and avoid the privacy leak.

Sandbox process should only have "search" permission on the new label so
that it can pass through it to its data directory located in
`/data/misc_ce/0/sdksandbox/<package-name>/<per-sdk-dir>`.

Bug: 214241165
Test: atest SdkSandboxStorageHostTest
Test: `adb shell cd /data/misc_ce/0/sdksandbox` gives error
Test: manual test to verify webview still works
Ignore-AOSP-First: Test is missing in AOSP. Will cherry-pick to AOSP
                   once merged here.
Change-Id: Id8771b322d4eb5532eaf719f203ca94035e2a8ed
2022-05-17 17:23:31 +00:00
Richard Chang
e14ad82c98 Merge "Update sepolicy prebuilts to sync vendor_system_native prop changes" 2022-05-17 10:56:44 +00:00
Treehugger Robot
f16c83c75b Merge "Grant permission for mediatranscoding hal_allocator for OMX platforms" into android12-tests-dev am: d4a7420e0c am: 8183cf27b5 am: e39f583a14 am: 4f7c309ddf
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1966599

Change-Id: Ibdee99b6bfe2cf5452d7c2e2094901cfeefb9807
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-16 23:58:03 +00:00
Satoshi Niwa
0e8caffd49 Set expandattribute false for property attributes in prebuilts am: fa3b250ad1 am: ae167c2105 am: 7c80be1c0e am: 4295510ad5 am: c4632424b8
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1435472

Change-Id: I3fe975ef21db890c12475b2bd2679f57d05a99a6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-16 23:42:47 +00:00
Treehugger Robot
4f7c309ddf Merge "Grant permission for mediatranscoding hal_allocator for OMX platforms" into android12-tests-dev am: d4a7420e0c am: 8183cf27b5 am: e39f583a14
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1966599

Change-Id: I56578e87356fd81425cabec8008192ee56ee3117
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-16 23:23:07 +00:00
Treehugger Robot
e39f583a14 Merge "Grant permission for mediatranscoding hal_allocator for OMX platforms" into android12-tests-dev am: d4a7420e0c am: 8183cf27b5
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1966599

Change-Id: I24f4a6b12d0a65a06a2341227baa6cbb16db93d8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-16 23:19:53 +00:00
Satoshi Niwa
c4632424b8 Set expandattribute false for property attributes in prebuilts am: fa3b250ad1 am: ae167c2105 am: 7c80be1c0e am: 4295510ad5
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1435472

Change-Id: Ie22601291b8b24f5c4816425b26d091398684862
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-16 23:17:49 +00:00
Treehugger Robot
8183cf27b5 Merge "Grant permission for mediatranscoding hal_allocator for OMX platforms" into android12-tests-dev am: d4a7420e0c
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1966599

Change-Id: Ia0141797ab1eeac4ebdc08a265e252120ae2ddd8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-16 23:05:01 +00:00
Satoshi Niwa
4295510ad5 Set expandattribute false for property attributes in prebuilts am: fa3b250ad1 am: ae167c2105 am: 7c80be1c0e
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1435472

Change-Id: Ibbc11d08ad95664a3b89fd5a58fc88826cd54241
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-16 23:03:24 +00:00
Satoshi Niwa
7c80be1c0e Set expandattribute false for property attributes in prebuilts am: fa3b250ad1 am: ae167c2105
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1435472

Change-Id: I1664242c71d499e270da02c4dd70bc8b13029178
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-16 22:49:45 +00:00
Richard Chang
50dbf2c5ef Update sepolicy prebuilts to sync vendor_system_native prop changes
This CL partially cherry-picks ag/18350151 to
update prebuilts. Other parts are already included by
aosp/2083463.

Bug: 226456604
Bug: 223685902
Test: Build
Change-Id: I1ddb1db855a13671e7b76b48d84e4f1ab5a63374
2022-05-16 08:16:59 +00:00
Richard Chang
ee5fc96178 Allow vendor services to access vendor_system_native_prop
Bug: 226456604
Bug: 223685902
Test: Build
Ignore-AOSP-First: Already merged in aosp/2083463
Merged-In: Icc11b9bf06fd0fb8069388ca5a32e8aedf1743a8
Change-Id: Ie95ca796656d7727540db67feef31e28e2c602b0
2022-05-13 17:57:18 +00:00
Treehugger Robot
b90d916440 [MS82.4] Update sepolicy prebuilts am: 6cbd833218 am: 5d2ae41212
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2096697

Change-Id: I01649a4eacdff06413942c699914e4be2095635d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 11:08:55 +00:00
Treehugger Robot
5d2ae41212 [MS82.4] Update sepolicy prebuilts am: 6cbd833218
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2096697

Change-Id: I553abe9d02b016f382e885803c8efdf999d85775
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 10:48:02 +00:00
Treehugger Robot
6cbd833218 [MS82.4] Update sepolicy prebuilts
This CL partially cherry-picks ag/18156623 to
update prebuilts. Other parts are already included by
aosp/2069127.

Test: m
Bug: 230289468
Change-Id: If52dea348c01113fe1504eb7e51f6780f0ed4a11
2022-05-13 14:36:07 +08:00
Keith Mok
69ad6109e1 Merge "Update 33 api to fix build breaks" into tm-dev am: 3b04b25298
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/18282715

Change-Id: I19a96ac63e9f25bc8848074fe2bac88f25c9b603
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 17:06:13 +00:00
Keith Mok
3b04b25298 Merge "Update 33 api to fix build breaks" into tm-dev 2022-05-12 16:26:22 +00:00
Victor Hsieh
94966ac36b Merge "Allow composd to pass some system properties to CompOS" into tm-dev am: 05d625ef62
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/18298595

Change-Id: I90279cd56bca2d89adeb52f030cdb07e87ec168f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 15:46:08 +00:00
Victor Hsieh
05d625ef62 Merge "Allow composd to pass some system properties to CompOS" into tm-dev 2022-05-12 15:30:40 +00:00
Rubin Xu
a274858e3b Allow Bluetooth stack to read security log sysprop
Bluetooth stack needs to read persist.logd.security and
ro.organization_owned sysprop (via __android_log_security())
to control security logging for Bluetooth events.

Bug: 232283779
Test: manual
Change-Id: Ic8162cd4a4436981a15acea6ac75079081790525
2022-05-12 15:44:57 +01:00
Shiwangi Shah
796a25a034 Merge "Add services and allow app to write to sdk_sandbox" into tm-dev 2022-05-12 11:04:02 +00:00
Keith Mok
597b5dfd55 Update 33 api to fix build breaks
Ignore-AOSP-First: Need to change together with T branch
Bug: 204367810
Test: build
Change-Id: I1124640a6cd96a12ff1cd2a41c207cf35dd2df89
2022-05-11 18:10:35 +00:00
Victor Hsieh
9561e19573 Allow composd to pass some system properties to CompOS
Bug: 231579544
Test: see allowlisted system properties in the VM
Ignore-AOSP-First: Cherry-pick from AOSP
Change-Id: Idb263087639e4677e437ac2fcd2726ee71547f48
Merged-In: Idb263087639e4677e437ac2fcd2726ee71547f48
2022-05-11 09:05:12 -07:00
Shiwangi Shah
4aad91d920 Add services and allow app to write to sdk_sandbox
We might want to change this in later android versions.

Ignore-AOSP-First: Already merged via aosp/2051365
Bug: b/228159127
Bug: b/227745962
Bug: b/229251344
Test: Manual
Change-Id: I8f425cc9f2759a29bdd2e6218ad0a1c40750e4f5
Merged-In: I8f425cc9f2759a29bdd2e6218ad0a1c40750e4f5
Merged-In: I2e308ca9ce58e71ac9d7d9b0fa515bdf2f5dfa1f
(cherry picked from commit 13bdca21d5)
(cherry picked from commit ce2b6da673)
2022-05-11 15:52:51 +00:00
Treehugger Robot
bad95e0764 [MS82.3] Add sepolicy to access connectivity apex directory
Test: m
Bug: 230289468
Change-Id: I7e43c09f929a418c6c7b6bcfc3696a242c19f2d8
Merged-In: I7e43c09f929a418c6c7b6bcfc3696a242c19f2d8
(cherry picked from commit 441c149894)
2022-05-11 15:26:55 +08:00
Yurii Zubrytskyi
04a85a1ba0 platform/system/sepolicy - SEPolicy Prebuilts for Tiramisu
Ignore-AOSP-First: T finalization
Bug: 225745567
Test: Build
Change-Id: I49fb91c7a60fb1e871bdf3553d978bb16c476fd7
Merged-In: I49fb91c7a60fb1e871bdf3553d978bb16c476fd7
2022-05-04 09:46:16 -07:00
Yurii Zubrytskyi
ac14146a95 platform/system/sepolicy - SEPolicy Prebuilts for Tiramisu am: 9d9c730f1c
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2083163

Change-Id: I82afd93fc40e78a7ea4026c591e8bbaff320ec9b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-03 02:21:49 +00:00
Yurii Zubrytskyi
9d9c730f1c platform/system/sepolicy - SEPolicy Prebuilts for Tiramisu
Bug: 225745567
Test: Build
Change-Id: I49fb91c7a60fb1e871bdf3553d978bb16c476fd7
Merged-In: I49fb91c7a60fb1e871bdf3553d978bb16c476fd7
(cherry picked from commit f9a00364c8)
2022-05-02 13:24:45 +09:00
Zim
abfe4c00e7 Allow MediaProvider to access the media metrics service
This allows MediaProvider call certain MediaCodec APIs

Also update prebuilts for API 32.

Test: atest TranscodeTest
Bug: 190422448
(cherry picked from commit 57401bc71f)
(cherry picked from commit c38b81ce4f)
Merged-In: Ied609152e6a9ba6d17b70db325ca33f1cb345eb8
Change-Id: Ied609152e6a9ba6d17b70db325ca33f1cb345eb8
2022-03-02 18:17:57 -08:00
Treehugger Robot
dd30d8381e Merge "Remove compat test from treble sepolicy tests" am: 8e6b55a13d am: 7e5a5e8b1f
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1985246

Change-Id: I4f27384fb7e79471f34b73e58a1978ad1311e42d
2022-02-17 02:08:30 +00:00
Treehugger Robot
7e5a5e8b1f Merge "Remove compat test from treble sepolicy tests" am: 8e6b55a13d
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1985246

Change-Id: I9b7cb61dfb0dc823d39c8e35d1fff323675a835d
2022-02-17 01:46:44 +00:00
Inseob Kim
73f43ff847 Remove compat test from treble sepolicy tests
Treble sepolicy tests check whether previous versions are compatible to
ToT sepolicy or not. treble_sepolicy_tests_for_release.mk implements it,
but it also includes a compat test whether ToT sepolicy + {ver} mapping
+ {ver} plat_pub_versioned.cil can be built together or not. We
definitely need such tests, but we already have a test called "compat
test" which does exactly that, and testing it again with Treble sepolicy
tests is just redundant. The only difference between those two is that
Treble sepolicy tests can also test system_ext and product compat files,
which was contributed by a partner.

The ultimate goal here is to migrate *.mk to Soong, thus merging these
two tests (compat, Treble) into one. As we've already migrated the
compat test to Soong, this change removes the compat test part from
treble sepolicy tests. Instead, the compat test will be extended so it
can test system_ext and product compat files too.
prebuilts/api/{ver}/plat_pub_versioned.cil and
prebuilts/api/{ver}/vendor_sepolicy.cil are also removed as they aren't
used anymore: vendor_sepolicy.cil is an empty stub, and
plat_pub_versioned.cil can be built from the prebuilt source files.

Bug: 33691272
Test: m selinux_policy
Change-Id: I72f5ad0e8bbe6a7c0bbcc02f0f902b953df6ff1a
2022-02-16 04:09:29 +00:00
Thiébaud Weksteen
69d3e66ae3 Merge changes from topic "presubmit-am-47892e9f11d746939b74901bbda929d2" into sc-v2-dev-plus-aosp
* changes:
  [automerge] Grant getpgid to system_server on zygote 2p: c816666f40
  Grant getpgid to system_server on zygote
2022-02-15 04:57:57 +00:00
Xin Li
f1f2839e6e Merge "Merge sc-v2-dev-plus-aosp-without-vendor@8084891" into stage-aosp-master 2022-02-14 17:31:17 +00:00
Xin Li
77c821174e Merge sc-v2-dev-plus-aosp-without-vendor@8084891
Bug: 214455710
Merged-In: I129b5cb74259c9c028483e84c9b2ac3597c24701
Change-Id: I47ca55be668b9b2aabf86963b65b1403130ab802
2022-02-11 06:58:07 +00:00
Keith Mok
61220c8175 Merge "Update SEPolicy apexd for API 32" am: 9984dcb28e am: 64a1571f5d
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1976997

Change-Id: Ie8074e60e624d10f3b34672246db62e19b4043e6
2022-02-11 05:34:09 +00:00
Keith Mok
16c0a350c5 Update SEPolicy apexd for API 32
The bootchart problem need the selinux policy fix.
But it is missing API 32

Bug: 218729155
Test: Build
Change-Id: Ia011f8bcd52403980c2a6751bb612dd5b770e130
2022-02-11 00:20:17 +00:00
Kevin Rocard
6f135387c4 Grant permission for mediatranscoding hal_allocator for OMX platforms
This is a port of If44653f436d4e5dcbd040af24f03b09ae8e7ac05 which
made this change to prebuilts/api/31.0/private/mediatranscoding.te.

This is required to pass CTS test.

Test: run cts -m CtsMediaTranscodingTestCases -t android.media.mediatranscoding.cts.MediaTranscodingManagerTest#testAddingClientUids
Bug: 207821225
Bug: 213141904
Change-Id: Iefe9f326572976e230eeeec74e612b6e20b31887
2022-02-01 11:01:11 +00:00
Presubmit Automerger Backend
1757cf1027 [automerge] Grant getpgid to system_server on zygote 2p: c816666f40
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/16743651

Bug: 216097542
Change-Id: Id15bbd4f7bdb7fd02ef0f67b8065c0306d42e59e
2022-01-31 23:30:15 +00:00
Thiébaud Weksteen
c816666f40 Grant getpgid to system_server on zygote
Should system_server kill zygote on crashes, it will attempt to kill any
process in the same process group. This ensures that no untracked
children are left.

Bug: 216097542
Test: m selinux_policy
Change-Id: Ie16074f76e351d80d9f17be930a731f923f99835
(cherry picked from commit 6390b3f090)
Ignore-AOSP-First: backport with update to prebuilts
2022-02-01 10:29:31 +11:00
Treehugger Robot
6b8707ffe3 Merge "Add Media metrics rule to API 32 prebuilts." am: d5bd56d11f am: 2c1fee1a67
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1965040

Change-Id: Ic1a5a2c28a96b7f7e5b9909122cd882ac68bbe1a
2022-01-28 14:12:35 +00:00
Zim
57401bc71f Allow MediaProvider to access the media metrics service
This allows MediaProvider call certain MediaCodec APIs

Also update prebuilts for API 32.

Test: atest TranscodeTest
Bug: 190422448
Merged-In: Ied609152e6a9ba6d17b70db325ca33f1cb345eb8
Change-Id: Ied609152e6a9ba6d17b70db325ca33f1cb345eb8
2022-01-28 11:49:15 +00:00
Dario Freni
75bc16cba8 Add Media metrics rule to API 32 prebuilts.
Bug: 190422448
Test: presubmit
Change-Id: I304278b9d15f89d0e04d5268af2ac82ac97acd84
2022-01-28 11:47:17 +00:00
Treehugger Robot
c8bd6d6707 Merge "Allow zygote to setattr cgroup" am: e2f870f099 am: 770fec0a15
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1859781

Change-Id: Iff0c5528fd61f6548ec69a6e0921027729d56e60
2022-01-28 11:11:51 +00:00
Treehugger Robot
e2f870f099 Merge "Allow zygote to setattr cgroup" 2022-01-28 10:33:32 +00:00
Gregory Montoir
ce512a168f Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6} am: f7727ace66 am: 84f6646c7c am: 8bac0a5547 am: 796f6637e4 am: 8881759651 am: ee34c61f9d am: 90aa30a199
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/16602719

Change-Id: I76f6885db97541a29e407c37d4e3da11156eb9ce
2022-01-13 00:26:55 +00:00
Gregory Montoir
4791f7c0e4 Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6} am: f7727ace66 am: 84f6646c7c am: 8bac0a5547 am: 796f6637e4 am: 8881759651 am: ee34c61f9d
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/16602719

Change-Id: I92fa75428bc9e61ec3eb66c72a9745448a76adb2
2022-01-13 00:15:39 +00:00
Gregory Montoir
90aa30a199 Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6} am: f7727ace66 am: 84f6646c7c am: 8bac0a5547 am: 796f6637e4 am: 8881759651 am: ee34c61f9d
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/16602719

Change-Id: If2d0ed11ebe759aa3b8170afb672451d5d997a2f
2022-01-13 00:15:38 +00:00
Gregory Montoir
2f2d4e9e9c Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6} am: 1a6b37d838 am: ff22c64cbb am: 87d5e2ef90 am: 8554dcd97a
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/16615268

Change-Id: Iea2cf75a2e875514756de5fd7ac2fce2dce531ec
2022-01-12 23:46:42 +00:00
Gregory Montoir
8f9228f6ac Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6} am: 1a6b37d838 am: ff22c64cbb am: 87d5e2ef90 am: 8554dcd97a
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/16615268

Change-Id: I705facaa4da4dfca50a7e50afd2db4bec6e6ee12
2022-01-12 23:46:36 +00:00
Gregory Montoir
8881759651 Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6} am: f7727ace66 am: 84f6646c7c am: 8bac0a5547 am: 796f6637e4
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/16602719

Change-Id: I76bdaca952b528a9fea775e3a0276f3be592bf33
2022-01-12 23:44:25 +00:00
Gregory Montoir
796f6637e4 Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6} am: f7727ace66 am: 84f6646c7c am: 8bac0a5547
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/16602719

Change-Id: Ic3688f33d8cab5a1a951780349602b6aed6b0e12
2022-01-12 23:27:00 +00:00
Gregory Montoir
ee426c1678 Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6} am: fe0705ba42 am: a73406d0a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/16616068

Change-Id: I95d6b842b10a98d87ab8e411bbf49c9cdbdb9f48
2022-01-12 23:16:16 +00:00
Gregory Montoir
860cc6f1d5 Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6} am: fe0705ba42 am: a73406d0a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/16616068

Change-Id: I0dc859d02da3dfc8ab7421a06aae2ee9aa65542e
2022-01-12 23:15:55 +00:00
Gregory Montoir
87d5e2ef90 Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6} am: 1a6b37d838 am: ff22c64cbb
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/16615268

Change-Id: Ied839549c500bfba3b46b2fc26e00baea7d2b11d
2022-01-12 23:15:02 +00:00
Gregory Montoir
8bac0a5547 Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6} am: f7727ace66 am: 84f6646c7c
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/16602719

Change-Id: I11fc36fbc3d65609a3215e9cecf5ce22fb06b97e
2022-01-12 23:14:44 +00:00
Gregory Montoir
84f6646c7c Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6} am: f7727ace66
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/16602719

Change-Id: I0f2729fc6ef1737965de0e38495a4908b76890d0
2022-01-12 23:02:17 +00:00
Gregory Montoir
ff22c64cbb Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6} am: 1a6b37d838
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/16615268

Change-Id: Ic7d459763baeaac4466ea599ff43176289d08203
2022-01-12 23:02:09 +00:00
Gregory Montoir
fe0705ba42 Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6}
File accesses go through com.android.ddmlib.SyncService for CTS
ListeningPortsTest.

Bug: 201645790
Test: atest ListeningPortsTest
Ignore-AOSP-First: Fix already in AOSP
Change-Id: I0c66fb5e35cda3b1799cf003402e454d7a951e96
2022-01-12 14:35:12 +00:00
Gregory Montoir
f7727ace66 Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6}
File accesses go through com.android.ddmlib.SyncService for CTS
ListeningPortsTest.

Bug: 201645790
Test: atest ListeningPortsTest
Ignore-AOSP-First: Fix already in AOSP
Change-Id: I0c66fb5e35cda3b1799cf003402e454d7a951e96
2022-01-12 14:34:33 +00:00
Gregory Montoir
1a6b37d838 Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6}
File accesses go through com.android.ddmlib.SyncService for CTS
ListeningPortsTest.

Bug: 201645790
Test: atest ListeningPortsTest
Ignore-AOSP-First: Fix already in AOSP
Change-Id: I0c66fb5e35cda3b1799cf003402e454d7a951e96
2022-01-12 14:33:22 +00:00
Thierry Strudel
195149fcf8 Allow app to get dck_prop
Bug: 208742539
Test: gts-tradefed run gts -m GtsDckTestCases --log-level-display DEBUG
Merged-In: Ie3f7c54805b9947fd43fe5118fd4808b4744664d
Signed-off-by: Thierry Strudel <tstrudel@google.com>
Change-Id: Ie3f7c54805b9947fd43fe5118fd4808b4744664d
2021-12-24 06:50:53 +00:00
Thierry Strudel
f4e3b06683 Allow app to get dck_prop
Ignore-AOSP-First: Touches prebuilts/api/32.0/private/app.te
Bug: 208742539
Test: gts-tradefed run gts -m GtsDckTestCases --log-level-display DEBUG
Signed-off-by: Thierry Strudel <tstrudel@google.com>
Change-Id: Ie3f7c54805b9947fd43fe5118fd4808b4744664d
2021-12-24 06:22:31 +00:00
TreeHugger Robot
bbf0802210 Merge "sepolicy updates for adding native flag namespace for lmkd" into sc-dev 2021-12-22 09:24:54 +00:00
Greg Kaiser
2b95a08c99 zygote: Add setattr permission to cgroup
Credit to Himanshu Agrawal <quic_hagraw@quicinc.com> for this fix.

Like we do with cgroup_v2, we set attribute permission to cgroup
as well.

This is the same fix as
https://android-review.googlesource.com/c/platform/system/sepolicy/+/1927857/
but it applies it to the prebuilts for api 32.0.

Test: On a Go device, which uses cgroup instead of cgroup_v2
Bug: 211037424, 211514318
Change-Id: Ib57c94d72d50317619aa513e9f784582e0c45862
2021-12-20 15:21:26 -08:00
Greg Kaiser
ed71842c6d zygote: Add setattr permission to cgroup
Credit to Himanshu Agrawal <quic_hagraw@quicinc.com> for this fix.

Like we do with cgroup_v2, we set attribute permission to cgroup
as well.

Test: On a Go device, which uses cgroup instead of cgroup_v2
Bug: 211037424
Change-Id: I5d58c9f549d205f1a8bdce6c5fba1cc833f2b492
Merged-In: I5d58c9f549d205f1a8bdce6c5fba1cc833f2b492
2021-12-16 22:55:34 +00:00
Yi-yo Chiang
a01429ce0b Merge "Add system_ext_userdebug_plat_sepolicy.cil for GSI" into sc-v2-dev 2021-12-10 04:05:11 +00:00
Inseob Kim
9dc6d70044 Remove 26.0 and 27.0 compat support
Treble doesn't support T system + O vendor, so removing 26.0 (N) and
27.0 (O) prebuilts and compat files.

Bug: 207815515
Test: build
Change-Id: I98d5972221a8e77f3c45fc48ff50bb2b8eb94275
2021-12-02 10:22:10 +09:00
Inseob Kim
bee558e4bb Add 32.0 mapping files
Steps taken to produce the mapping files:

1. Add prebuilts/api/32.0/plat_pub_versioned.cil from the
/vendor/etc/selinux/plat_pub_versioned.cil file built on sc-v2-dev with
lunch target aosp_arm64-eng. Add prebuilts/api/32.0/vendor_sepolicy.cil
as an empty file.

When adding plat_pub_versioned.cil, leave only type and typeattribute
statements, removing the other statements: allow, neverallow, role, etc.

2. Add new file private/compat/32.0/32.0.cil by doing the following:
- copy /system/etc/selinux/mapping/32.0.cil from sc-v2-dev
aosp_arm64-eng device to private/compat/32.0/32.0.cil
- remove all attribute declaration statement (typeattribute ...) and
sort lines alphabetically
- some selinux types were added/renamed/deleted w.r.t 32 sepolicy.
Find all such types using treble_sepolicy_tests_32.0 test.
- for all these types figure out where to map them by looking at
31.0.[ignore.]cil files and add approprite entries to 32.0.[ignore.]cil.

This change also enables treble_sepolicy_tests_32.0 and installs
32.0.cil mapping file onto the device.

Bug: 206330997
Test: m treble_sepolicy_tests_32.0
Test: m 32.0_compat_test
Test: m selinux_policy
Change-Id: I8b2991e64e2f531ce12db7aaacad955e4e8ed687
2021-12-01 10:58:25 +09:00
Inseob Kim
43b6a317bc Add SEPolicy prebuilts for Sv2 (API 32)
Bug: 206330997
Test: Build
Change-Id: I26082be343b15c9d6c7cabf0acd44711fbcc8113
2021-11-30 12:04:43 +09:00
Inseob Kim
212e65cbe8 Make 31.0 compat files up to date
Bug: 208126864
Test: m selinux_policy 31.0_compat_test treble_sepolicy_tests_31.0
Merged-In: Ic97d17b39f7307ed5af200c97c8c09ca0511c216
Change-Id: I75d139412686ae13dddf5b99c505becc8638558a
2021-11-30 10:13:34 +09:00
Inseob Kim
5a8afdcfa6 Make 31.0 prebuilts and compat files up to date
Bug: 208126864
Test: m selinux_policy 31.0_compat_test treble_sepolicy_tests_31.0
Change-Id: Ic97d17b39f7307ed5af200c97c8c09ca0511c216
2021-11-29 19:40:59 +09:00
Navinprashath
e7fae4b66b sepolicy: Add badge for gsm properties
Add badge for gsm.operator.iso-country and gsm.sim.operator.iso-country.

Test: Manual test
Bug: 205807505
Ignore-AOSP-First: already merged in AOSP; this is a reland
Change-Id: If4f399cd97b2297094ef9431450f29e0a91e5300
Merged-In: If4f399cd97b2297094ef9431450f29e0a91e5300
2021-11-25 14:04:56 +08:00
Yi-Yo Chiang
0b240d0270 Add system_ext_userdebug_plat_sepolicy.cil for GSI
system_ext_userdebug_plat_sepolicy.cil is a copy of
userdebug_plat_sepolicy.cil (debug_ramdisk) that's installed in the
system_ext partition.
The build rule is gated by a BoardConfig variable, so products other
than GSI cannot accidentally install this module.

*Unclean cherry-pick* prebuilts/api/32.0/private/file_contexts is
updated in this change, which is not in the original change.

Bug: 188067818
Test: Flash RQ2A.201207.001 bramble-user with debug ramdisk & flash
  gsi_arm64-user from master, device can boot and `adb root` works
Change-Id: I43adc6adad5e08dcc8e106d18fdacef962310883
Merged-In: I43adc6adad5e08dcc8e106d18fdacef962310883
(cherry picked from commit 814f3deb94)
2021-11-24 14:43:03 +08:00
Inseob Kim
451eeed439 Add 31.0 mapping files
Steps taken to produce the mapping files:

1. Add prebuilts/api/31.0/plat_pub_versioned.cil from the
/vendor/etc/selinux/plat_pub_versioned.cil file built on sc-dev with
lunch target aosp_arm64-eng. Add prebuilts/api/31.0/vendor_sepolicy.cil
as an empty file.

2. Add new file private/compat/31.0/31.0.cil by doing the following:
- copy /system/etc/selinux/mapping/31.0.cil from sc-dev aosp_arm64-eng
device to private/compat/31.0/31.0.cil
- remove all attribute declaration statement (typeattribute ...) and
sort lines alphabetically
- some selinux types were added/renamed/deleted w.r.t 31 sepolicy.
Find all such types using treble_sepolicy_tests_31.0 test.
- for all these types figure out where to map them by looking at
30.0.[ignore.]cil files and add approprite entries to 31.0.[ignore.]cil.

This change also enables treble_sepolicy_tests_31.0 and installs
31.0.cil mapping file onto the device.

Bug: 189161483
Bug: 207344718
Test: m treble_sepolicy_tests_31.0
Test: m 31.0_compat_test
Test: m selinux_policy
Change-Id: I6264b9cf77b80543dfea93157b45b864157e2b14
Merged-In: I6264b9cf77b80543dfea93157b45b864157e2b14
(cherry picked from commit 4f20ff73ee)
2021-11-22 12:11:07 +00:00
Ji Luo
d338d0ef55 Fix bootchart on android12
Access denial of Apexd would cause runtime abort and the
bootchart is not working on Android 12:
  ...
  F nativeloader: Error finding namespace of apex: no namespace called com_android_art
  F zygote64: runtime.cc:669] Runtime aborting...
  F zygote64: runtime.cc:669] Dumping all threads without mutator lock held
  F zygote64: runtime.cc:669] All threads:
  F zygote64: runtime.cc:669] DALVIK THREADS (1):
  F zygote64: runtime.cc:669] "main" prio=10 tid=1 Runnable (still starting up)
  F zygote64: runtime.cc:669]   | group="" sCount=0 ucsCount=0 flags=0 obj=0x0 self=0xb4000072de0f4010
  ...

Bug: 205880718
Test: bootchart test.

Signed-off-by: Ji Luo <ji.luo@nxp.com>
Change-Id: Ia7d166605cd0b58849cb44d9a16dc3c73e1d4353
2021-11-11 16:53:24 +08:00
Michael Wright
189f7f2eea Add SEPolicy prebuilts for Sv2 (API 32)
Bug: 204295952
Test: Build
Change-Id: Id5c21d8de931fb6be01c7d1f9f6fe19dc6977de7
Merged-In: Id5c21d8de931fb6be01c7d1f9f6fe19dc6977de7
2021-11-09 19:45:38 +00:00
Bart Van Assche
e3cfa9e1d3 Revert "Remove the bdev_type and sysfs_block_type SELinux attributes"
This reverts commit 63930d3850.

Reason for revert: Broken build (https://android-build.googleplex.com/builds/submitted/7863094/aosp_raven-userdebug/latest/view/logs/error.log)

Change-Id: I1742d69d471e9b00359a2e7e654aa752513990df
2021-10-28 18:03:49 +00:00
Bart Van Assche
63930d3850 Remove the bdev_type and sysfs_block_type SELinux attributes
Remove these SELinux attributes since the apexd and init SELinux policies
no longer rely on these attributes.

The only difference between a previous version of this patch and the
current patch is that the current patch moves these attributes to the
'compat' policy. See also
https://android-review.googlesource.com/c/platform/system/sepolicy/+/1850656.

This patch includes a revert of commit 8b2b951349 ("Restore permission
for shell to list /sys/class/block"). That commit is no longer necessary
since it was a bug fix for the introduction of the sysfs_block type.

Bug: 202520796
Test: source build/envsetup.sh && lunch aosp_x86_64 && m && launch_cvd && adb -e shell dmesg | grep avc
Change-Id: Id7d32a914e48bc74da63d87ce6a09f11e323c186
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-10-25 16:26:07 -07:00
liyaoli
de5d6b4a7c Allow zygote to setattr cgroup
Bug: 203385941
Test: config ro.config.per_app_memcg=true && turn on the screen && leave it for 11 minutes

Change-Id: I7eac9c39f2ed0d9761852dbe2a26d54c27b72237
2021-10-18 20:33:48 +08:00
Kelvin Zhang
72a49cc20e Reland: Add ro.vendor.build.dont_use_vabc to property_contexts am: 6a70197dae
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/16006752

Change-Id: Iadfcd16537ad92f90fcf1c920c1437d6c68edd46
2021-10-08 22:07:58 +00:00
Satoshi Niwa
ae167c2105 Set expandattribute false for property attributes in prebuilts am: fa3b250ad1
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1435472

Change-Id: I09d504f312e95a63434c68211f5dd830b6b22f1a
2021-10-08 17:12:46 +00:00
Kelvin Zhang
6a70197dae Reland: Add ro.vendor.build.dont_use_vabc to property_contexts
Bug: 185400304
Buh: 201957239

Test: mm

This CL was merged to sc-dev, but reverted due to wrong Merged-In tag.
It resulted in mismatch between sc-dev and other branches like aosp,
internal main, etc. This change needs to reland on sc-dev.

Ignore-AOSP-First: already merged in AOSP; this is a reland

(cherry picked from commit 407b21b3cd)
Change-Id: I66703249de472bc6da16b147a69803ff141c54d3
2021-10-08 00:58:09 +00:00
Xin Li
e69c4ae635 Merge SP1A.210812.016
Merged-In: I7dec0a3d82c82b5dea4b5f3f38d9170bb1f40840
Change-Id: Idf4f6bebc2c849811bac8f6df34d1cd997978bb8
2021-09-28 19:55:59 +00:00
Suren Baghdasaryan
0e0d0ad652 sepolicy updates for adding native flag namespace for lmkd
sepolicy updates for running lmkd experiments.

Bug: 194316048
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I21df3b76cce925639385111bd23adf419f026a65
Merged-In: I21df3b76cce925639385111bd23adf419f026a65
2021-09-08 21:12:09 +00:00
Suren Baghdasaryan
3f95dc1e5b sepolicy updates for adding native flag namespace for lmkd
sepolicy updates for running lmkd experiments.

Bug: 194316048
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I21df3b76cce925639385111bd23adf419f026a65
Merged-In: I21df3b76cce925639385111bd23adf419f026a65
2021-09-02 08:03:21 -07:00
TreeHugger Robot
842d75a7e6 Merge "Revert "Reland: Add ro.vendor.build.dont_use_vabc to property_contexts"" into sc-dev 2021-08-31 17:22:23 +00:00
Kelvin Zhang
e52b7716cb Revert "Reland: Add ro.vendor.build.dont_use_vabc to property_contexts"
This reverts commit 2e7abeb570.

Reason for revert: b/197917451

Bug: 197917451

Change-Id: I570fe494976b3676074a9b8794859db75b827120
2021-08-30 16:26:48 +00:00
Orion Hodson
51bd92505b odrefresh: add permission to sigkill child processes
(cherry picked from commit 522bcbe9e6)
Ignore-AOSP-First: cherry-pick from aosp
Bug: 177432913
Bug: 196969404
Test: manually decrease odrefresh compilation timeout, no avc denied
Change-Id: I7dec0a3d82c82b5dea4b5f3f38d9170bb1f40840
(cherry picked from commit 86477d7933)
2021-08-20 00:34:06 +00:00
Orion Hodson
86477d7933 odrefresh: add permission to sigkill child processes
(cherry picked from commit 522bcbe9e6)
Ignore-AOSP-First: cherry-pick from aosp
Bug: 177432913
Bug: 196969404
Test: manually decrease odrefresh compilation timeout, no avc denied
Change-Id: I7dec0a3d82c82b5dea4b5f3f38d9170bb1f40840
2021-08-19 10:13:43 +00:00
Eric Biggers
0fc214e291 Restore permission for shell to list /sys/class/block
As a side effect, commit ec50aa5180 ("Allow the init and apexd
processes to read all block device properties") removed permission for
the shell context to list the /sys/class/block directory.  There is a
CTS test that relies on this (CtsNativeEncryptionTestCases), so grant
permission to do this again.

Bug: 196521739
Bug: 194450129
Test: Before this change, 'adb shell ls /sys/class/block' fails.
      After this change, 'adb shell ls /sys/class/block' succeeds.
Change-Id: I87cb90880f927db1385887b35c84f4dd7f95021b
Merged-In: I87cb90880f927db1385887b35c84f4dd7f95021b
(cherry picked from commit ff53c4d16e)
2021-08-19 03:22:01 +00:00
Eric Biggers
ff53c4d16e Restore permission for shell to list /sys/class/block
As a side effect, commit ec50aa5180 ("Allow the init and apexd
processes to read all block device properties") removed permission for
the shell context to list the /sys/class/block directory.  There is a
CTS test that relies on this (CtsNativeEncryptionTestCases), so grant
permission to do this again.

Bug: 196521739
Bug: 194450129
Test: Before this change, 'adb shell ls /sys/class/block' fails.
      After this change, 'adb shell ls /sys/class/block' succeeds.
Change-Id: I87cb90880f927db1385887b35c84f4dd7f95021b
Merged-In: I87cb90880f927db1385887b35c84f4dd7f95021b
2021-08-17 13:38:41 -07:00
Eric Biggers
2b7e9943d9 Merge "Restore permission for shell to list /sys/class/block" am: cc0f64416f
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1797007

Change-Id: I60b12f2a7cb088b8e648149d9356f9b00f97adbe
2021-08-17 19:17:07 +00:00
Eric Biggers
8b2b951349 Restore permission for shell to list /sys/class/block
As a side effect, commit ec50aa5180 ("Allow the init and apexd
processes to read all block device properties") removed permission for
the shell context to list the /sys/class/block directory.  There is a
CTS test that relies on this (CtsNativeEncryptionTestCases), so grant
permission to do this again.

Bug: 196521739
Bug: 194450129
Test: Before this change, 'adb shell ls /sys/class/block' fails.
      After this change, 'adb shell ls /sys/class/block' succeeds.
Change-Id: I87cb90880f927db1385887b35c84f4dd7f95021b
2021-08-16 10:54:44 -07:00
Paul Crowley
f87e5bafb5 Merge "Revert^2 "Allow vold to deleteAllKeys in Keystore"" into sc-dev 2021-08-13 02:33:43 +00:00
Paul Crowley
449a6e1351 Revert^2 "Allow vold to deleteAllKeys in Keystore"
Revert submission 15536724-revert-15521094-vold-deleteAllKeys-GDJSMLXRVZ

Reason for revert: Underlying KM problem fixed
Reverted Changes:
I8e2621bef:Revert "Detect factory reset and deleteAllKeys"
I546b980bb:Revert "Add deleteAllKeys to IKeystoreMaintenance"...
I1ed68dd9e:Revert "Allow vold to deleteAllKeys in Keystore"

Bug: 187105270
Test: booted Cuttlefish twice
Change-Id: I6a9981ace72b133082d1d600f8e45b55bdb34b44
2021-08-13 01:44:22 +00:00
TreeHugger Robot
b7d0820dcf Merge "sepolicy: Add supporting for property name with phone id" into sc-dev 2021-08-12 07:24:24 +00:00
Shawn Willden
9de6c0e94c Merge "Revert "Allow vold to deleteAllKeys in Keystore"" into sc-dev 2021-08-12 01:17:13 +00:00
Shawn Willden
4b8112473d Revert "Allow vold to deleteAllKeys in Keystore"
Revert submission 15521094-vold-deleteAllKeys

Reason for revert: Causes infinite loop in Trusty KeyMint
Reverted Changes:
I9c5c54714:Detect factory reset and deleteAllKeys
I2fb0e94db:Allow vold to deleteAllKeys in Keystore
Id23f25c69:Add deleteAllKeys to IKeystoreMaintenance
Ife779307d:Enable deleteAllKeys from vold
I4312b9a11:Enable deleteAllKeys from vold

Bug: 187105270
Change-Id: I1ed68dd9ee9a6f14152307d610af0b16dd3219ac
2021-08-12 01:08:37 +00:00
Paul Crowley
c0cae7496e Merge "Allow vold to deleteAllKeys in Keystore" into sc-dev 2021-08-11 21:41:17 +00:00
Paul Crowley
cb00759831 Merge "Allow vold to deleteAllKeys in Keystore" am: d46569c261 am: 66b0b41923
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1789529

Change-Id: I03d240d980763f3a84971f185f207204bac2602d
2021-08-11 18:13:25 +00:00
Paul Crowley
4a664e8d5d Allow vold to deleteAllKeys in Keystore
Add deleteAllKeys to IKeystoreMaintenance and allow vold to call it.
Allow vold to read the property
`ro.crypto.metadata_init_delete_all_keys.enabled`

Bug: 187105270
Test: booted twice on Cuttlefish
Ignore-AOSP-First: no merge path to this branch from AOSP.
Merged-In: I2fb0e94db9d35c1f19ca7acb2f541cfb13c23524
Change-Id: I2fb0e94db9d35c1f19ca7acb2f541cfb13c23524
2021-08-11 10:16:28 -07:00
EdenSu
ee495b312c sepolicy: Add supporting for property name with phone id
Add debug property name with phone id.

Bug: 194281028
Test: Build and verified there is no avc denied in the log
Change-Id: Ia7ca93a3390b2f59e894ca7ebce4cae9c0f83d28
Merged-In: Ia7ca93a3390b2f59e894ca7ebce4cae9c0f83d28
2021-08-11 16:37:03 +00:00
Paul Crowley
bf29c3a2dc Allow vold to deleteAllKeys in Keystore
Add deleteAllKeys to IKeystoreMaintenance and allow vold to call it.
Allow vold to read the property
`ro.crypto.metadata_init_delete_all_keys.enabled`

Bug: 187105270
Test: booted twice on Cuttlefish
Change-Id: I2fb0e94db9d35c1f19ca7acb2f541cfb13c23524
2021-08-10 21:51:09 -07:00
Bart Van Assche
db5e6c2424 Allow the init and apexd processes to read all block device properties
Addressing b/194450129 requires configuring the I/O scheduler and the
queue depth of loop devices. Doing this in a generic way requires
iterating over the block devices under /sys/class/block and also to
examine the properties of the boot device (/dev/sda). Hence this patch
that allows 'init' and 'apexd' to read the properties of all block
devices. The patch that configures the queue depth is available at
https://android-review.googlesource.com/c/platform/system/core/+/1783847.

Bug: 194450129
Test: Built Android images, installed these on an Android device and verified that modified init and apexd processes do not trigger any SELinux complaints.
Ignore-AOSP-First: This patch is already in AOSP.
Merged-In: Icb62449fe0d21b3790198768a2bb8e808c7b968e
Change-Id: Icb62449fe0d21b3790198768a2bb8e808c7b968e
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-10 09:30:27 -07:00
Bart Van Assche
052995e65e init.te: Allow init to modify the properties of loop devices
The init process configures swapping over zram over a loop device. An
I/O scheduler is associated with the loop device. Tests have shown that
no I/O scheduler works better than the default, mq-deadline. Hence
allow the init process to configure the loop device I/O scheduler.

Without this patch, the following SELinux denials are reported during
boot:

1     1 I auditd  : type=1400 audit(0.0:4): avc: denied { read write } for comm="init" name="scheduler" dev="sysfs" ino=78312 scontext=u:r:init:s0 tcontext=u:object_r:sysfs_loop:s0 tclass=file permissive=0
1     1 I auditd  : type=1400 audit(0.0:4): avc: denied { read write } for comm="init" name="scheduler" dev="sysfs" ino=78312 scontext=u:r:init:s0 tcontext=u:object_r:sysfs_loop:s0 tclass=file permissive=0

Bug: 194450129
Test: Built Android images and installed these on an Android device.
Ignore-AOSP-First: This patch is already in AOSP.
Merged-In: I0af0a92c53bb1f68b57f6814c431a7f03d8ea967
Change-Id: I0af0a92c53bb1f68b57f6814c431a7f03d8ea967
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2021-08-10 09:30:10 -07:00
Bart Van Assche
7efcbf568c Allow the init and apexd processes to read all block device properties am: ec50aa5180 am: b00618fb9f
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1783947

Change-Id: Iac344ff86cae6870c6f29fc2b4fb5529482a4219
2021-08-10 01:54:52 +00:00
Bart Van Assche
ec50aa5180 Allow the init and apexd processes to read all block device properties
Addressing b/194450129 requires configuring the I/O scheduler and the
queue depth of loop devices. Doing this in a generic way requires
iterating over the block devices under /sys/class/block and also to
examine the properties of the boot device (/dev/sda). Hence this patch
that allows 'init' and 'apexd' to read the properties of all block
devices. The patch that configures the queue depth is available at
https://android-review.googlesource.com/c/platform/system/core/+/1783847.

Test: Built Android images, installed these on an Android device and verified that modified init and apexd processes do not trigger any SELinux complaints.
Change-Id: Icb62449fe0d21b3790198768a2bb8e808c7b968e
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-09 13:46:41 -07:00
Martijn Coenen
025423495e Merge "Allow shell to read odsign properties." am: a194f2737e am: ee5b30b948
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1787990

Change-Id: I293034ab8a42c7b79f0db2b1004094ea9594fcbf
2021-08-09 07:19:16 +00:00
Martijn Coenen
a194f2737e Merge "Allow shell to read odsign properties." 2021-08-09 06:45:56 +00:00
Martijn Coenen
fd6d708cc1 Allow shell to read odsign properties.
The shell context can invoke app_process (ART runtime), which in turn
reads odsign_prop to determine whether we determined that the generated
artifacts are valid. Since this was denied until now, app processes
invoked through shell would fall back to JIT Zygote. This is probably
fine, but since fixing the denial is really simple (and not risky), this
option might be preferred over adding it to the bug map.

Bug: 194630189
Test: `adb shell sm` no longer generates a denial
Change-Id: Ia7c10aec53731e5fabd05f036b12e10d63878a30
2021-08-06 08:40:40 +02:00
Bart Van Assche
920fb6cb48 Merge "init.te: Allow init to modify the properties of loop devices" am: cb779773b7 am: a953822b61
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1782387

Change-Id: I783a810622dc05fc2eb667268596d50c4b21430e
2021-08-05 17:10:39 +00:00
Bart Van Assche
9059e215dc init.te: Allow init to modify the properties of loop devices
The init process configures swapping over zram over a loop device. An
I/O scheduler is associated with the loop device. Tests have shown that
no I/O scheduler works better than the default, mq-deadline. Hence
allow the init process to configure the loop device I/O scheduler.

Without this patch, the following SELinux denials are reported during
boot:

1     1 I auditd  : type=1400 audit(0.0:4): avc: denied { read write } for comm="init" name="scheduler" dev="sysfs" ino=78312 scontext=u:r:init:s0 tcontext=u:object_r:sysfs_loop:s0 tclass=file permissive=0
1     1 I auditd  : type=1400 audit(0.0:4): avc: denied { read write } for comm="init" name="scheduler" dev="sysfs" ino=78312 scontext=u:r:init:s0 tcontext=u:object_r:sysfs_loop:s0 tclass=file permissive=0

Bug: 194450129
Test: Built Android images and installed these on an Android device.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Change-Id: I0af0a92c53bb1f68b57f6814c431a7f03d8ea967
2021-08-04 11:48:14 -07:00
Rick Yiu
7c14f44109 Move vendor_sched to common sepolicy
Previously vendor_sched is put under product area which will be replaced
by GSI. To solve it, move it to system/sepolicy.

Bug: 194656257
Test: build pass
Change-Id: I15801c0db0a8643cac2a2fc1f004db6fb21050dc
Merged-In: Ia0b855e3a876a58b58f79b4fba09293419797b47
2021-07-30 03:03:42 +00:00
Martijn Coenen
3f1c5d5c14 Merge "Allow odsign to stop itself." into sc-dev 2021-07-28 15:06:47 +00:00
Martijn Coenen
3ca856a1a9 Merge "Allow odsign to stop itself." am: 359aea7d49 am: 632c8e428f
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1779988

Change-Id: I863a95342f0a37f14107827df145a49f2a911c19
2021-07-28 12:20:34 +00:00
Martijn Coenen
28377a8a17 Allow odsign to stop itself.
Carve out a label for the property, and allow odsign to set it.

Bug: 194334176
Test: no denials
Change-Id: I9dafefabc27c679ed9f36e617e824f44f3b16bbd
Merged-In: I9dafefabc27c679ed9f36e617e824f44f3b16bbd
2021-07-28 11:52:48 +00:00
Martijn Coenen
359aea7d49 Merge "Allow odsign to stop itself." 2021-07-28 11:50:22 +00:00
Martijn Coenen
5f21a0fa92 Allow odsign to stop itself.
Carve out a label for the property, and allow odsign to set it.

Bug: 194334176
Test: no denials
Change-Id: I9dafefabc27c679ed9f36e617e824f44f3b16bbd
2021-07-28 10:50:35 +02:00
Jiakai Zhang
7f60ff9cda Track system_server->apex_art_data_file denial. am: 329cbf4d4e am: 82a576c1a4
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1771168

Change-Id: Ic90844a9811fcd55283acd10db3d930707d3af9c
2021-07-24 10:06:37 +00:00
Jiakai Zhang
329cbf4d4e Track system_server->apex_art_data_file denial.
The denial occurs when system_server dynamically loads AOT artifacts at
runtime.

Sample message:
type=1400 audit(0.0:4): avc: denied { execute } for comm="system_server" path="/data/misc/apexdata/com.android.art/dalvik-cache/arm64/system@framework@com.android.location.provider.jar@classes.odex" dev="dm-37" ino=296 scontext=u:r:system_server:s0 tcontext=u:object_r:apex_art_data_file:s0 tclass=file permissive=0

Currently, system_server is only allowed to load AOT artifacts at startup. odrefresh compiles jars in SYSTEMSERVERCLASSPATH, which are supposed to be loaded by system_server at startup. However, com.android.location.provider is a special case that is not only loaded at startup, but also loaded dynamically as a shared library, causing the denial.

Therefore, this denial is currently expected. We need to compile com.android.location.provider so that its AOT artifacts can be picked up at system_server startup, but we cannot allow the artifacts to be loaded dynamically for now because further discussion about its security implications is needed. We will find a long term solution to this, tracked by b/194054685.

Test: Presubmits
Bug: 194054685

Change-Id: I3850ae022840bfe18633ed43fb666f5d88e383f6
2021-07-24 09:42:03 +08:00
TreeHugger Robot
8797257e3f Merge "property_contexts: Add ro.lmk.filecache_min_kb property context" into sc-dev 2021-07-21 07:34:31 +00:00
Orion Hodson
5194040519 Merge "postinstall_dexopt: allow reading odsign.verification.status" am: ae132647b1 am: 14b66293ba
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1771328

Change-Id: I1b7b3d5f34c4fff9ba4282afa2cdec97895bfd6e
2021-07-20 11:21:34 +00:00
Orion Hodson
ae132647b1 Merge "postinstall_dexopt: allow reading odsign.verification.status" 2021-07-20 10:58:57 +00:00
Daniel Norman
072de7b4b2 Merge "Rename vpnprofilestore to legacykeystore in 31.0 mapping files." am: f541acd250 am: ffb2010a0a
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1771593

Change-Id: I7699781df4dccce679a8baccdb5e47074e0fb3db
2021-07-20 00:44:25 +00:00
Orion Hodson
07cafca82a postinstall_dexopt: allow reading odsign.verification.status
Allows dexopt to read odsign verification status and use on-device
generated artifacts when dexopting after an OTA.

(cherry pick from change 5fcce9ded3)
Bug: 194069492
Ignore-AOSP-First: cherry pick of https://r.android.com/1771328
Test: manually apply ota, see no denials for reading property
Merged-In: I97acfc17ffd9291d1a81906c75039f01624dff0f
Change-Id: I05453570add7365e1c094d3ea316d53d7c52023a
2021-07-19 19:47:33 +00:00
Orion Hodson
5fcce9ded3 postinstall_dexopt: allow reading odsign.verification.status
Allows dexopt to read odsign verification status and use on-device
generated artifacts when dexopting after an OTA.

Bug: 194069492
Test: manually apply ota, see no denials for reading property
Change-Id: I97acfc17ffd9291d1a81906c75039f01624dff0f
2021-07-19 20:37:20 +01:00
Daniel Norman
31aaac3f18 Rename vpnprofilestore to legacykeystore in 31.0 mapping files.
This service was renamed in
commit 8aaf796f980f21a8acda73180a876095b960fc28
after the mapping files were originally created in
commit 4f20ff73ee.

Bug: 191304621
Test: Merge redfin_vf_s T-based system with S-based vendor.
Change-Id: I3430f13a3438c06c6cb469a35a80390f83b1c0b4
2021-07-19 11:51:14 -07:00