Commit graph

29252 commits

Author SHA1 Message Date
Ytai Ben-Tsvi
9eaf3be545 Add soundtrigger3 HAL (AIDL) to sepolicy
Test: Compile and boot. Don't yet have a HAL implementation to test
      with.
Change-Id: I387abd0e8913eef865cba2aee0a4ef714232bb19
2021-03-23 10:34:19 -07:00
Alan Stokes
9b0058ed0d Merge "Allow zygote to mount obb and data dirs on top of the mounted dirs." 2021-03-23 17:25:18 +00:00
Steven Moreland
2b230ee028 Merge "s/hw// in hal_attribute_service documentation." 2021-03-23 17:17:33 +00:00
Yo Chiang
0fb8c23162 Merge changes I82f2bbb5,I0e203665
* changes:
  gsid: Remove redundant neverallow rules
  gsid: Strengthen neverallow by s/notdevfile_class_set/file_class_set/
2021-03-23 14:25:11 +00:00
Inseob Kim
4360c1975f Add target_with_dexpreopt option to policy
It was missing when migrating definitions.mk to Android.bp module.

Test: m selinux_policy on sc-arc
Change-Id: I3c943440295bc9064d50e1a2f9025715c76b539e
2021-03-23 20:52:53 +09:00
satayev
f1d2a6330a Merge "Revert^2 "Introduce derive_classpath."" 2021-03-23 10:10:00 +00:00
Yi-Yo Chiang
32e1f1044d gsid: Remove redundant neverallow rules
These neverallow rules have grown over the years, and there are now some
duplicated rules. For example,
  neverallow scon tcon:tcls ~{ read };
really isn't doing anything due to the
  neverallow scon tcon:tcls *;
banning every actions already.

Remove these rules to make them more manageable, and make the follow-up
changes simpler to review.

Bug: 181110285
Test: Build pass
Change-Id: I82f2bbb54436153507b451a61b3075f223522028
2021-03-23 09:59:29 +00:00
Yi-Yo Chiang
6ef4d9d6ea gsid: Strengthen neverallow by s/notdevfile_class_set/file_class_set/
We're not doing anything special with device files, so no point
excluding them from the neverallow rules.
Principle of KISS.

Bug: 181110285
Test: Build pass
Change-Id: I0e203665aa2134579d97b580cb9301755edb62b1
2021-03-23 09:59:18 +00:00
Yi Kong
21e37b87e0 Sort entries, NFC.
Follow up post commit comment from aosp/1648110. No functionality
change.

Test: N/A
Change-Id: Id75d78dbae09b831a2caef37dc7d2b8784cc2957
2021-03-23 13:56:47 +08:00
Yi Kong
665c18ebc9 Merge "Allow profcollectd to store and read its application specific node ID in properties" 2021-03-23 05:27:56 +00:00
Yi Kong
b72153bcb7 Merge "Allow betterbug to read profile reports generated by profcollect" 2021-03-23 03:29:46 +00:00
Weilun Du
e0e3b45386 Merge "[Bug Fix] Add exact string to property qemu.hw.mainkeys" 2021-03-23 02:57:04 +00:00
Treehugger Robot
575a65f030 Merge "Reland "Build platform side policy with Soong"" 2021-03-23 02:31:35 +00:00
Steven Moreland
4e306bf4cf s/hw// in hal_attribute_service documentation.
Some details here are copied from hal_attribute_hwservice but
no longer make sense here.

Bug: N/A
Test: N/A
Change-Id: Ia4a4d6731b5e5270922d32b7854d36bd726d202b
2021-03-22 22:21:52 +00:00
Yi Kong
9b65845b4a Allow profcollectd to store and read its application specific node ID in properties
This node ID will be used to uniquely and anonymously identify a device
by profcollectd on engineering (userdebug or eng) builds.

Test: build
Change-Id: If01f71c62479d63d4d19aac15da24bc835621e66
2021-03-22 19:40:03 +00:00
Stephen Crane
25a0df28a6 Add IKeystoreService interface to keystore_service
IKeystoreService is a VINTF stability interface, and keystore2 is now
using this interface correctly from Rust.

