Commit graph

32957 commits

Author SHA1 Message Date
Treehugger Robot
dca210652e Merge "Revert "Add userspace_panic_device and userpanic_use"" am: a122abab14
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1830054

Change-Id: I4edb6b900482530a984b31fd389a6e0ceef2d2c3
2021-09-20 07:02:12 +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
Treehugger Robot
d3c15334bb Merge "Allow composd to run odrefresh" am: ad48d3e9f1
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1827881

Change-Id: I8bed3def64f192d2148816204c8a37c4c58d1348
2021-09-17 12:39:02 +00: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
a0bac44805 Add virtualizationservice.state.last_cid am: b804de2943
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1827500

Change-Id: I007226b8d1a64f162f65bf49eb929b7dc7ed1658
2021-09-17 09:14:09 +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
4cb59e4221 Merge "compos_verify_key no longer creates a vsock" am: e494c51bc9
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1827214

Change-Id: Ie1f78f588961fe6efc553e38effe34174bf3fac0
2021-09-16 08:24:04 +00: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
957b2c8437 microdroid: Remove default_prop access am: e17b985e1c
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1826060

Change-Id: I8508d05b33f661fa9aae8e95f2afa24c2f82b984
2021-09-15 06:50:14 +00: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
c7801169d8 Merge "Bundle proc_bootconfig permission into read_fstab" am: 855f16dd87
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1826536

Change-Id: I93104b7549a3596ad62a37f80ab747f8cc770a90
2021-09-15 03:51:17 +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
ca6e41f061 Allow automotive_display_service to use EGL files am: c5e8db55f9
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1825635

Change-Id: I537ebd4304348d6f9b02749a0ed39a18c6380814
2021-09-14 01:03:58 +00: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
62858f1178 Merge "Initial sepolicy for composd" am: 0bbfc68a49
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1824054

