Commit graph

763 commits

Author SHA1 Message Date
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
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
Treehugger Robot
1fa1ef4e0d Merge "Allow vendor_init to read device config vendor_system_native properties" 2022-05-19 08:05:16 +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
e14ad82c98 Merge "Update sepolicy prebuilts to sync vendor_system_native prop changes" 2022-05-17 10:56:44 +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
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
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
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
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
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
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
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
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
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