Test: m && adb shell start keystore2
Bug: 179907868
Change-Id: I3b583df2fac7e6bca7c1875efb7650f9ea0a548c
2021-03-22 11:46:59 -07:00
Weilun Du
aa5611337e [Bug Fix] Add exact string to property qemu.hw.mainkeys
qemu.hw.mainkeys exists both in plat_property_contexts and
vendor_property_contexts. This would cause breakage in GSI build
for certain vendors. To fix, add `exact {type}` to make the property
defined in system takes precedence.

Bug: 180412668

Signed-off-by: Weilun Du <wdu@google.com>
Change-Id: I1268e6a202d561a1e43f3d71fb38c6000042306b
2021-03-22 17:11:31 +00:00
Michael Rosenfeld
133496f8a4 Merge "Permit dropping caches from the shell through sys.drop_caches." 2021-03-22 16:04:32 +00:00
Yi Kong
ae9645ecb5 Allow betterbug to read profile reports generated by profcollect
Test: presubmit
Change-Id: I833c0ebaa27a0c8feddf23e4b648ee067c41ae2b
2021-03-22 22:57:57 +08:00
Ricky Wai
7398c147fe Allow zygote to mount obb and data dirs on top of the mounted dirs.
As data and obbs are already mounted to lowerfs, and we need per app visibility isolation to mount
on those directories.

Here's the warning if we do not add it.
3094  3094 W main    : type=1400 audit(0.0:36): avc: denied { mounton } for path="/storage/emulated/0/Android/obb" dev="dm-5" ino=9206 scontext=u:r:zygote:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=dir permissive=0


Bug: 182997439
Test: No selinux warnings during boot.
Change-Id: Id78d793e70acf0d7699c006e19db6d7fda766bf1
2021-03-22 11:07:06 +00:00
Inseob Kim
a49e724038 Reland "Build platform side policy with Soong"
This reverts commit d869d02758.

Reason for revert: fixed breakage

The breakage was due to the difference between plat_sepolicy.conf and
microdroid_vendor_sepolicy.conf. Now vendor_sepolicy.conf is built with
se_policy_conf module, so it is synced with plat_sepolicy.conf

Test: boot microdroid with and without SANITIZE_TARGET=address
Change-Id: Ia7d79f5a1eba323b23682d2322a61159dd170441
2021-03-22 13:40:13 +09:00
Satya Tangirala
0653374e71 Add convert_storage_key_to_ephemeral to keystore2_key access vector
Introduce the convert_storage_key_to_ephemeral permission to the
keystore2_key access vector and give vold permission to use it. This
permission must be checked when a caller wants to get a per-boot
ephemeral key from a long lived wrapped storage key.

Bug: 181806377
Bug: 181910578
Change-Id: I542c084a8fab5153bc98212af64234e62e9ad032
2021-03-21 14:14:28 -07:00
Treehugger Robot
158db41e21 Merge "Expose domain_verification_service" 2021-03-19 20:28:40 +00:00
Michael Rosenfeld
3ccbebb415 Permit dropping caches from the shell through sys.drop_caches.
*   Permits setting the sys.drop_caches property from shell.
*   Permits init to read and write to the drop_caches file.
*   Can only be set to 3 (drop_caches) and 0 (unset).

Bug: 178647679
Test: flashed user build and set property; no avc denials.
Test: flashed userdebug build and dropped caches w/o root.
Change-Id: Idcedf83f14f6299fab383f042829d8d548fb4f5d
2021-03-19 10:55:51 -07:00
Janis Danisevskis
b488a8fe1a Keystore 2.0: Remove keystore2.enable property.
Bug: 171563717
Test: N/A
Change-Id: I85819a71dc24777a9d54f0c83b8b29da9f48cec1
2021-03-19 10:07:49 -07:00
Kholoud Mohamed
bd0268c020 Merge "Add app_api_service to lock_settings_service" 2021-03-19 15:13:35 +00:00
satayev
afc9791f21 Revert^2 "Introduce derive_classpath."
5fd85de907