Change-Id: I52b316146c7c3c9ee234fcd11f2a80b5abada3ad
2021-09-13 11:59:14 +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
55bac72d44 Allow microdroid_manager to create a /apex/* file am: 6e60287a1f
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1823813

Change-Id: Ia41ec5bb715be17ae031786fd1de454a0be81e06
2021-09-10 14:58:58 +00: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
2e80ad5fd9 Merge "make zipfuse a bootstrap process" am: f19cd64a0e
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1821986

Change-Id: I96cd2336ab637726e900d1760a4ee7d6c143a60d
2021-09-10 08:27:25 +00:00
Jooyung Han
f19cd64a0e Merge "make zipfuse a bootstrap process" 2021-09-10 08:16:31 +00:00
Treehugger Robot
77b9fbf4c0 Merge "Add the 'bdev_type' attribute to all block device types" am: 68e5958902
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1821935

Change-Id: Ifb345fe53482c49b370ea71e787601d7ff35769b
2021-09-10 01:41:23 +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
b7f4c1a252 Merge "allow system server to read extcon state and type from sysfs" am: a37bf10692
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1821341

Change-Id: Ib1f53e2e731c875ac3d5e78bec28fd958cc7d671
2021-09-10 01:14:37 +00:00
Gregory Montoir
505fc17f35 Merge "Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6}" am: 2881a253da
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1821714

Change-Id: I1f8438ef4f5119b63a4b99e4cf8f2026dc4ce5c8
2021-09-10 01:13:52 +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
a325b5c195 Merge "Allow crash_dump to read from /data/local/tests." am: adaabe529c
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1821636

Change-Id: Id23835b202676224eac8c57b1322d55df28cd87f
2021-09-09 23:43:49 +00:00
Christopher Ferris
adaabe529c Merge "Allow crash_dump to read from /data/local/tests." 2021-09-09 23:20:41 +00:00
Christopher Ferris
f2acb20e1b Allow crash_dump to read from /data/local/tests.
Without this change, any crash from an executable in /data/local/tests
is incomplete. Specifically, function names are missing which makes
the crash nearly useless for debugging.

Bug: 197229540

Test: Used the crasher executable and copied it to /data/local/tests
Test: and verified that running it as root and shell results in
Test: tombstones that have full unwinds with function names.
Change-Id: Ic4862ca6ee9b02132a593ccd5fe26508ed5c8510
2021-09-09 14:49:36 -07:00
Bill Yi
9a0413097d [automerger skipped] Merge "Merge RQ3A.210905.001 to aosp-master - DO NOT MERGE" am: a053861726 -s ours
am skip reason: subject contains skip directive

Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1822913

Change-Id: Icd035d4da1c121208db96d019dec43a8e1a4f665
2021-09-09 21:39:32 +00:00
Bill Yi
a053861726 Merge "Merge RQ3A.210905.001 to aosp-master - DO NOT MERGE" 2021-09-09 21:27:25 +00:00
Hongguang
8e5d3d469f allow system server to read extcon state and type from sysfs
The target device needs to lable the SoC's extcons to sysfs_extcon in
the device's vendor sepolicy to allow the system_server access.

Bug: 152245127
Bug: 193492798
Bug: 193114615
Test: pressubmit and manual
Change-Id: Ib0a90ac5ce2c9437b19d6dc1e0b2cc50fed41dc3
2021-09-09 14:15:19 -07:00
Gregory Montoir
0e1044ae8f Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6}
File accesses go through com.android.ddmlib.SyncService for CTS
ListeningPortsTest.

Bug: 193151739
Change-Id: I0c66fb5e35cda3b1799cf003402e454d7a951e96
2021-09-09 14:31:15 +08:00
Inseob Kim
a2b2fa2e01 Add vsock permissions to microdroid_payload am: 2f7600920d
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1818016

Change-Id: I1c475f82eb85e1fb531302e3825e4522841fca3c
2021-09-09 06:24:06 +00:00
Alan Stokes
872a6f52aa Restrict VM usage to platform_app. am: f96cd6557e
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1820377

Change-Id: I61be7eadb593bef05d1afa7bda448dfb1978bbe0
2021-09-09 04:34:17 +00:00
Inseob Kim
2f7600920d Add vsock permissions to microdroid_payload
microdroid_payload needs to open a vsock server, so this change grants
permissions for that. This change also temporarily grants permissions to
get local CID, which should be removed once the RPC binder API supports
getting CID.

Bug: 195381416
Test: atest MicrodroidHostTestCases
Change-Id: I57a603e74d7552e13a83fa4934621e09e13015fd
2021-09-09 02:30:59 +00:00
Alan Stokes
f96cd6557e Restrict VM usage to platform_app.
Remove access from untrusted apps and instead grant it to platform_app
(but on user builds as well as debug).

Also restrict any app from creating a vsock_socket; using an already
created one is fine.

Bug: 193373841
Test: Microdroid demo app now gets a denial
Test: Rebuild demo with certifcate: platform, adb install, no denial
Change-Id: I7be011e05244767a42d4c56e26de792db4fe599d
2021-09-09 02:30:43 +00:00
Bill Yi
82fd149648 Merge RQ3A.210905.001 to aosp-master - DO NOT MERGE
Merged-In: I637157e5836746048bc597ccc97ad5cb506bf561
Merged-In: I7666150b5e36ef12e4bb4cc0d27bc48dc8bd8449
Merged-In: I7666150b5e36ef12e4bb4cc0d27bc48dc8bd8449
Change-Id: I5e73ddfc69c46aed26cb2a28533d2210c000c635
2021-09-08 17:57:11 -07:00
Bart Van Assche
8a6f8e51bc Add the 'bdev_type' attribute to all block device types
The following patch iterates over all block devices:
https://android-review.googlesource.com/c/platform/system/core/+/1783847/9

The following patch grants 'init' and 'apexd' permission to iterate over
all block devices:
https://android-review.googlesource.com/c/platform/system/sepolicy/+/1783947

The above SELinux policy change requires to add the 'bdev_type'
attribute to all block devices. Hence this patch.

Bug: 194450129
Test: Untested.
Signed-off-by: Bart Van Assche <bvanassche@google.com>
Change-Id: Iee1c984f176eb2752194493999921cb1aa24ac64
2021-09-08 16:13:25 -07:00