Commit graph

30324 commits

Author SHA1 Message Date
Treehugger Robot
f958c5ca73 Merge changes from topic "se_policy_binary"
* changes:
  Migrate system sepolicy binaries to Soong
  Add se_policy_binary module
2021-09-29 03:52:48 +00:00
Yifan Hong
a07b83c1c6 Merge "/*_dlkm/etc is vendor_configs_file." 2021-09-28 05:37:47 +00:00
Inseob Kim
4d90b7e78b Migrate system sepolicy binaries to Soong
Bug: 33691272
Test: m selinux_policy
Test: boot microdroid
Change-Id: I9210be15b06e0dba01677d5bfe7b27a0ec21eb11
2021-09-28 01:21:39 +00:00
Yifan Hong
0f4fb284d1 /*_dlkm/etc is vendor_configs_file.
For e.g. /vendor_dlkm/etc/NOTICE.xml.gz

Test: pass
Fixes: 201090220
Change-Id: I56e2bec26cad11e9919729410c7ee08683ea2f01
2021-09-27 13:33:22 -07:00
Nikita Ioffe
8d003bc3c0 Merge "Cleanup sepolicy related to APEX pre/post-install hooks" 2021-09-27 20:16:54 +00:00
Inseob Kim
b9d0511de4 Add se_policy_binary module
se_policy_binary module compiles cil files to sepolicy binary file.

Bug: 33691272
Test: build
Change-Id: Id20183d0ac797fc68356feaad9df0d0bccc81c14
2021-09-27 13:13:46 +00:00
Jiakai Zhang
b9443cc3fa Merge "Remove dalvik.vm.dex2oat-updatable-bcp-packages-file from sepolicy." 2021-09-27 11:38:26 +00:00
Treehugger Robot
dc4ea6a681 Merge "Migrate freeze test to Soong" 2021-09-27 11:05:19 +00:00
Jiakai Zhang
e0f7873436 Remove dalvik.vm.dex2oat-updatable-bcp-packages-file from sepolicy.
This system properly is no longer needed.

Bug: 200241946
Test: Presubmits
Change-Id: I82258d7ccf125fd30655873a1b15582654dafac3
2021-09-27 09:15:17 +00:00
Yi-Yo Chiang
866b3dcc80 Merge "Reland: Add system_ext_userdebug_plat_sepolicy.cil for GSI" 2021-09-24 03:10:34 +00:00
Treehugger Robot
d190e5242d Merge "Grant apexd access the SELinux type sysfs_devices_block" 2021-09-24 02:04:53 +00:00
Inseob Kim
5530ab0269 microdroid: Add vsock_device & restrict dev access
microdroid_manager and microdroid_payload have been accessing /dev/vsock
to get the local cid. But it's labeled as device, so microdroid_manager
and microdroid_payload have had too permissive access. This adds
vsock_device to relax the access.

Test: run demo app
Test: atest MicrodroidHostTestCases ComposHostTestCases
Change-Id: I1a5955ad28817124f250f206b90c8d4e344ea865
2021-09-24 09:49:59 +09:00
Bart Van Assche
27f77dc9b0 Grant apexd access the SELinux type sysfs_devices_block
Commit ec50aa5180 ("Allow the init and apexd processes to read all
block device properties") did not include the SELinux type
sysfs_devices_block although it should have included that SELinux
type. Fix this.

Bug: 194726804
Change-Id: Ia299a0a8b28160c634863e15ae66fae8f18a5efb
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-09-23 09:52:11 -07:00
Treehugger Robot
8060cb5394 Merge "Enable odrefresh to work with composd." 2021-09-23 15:47:09 +00:00
Yi-Yo Chiang
857ffc429f Reland: 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.

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: I75183e2dfdb434aee0b015b1627c9e23b4f3437f
2021-09-23 14:26:49 +00:00
Santiago Seifert
007bd5b5be Merge "Revert "Add system_ext_userdebug_plat_sepolicy.cil for GSI"" 2021-09-23 13:25:55 +00:00
Santiago Seifert
498df59c64 Revert "Add system_ext_userdebug_plat_sepolicy.cil for GSI"
Revert submission 1824717-gsi_debug_policy

Reason for revert: Breaks the build (see b/200933187).
Reverted Changes:
I37ef02628:Add a copy of debug policy to GSI system image
I9c3dad8bb:Add PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT
I43adc6ada:Add system_ext_userdebug_plat_sepolicy.cil for GSI...
I4d6235c73:Add /system_ext/etc/selinux/ to the debug policy s...

Change-Id: I22da171e7b6628cb4c5f28f316ee317fe28761c2
2021-09-23 13:07:25 +00:00
Alan Stokes
ec4a90f59c Enable odrefresh to work with composd.
composd spawns odrefresh in its usual domain. odrefresh then spawns
fd_server in a different domain, and makes binder calls back to
composd to perform individual compilation steps.

fd_server is fairly generic, and part of the virt APEX, but this
instance is specific to composd (e.g. it has access to ART files), so
I named the domain composd_fd_server.

Bug: 186126194
Test: Run composd_cmd, artifacts generated
Change-Id: I5a431dd00b5b396a67021c618fc6edcfb25aa21b
2021-09-23 12:03:30 +01:00
Yi-Yo Chiang
55ff75d379 Merge "Add system_ext_userdebug_plat_sepolicy.cil for GSI" 2021-09-23 10:07:10 +00:00
Inseob Kim
5ee61a7628 microdroid: Narrow property permissions
microdroid's domains have been able to read/write any properties. That's
just for convenience while bringing up microdroid. This cleans up such
global permission and grants minimal access.

Bug: 194447534
Test: atest MicrodroidHostTestCases ComposHostTestCases
Test: run microdroid demo app
Change-Id: I09ce1174d4af9c228b788a522a6ab845cafd4505
2021-09-23 17:23:28 +09:00
Arthur Ishiguro
876ded0bf8 Allow dumpstate to dump Context Hub HAL
Bug: 194285834
Test: adb bugreport
Change-Id: I6cd7efddf207b896303278539ddb824ad2e4c454
2021-09-22 18:44:49 +00:00
Thiébaud Weksteen
284d756b20 Merge "Revert "Use cil_write_build_ast"" 2021-09-22 10:38:02 +00:00
Thiébaud Weksteen
bde09de39f Revert "Use cil_write_build_ast"
Revert submission 1827311-update_libselinux

Reason for revert: b/200771997 
Reverted Changes:
I088d1e94c:Fix build and use new cil_write_build_ast
I14dc4dc58:Merge remote-tracking branch 'aosp/upstream-master...
I7b77f4469:Use cil_write_build_ast

Change-Id: Ib4983288feb0139ed12cb3a07edd60d2d457022f
2021-09-22 09:15:53 +00:00
Thiébaud Weksteen
136b7f9cc4 Merge "Use cil_write_build_ast" 2021-09-22 08:10:12 +00:00
Howard Chen
10461af50d Merge "Allow vold to get the DSU status" 2021-09-22 04:09:18 +00:00
Treehugger Robot
a122abab14 Merge "Revert "Add userspace_panic_device and userpanic_use"" 2021-09-20 06:46:29 +00:00
Woody Lin
6ad56599a2 Revert "Add userspace_panic_device and userpanic_use"
This reverts commit 7ed2456b45.

Reason for revert: /dev/userspace-panic is discarded (b/188777408#comment13)
Bug: 188777408
Change-Id: I98b0159890ee755ffaefc5533f9c40d54f8f26d2
2021-09-18 03:03:36 +00:00
Nikita Ioffe
c0cac4114c Cleanup sepolicy related to APEX pre/post-install hooks
The pre/post-install hook functionality has been deprecated and removed.

Bug: 172606645
Test: atest ApexTestCases
Test: atest CtsStagedInstallHostTestCases
Change-Id: I8a5f726a0c8f005654d0430b5a4598e416ff9c28
2021-09-17 17:55:12 +01:00
Yi-Yo Chiang
814f3deb94 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.

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
2021-09-17 20:27:28 +08:00
Treehugger Robot
ad48d3e9f1 Merge "Allow composd to run odrefresh" 2021-09-17 12:22:57 +00:00
Jiyong Park
b804de2943 Add virtualizationservice.state.last_cid
It is a system property that keeps the last CID used by the
virtualizationservice. Although the information is local to the
process, a new system property is justified because the information has
to be kept across multiple runs of the process. A file however is not
desirable because the information shouldn't be persisted.

Bug: 196015427
Test: atest MicrodroidHostTestCases
Change-Id: If8ca4b6ad8d9c8cb3bb33dc9ef45de0ae6481d15
2021-09-17 09:35:58 +09:00
Alan Stokes
d3438b0f3c Allow composd to run odrefresh
Also allow odrefresh to run pvm_exec to talk to the CompOS VM.

And I moved the dontaudit & neverallow rules to the bottom while I was here.

Bug: 186126194
Test: adb shell apex/com.android.compos/bin/composd_cmd
Change-Id: I6f06dd6467a8eb59123d06c7179a86d9287e7f2f
2021-09-16 11:14:54 +01:00
Alan Stokes
e494c51bc9 Merge "compos_verify_key no longer creates a vsock" 2021-09-16 08:07:18 +00:00
Inseob Kim
d58166165a Migrate freeze test to Soong
Bug: 33691272
Test: m selinux_policy on sc-dev
Change-Id: Ie536d885034e5d888f1329ac189fd0bf9723a6c4
2021-09-16 05:08:56 +00:00
Howard Chen
8720492f2e Allow vold to get the DSU status
Currently, the vold detects the factory reset by checking the
metadata encryption key. This logic is only valid when the
device is not in DSU mode. This CL allows vold to get the DSU
status.

Test: run DSU installation on a Pixel device
Bug: 199222795
Change-Id: Ia6ca3b27afd52347b132d7e2d8be244fb9f15e7d
2021-09-16 09:58:43 +08:00
Thiébaud Weksteen
8e057d189a Use cil_write_build_ast
libsepol now provides its own function to output the AST.

Bug: 190808996
Change-Id: I7b77f446972b42eca63c2ef7c18dff01508014e8
2021-09-15 16:21:46 +02:00
Alan Stokes
6c00021051 compos_verify_key no longer creates a vsock
Instead it gets it from virtualization_service, so this TODO is now
done.

Test: Manually run comps_verify_key
Test: Trigger odsign to run compos_verify_key at boot
Bug: 186126194
Change-Id: I705e7fd43b853a19c928ab76209ec321f10ec2d7
2021-09-15 11:22:47 +01:00
Inseob Kim
e17b985e1c microdroid: Remove default_prop access
This adds properties necessary to run microdroid to property_contexts,
and then removes default_prop access to all domains except for init, as
init should be able to write all properties.

Bug: 194447534
Test: atest MicrodroidHostTestCases ComposHostTestCases
Change-Id: I2f80c71ce257613b3c3b019a3e988a5a0653d879
2021-09-15 05:26:03 +00:00
Treehugger Robot
855f16dd87 Merge "Bundle proc_bootconfig permission into read_fstab" 2021-09-15 03:36:24 +00:00
Kelvin Zhang
2b5f108143 Bundle proc_bootconfig permission into read_fstab
fs_mgr::ReadDefaultFstab calls fs_mgr:ReadFstabFromDt() which eventually
calls fs_mgr_get_boot_config_from_bootconfig_source to read boot config.
Therefore bundle permission to read proc_bootconfig. This resolves some
selinux denials for update_engine

Test: th
Change-Id: Ia8bd94eb33a38ccd939577b54910645fec4ccda8
2021-09-14 18:44:42 -07:00
Changyeon Jo
c5e8db55f9 Allow automotive_display_service to use EGL files
Bug: 199739880
Test: m -j selinux_policy and run evs_app
Change-Id: If0df74ad4708b00f213c42516eb404b98873cf4f
2021-09-13 17:35:46 +00:00
Treehugger Robot
0bbfc68a49 Merge "Initial sepolicy for composd" 2021-09-13 11:47:21 +00:00
Alan Stokes
d376e2041f Initial sepolicy for composd
Add what we need to allow composd to run and expose an AIDL service.

Also delete the policy for compsvc; we never access it in the host
now, and the real policy is in microdroid. Retain the compos_exec
type, since it is referenced in the APEX sepolicy.

Bug: 186126194
Test: adb shell cmd -w android.system.composd; no denials.
Change-Id: I5f06b2b01852cdebd2d67009b363ec08b17ce33a
2021-09-13 10:33:53 +01:00
Jooyung Han
6e60287a1f Allow microdroid_manager to create a /apex/* file
Microdroid_manager needs to pass APEX pubkeys to APEXd. Since the data
is too big for a system property, it creates a file
/apex/vm-payload-metadata so that APEXd reads/uses it.

Bug: 199371341
Test: MicrodroidHostTestCases
Change-Id: Iaf2b4fc08b36610032d9c339f787e5e34994448b
2021-09-10 17:35:26 +09:00
Jooyung Han
f19cd64a0e Merge "make zipfuse a bootstrap process" 2021-09-10 08:16:31 +00:00
Treehugger Robot
68e5958902 Merge "Add the 'bdev_type' attribute to all block device types" 2021-09-10 01:27:48 +00:00
Treehugger Robot
a37bf10692 Merge "allow system server to read extcon state and type from sysfs" 2021-09-10 01:12:49 +00:00
Gregory Montoir
2881a253da Merge "Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6}" 2021-09-10 00:47:09 +00:00
Jooyung Han
53c773a3fd make zipfuse a bootstrap process
Bug: n/a
Test: MicrodroidHostTestCases
Change-Id: Ia2ad615e919f4fcb0452d8458e505ecfbdd5818f
2021-09-10 08:56:08 +09:00
Christopher Ferris
adaabe529c Merge "Allow crash_dump to read from /data/local/tests." 2021-09-09 23:20:41 +00:00