Bug: 180105615
Test: manual boot of cuttlefish and gphone emulator
Change-Id: I9e43268d3b745e65b5ccc0a4896a7e55a253659d
2021-03-19 11:23:00 +00:00
Martijn Coenen
0b47552028 Merge "Add odsign status properties." 2021-03-19 10:30:20 +00:00
Inseob Kim
7a5febc2e9 Merge "Revert "Build platform side policy with Soong"" 2021-03-19 09:32:58 +00:00
Treehugger Robot
12f3121d79 Merge "Define ro.board.first_api_level property" 2021-03-19 08:50:36 +00:00
Inseob Kim
d869d02758 Revert "Build platform side policy with Soong"
This reverts commit 7629e86053.

Reason for revert: broke build

Change-Id: I97dc1ea78901cab62404780e7ee096ad45c0b21b
2021-03-19 07:04:51 +00:00
Inseob Kim
14a7b3a3f6 Merge changes from topic "sepolicy_android_bp"
* changes:
  Build platform side policy with Soong
  Add se_policy_cil module to build cil policy
  Add se_policy_conf module to build policy.conf
2021-03-19 04:20:12 +00:00
Wei Wang
cc01eb9d89 Merge "Grant access to cpuhp_pause trace point" 2021-03-18 23:49:14 +00:00
Hridya Valsaraju
1d1f2c257d Merge "Allow dumpstate to read /dev/binderfs/binder_logs/proc" 2021-03-18 21:17:43 +00:00
Orion Hodson
660cf864c8 Merge "Revert "Introduce derive_classpath."" 2021-03-18 19:18:02 +00:00
Orion Hodson
5fd85de907 Revert "Introduce derive_classpath."
Revert submission 1602413-derive_classpath

Bug: 180105615
Fix: 183079517
Reason for revert: SELinux failure leading to *CLASSPATH variables not being set in all builds

Reverted Changes:
I6e3c64e7a:Introduce derive_classpath service.
I60c539a8f:Exec_start derive_classpath on post-fs-data.
I4150de69f:Introduce derive_classpath.

Change-Id: I17e2cd062d8fddc40250d00f02e40237ad62bd6a
2021-03-18 17:00:43 +00:00
Inseob Kim
7629e86053 Build platform side policy with Soong
This replaces the following policy files with Android.bp modules:

  - reqd_policy_mask.cil
  - plat_sepolicy.cil
  - system_ext_sepolicy.cil
  - product_sepolicy.cil
  - plat_pub_policy.cil
  - system_ext_pub_policy.cil
  - pub_policy.cil
  - general_sepolicy.conf (for CTS)

Also microdroid's system policy now uses above.

Bug: 33691272
Bug: 178993690
Test: policy files stay same
Test: boot normal device and microdroid, see sepolicy works
Test: build CtsSecurityHostTestCases
Change-Id: I908a33badee04fbbdadc6780aab52e989923ba57
2021-03-18 19:54:35 +09:00
Inseob Kim
df1a0dee63 Add se_policy_cil module to build cil policy
This adds a new module se_policy_cil. It will consume the policy.conf
file (usually built with se_policy_conf) and outputs a compiled cil
policy file, which will be shipped to devices.

Bug: 33691272
Test: try building se_policy_cil from se_policy_conf
Change-Id: I7a33ab6cb5978e1a7d991be7514305c5e9f8159b
2021-03-18 19:54:30 +09:00
Inseob Kim
7e8bd1e657 Add se_policy_conf module to build policy.conf
This adds a new soong module that transforms selinux policy files to
policy.conf file. It uses m4 macro with various variables, and replaces
transform-policy-to-conf macro in system/sepolicy/definitions.mk.

The module will be used when building:
- policy cil files shipped to the device
- CTS tests that needs general_policy.conf

Bug: 33691272
Test: try building se_policy_conf with se_build_files
Change-Id: Ie1082a8193c2205992b425509b9d5bfa4b495b2f
2021-03-18 19:52:09 +09:00
Hridya Valsaraju
a758a5cc3b Allow dumpstate to read /dev/binderfs/binder_logs/proc
This patch fixes the following denial:
avc: denied { read } for name=\"1194\" dev=\"binder\" ino=1048790
 scontext=u:r:dumpstate:s0 tcontext=u:object_r:binderfs_logs_proc:s0 tclass=file permissive=0

Test: build
Bug: 182334323
Change-Id: I739f09f56763e3e7ac01dced6feda7a5a5fd2210
2021-03-17 22:47:43 -07:00
Wei Wang
0c032814b9 Grant access to cpuhp_pause trace point
Bug: 172971380
Test: Build
Change-Id: If09139990ef396c8de4d8990aae45ae483f2fb31
2021-03-17 16:43:53 -07:00
Peter Collingbourne
228c1c396c Merge "Add support for a hw_timeout_multiplier system property." 2021-03-17 18:18:51 +00:00
Treehugger Robot
baf84ee461 Merge "Add SELinux policy for using userfaultfd" 2021-03-17 15:04:51 +00:00
Thiébaud Weksteen
bcfca1a686 Add SELinux lockdown policy
The lockdown hook defines 2 modes: integrity and confidentiality [1].
The integrity mode ensures that the kernel integrity cannot be corrupted
by directly modifying memory (i.e. using /dev/mem), accessing PCI
devices, interacting with debugfs, etc. While some of these methods
overlap with the current policy definition, there is value in enforcing
this mode for Android to ensure that no permission has been overly
granted. Some of these detection methods use arbitrary heuristic to
characterize the access [2]. Adapt part of the policy to match this
constraint.

The confidentiality mode further restricts the use of other kernel
facilities such as tracefs. Android already defines a fine-grained
policy for these. Furthermore, access to part of tracefs is required in
all domains (see debugfs_trace_marker). Allow any access related to this
mode.

[1] https://lore.kernel.org/linux-api/20190820001805.241928-4-matthewgarrett@google.com/
[2] https://lore.kernel.org/linux-api/20190820001805.241928-27-matthewgarrett@google.com/

Bug: 148822198
Test: boot cuttlefish with patched kernel; check logcat for denials.
Test: run simpleperf monitor to exercise tracefs; check logcat for denials.
Change-Id: Ib826a0c153771a61aae963678394b75faa6ca1fe
2021-03-17 15:26:01 +01:00
Treehugger Robot
e165cd486b Merge "Keystore 2.0: Allow apps to get the Keystore state." 2021-03-17 14:11:21 +00:00
Mohammad Islam
a3f3045f42 Merge "Relocate permission to reserve file from update_engine to apexd" 2021-03-17 12:50:15 +00:00
Lokesh Gidra
06edcd8250 Add SELinux policy for using userfaultfd
ART runtime will be using userfaultfd for a new heap compaction
algorithm. After enabling userfaultfd in android kernels (with SELinux
support), the feature needs policy that allows { create ioctl read }
operations on userfaultfd file descriptors.

Bug: 160737021
Test: Manually tested by exercising userfaultfd ops in ART
Change-Id: I9ccb7fa9c25f91915639302715f6197d42ef988e
2021-03-17 04:57:22 -07:00
satayev
ba22487f86 Merge "Introduce derive_classpath." 2021-03-17 10:58:30 +00:00
Justin Yun
0839607a0c Define ro.board.first_api_level property
When a device define BOARD_SHIPPING_API_LEVEL with an API level, it
sets a vendor property ro.board.first_api_level in vendor/build.prop.
This property is initiated by vendor_init and read-only.

Bug: 176950752
Test: getprop ro.board.first_api_level
Change-Id: Ia09d2e80f1ca4a79dbe4eb0dc11b189644819cad
2021-03-17 15:06:44 +09:00
Howard Chen
28003eeda4 Merge "Support copy-on-write persistent data block when running a DSU" 2021-03-17 02:07:03 +00:00