Commit graph

6664 commits

Author SHA1 Message Date
Jeffrey Vander Stoep
48740d0d6b Merge "virtmanager: add selinux domain" 2021-03-29 07:26:44 +00:00
Yi-Yo Chiang
806898db48 Split gsi_metadata_file and add gsi_metadata_file_type attribute
Split gsi_metadata_file into gsi_metadata_file plus
gsi_public_metadata_file, and add gsi_metadata_file_type attribute.
Files that are okay to be publicly readable are labeled with
gsi_public_metadata_file. Right now only files needed to infer the
device fstab belong to this label.
The difference between gsi_metadata_file and gsi_public_metadata_file is
that gsi_public_metadata_file has relaxed neverallow rules, so processes
who wish to read the fstab can add the respective allow rules to their
policy files.
Allow gsid to restorecon on gsi_metadata_file to fix the file context of
gsi_public_metadata_file.

Bug: 181110285
Test: Build pass
Test: Issue a DSU installation then verify no DSU related denials and
  files under /metadata/gsi/ are labeled correctly.
Change-Id: I54a5fe734dd345e28fd8c0874d5fceaf80ab8c11
2021-03-29 03:09:35 +00:00
Jeff Vander Stoep
f16527f6cf virtmanager: add selinux domain
Address any denials in the log - currently just adding
the virtualization service.

Bug: 183583115
Test: ps -AZ | grep virtmanager
u: r:virtmanager:s0             virtmanager   2453     1 10930880  4544 0                   0 S virtmanager
Change-Id: Ie034dcc3b1dbee610c591220358065b8508d81cf
2021-03-25 22:22:05 +01:00
Treehugger Robot
e3c3dd3786 Merge "sepolicy: export SuspendProperties.short_suspend_threshold_millis" 2021-03-24 12:09:28 +00:00
Denny cy Lee
b23b3cf5ad sepolicy: export SuspendProperties.short_suspend_threshold_millis
Bug: 182546466
Test: Test with getprop code outside system img
Change-Id: I4817c22ecc0a143ea818e0850fb721cbdf1d5ae5
Signed-off-by: Denny cy Lee <dennycylee@google.com>
2021-03-24 07:27:48 +00:00
Lajos Molnar
3720bcced5 Merge "media: add codec2_config_prop" 2021-03-24 05:30:39 +00:00
Treehugger Robot
80acc2812e Merge "Add soundtrigger3 HAL (AIDL) to sepolicy" 2021-03-24 01:21:42 +00:00
Lajos Molnar
9b03782d4e media: add codec2_config_prop
This covers properties required by codec2 hal clients/service

Bug: 181380463
Change-Id: I88f87d8693fa49beda0a26c6d0492a12177f108b
2021-03-24 01:17:05 +00:00
Thiébaud Weksteen
6620b476a8 Merge "Add SELinux lockdown policy" 2021-03-23 17:49:53 +00:00
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
Steven Moreland
2b230ee028 Merge "s/hw// in hal_attribute_service documentation." 2021-03-23 17:17:33 +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
Treehugger Robot
158db41e21 Merge "Expose domain_verification_service" 2021-03-19 20:28:40 +00:00
Kholoud Mohamed
bd0268c020 Merge "Add app_api_service to lock_settings_service" 2021-03-19 15:13:35 +00:00
Hridya Valsaraju
1d1f2c257d Merge "Allow dumpstate to read /dev/binderfs/binder_logs/proc" 2021-03-18 21:17:43 +00: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
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
Maciej Żenczykowski
c23fb986cb update post bpf tethering mainline module split from netd
FYI: running networking tests needs extra privs:
  #============= su ==============
  allow su self:capability2 bpf;

  #============= untrusted_app ==============
  allow untrusted_app self:key_socket create;
  allow untrusted_app self:netlink_route_socket { bind nlmsg_readpriv };
  allow untrusted_app self:packet_socket create;

But obviously we can't add the last three, and not even sure about the first.

Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I778ccaf5d100cb26f167a0c690e0125594d477c3
2021-03-16 04:10:09 -07:00
Janis Danisevskis
ac4a6e75fc Keystore 2.0: Allow apps to get the Keystore state.
Bug: 171305684
Test: atest com.android.server.locksettings
Change-Id: I348e02704a0ddacb7859821149dc97df1d298758
2021-03-15 19:04:03 -07:00
kholoud mohamed
2a1682a797 Add app_api_service to lock_settings_service
This is needed to enable calls to KeyguardManager
APIs from clients e.g. CTS tests

Test: N/A
Bug: 182260585
Change-Id: Id8cf3f238f8ecab7c96a14d62003c85ab18e6ac0
2021-03-15 18:04:12 +00:00
Hasini Gunasinghe
a3031eccca Merge changes from topic "keystore_api_for_credstore"
* changes:
  Credstore: Add rules to allow credstore read keystore2_enable property.
  Add get_auth_token permission to allow credstore to call keystore2.
2021-03-15 16:02:20 +00:00
Neil Fuller
086a71e3b3 Merge "Add app_api_service to time_detector" 2021-03-15 13:25:47 +00:00
Nikita Ioffe
49505cdbc1 Merge "Add apexd_config_prop type" 2021-03-15 13:04:50 +00:00
Aaron Huang
68e7eaf35d Merge "Add selinux policies for pac_proxy_service" 2021-03-15 11:49:45 +00:00
Nikita Ioffe
360e0f91c3 Add apexd_config_prop type
This type is used for properties that provides per-device configuration
for apexd behaviour (so far - timeouts for creating/deleting dm device).

Test: builds
Bug: 182296338
Change-Id: Ib815f081d3ab94aa8c941ac68b57ebe661acedb9
2021-03-15 00:35:38 +00:00
Hasini Gunasinghe
db88d1555f Add get_auth_token permission to allow credstore to call keystore2.
This CL adds a new keystore2 permission "get_auth_token"and grants this
permission to credstore which needs to call keystore2 to obtain
authtokens.

Bug: 159475191
Test: CtsVerifier
Change-Id: I1c02ea73afa6fe0b12a2d74e51fb4a8a94fd4baf
2021-03-12 20:32:06 +00:00
Robert Shih
76730064a4 Merge "Allow communication between mediametrics & statsd" 2021-03-12 18:21:34 +00:00
Tim Van Patten
d78fd554a2 Merge "Add ephemeral_app_api_service to game_service SEpolicy" 2021-03-12 17:29:11 +00:00
Neil Fuller
426d366e0d Add app_api_service to time_detector
Commit e4d26ca32c75619c0b208db869873efbbcae262c added some lines to the
constructor of TimeManager to obtain the time_detector. This broke
the TimeManagerTest test, which uses the TimeManager via
instrumentation. Unclear why it wasn't noticed immediately but it has
been broken since then.

The simplest thing is to add app_api_service to time_detector. The
intention is for at least one time_detector service call to be called
from priv-apps so this will be needed.

Bug: 181080343
Test: atest CtsTimeTestCases:android.time.cts.TimeManagerTest#testManageConfiguration -- --abi x86_64
Change-Id: I1072409559aec02a61549c5dedeb27264c43b74f
2021-03-12 14:31:29 +00:00
Robert Shih
d37ba7316c Allow communication between mediametrics & statsd
Bug: 141714243
Test: statsd_testdrive
Change-Id: I75fed754c04e3e031d5600d0487e83099402f814
2021-03-12 04:06:23 -08:00
Treehugger Robot
dc94f8343c Merge "fastbootd: allow to fetch vendor_boot partition." 2021-03-11 23:06:30 +00:00
Winson Chiu
72e242f110 Expose domain_verification_service
There is a need to expose one of the methods as app API, so the SE
context needs to match.

Bug: 180955393
Change-Id: Id28f9b0dd5cfd760bbfdbd7c19cae5bedc22cbb1
2021-03-11 22:31:27 +00:00
Peter Collingbourne
01e58e0fe3 Add support for a hw_timeout_multiplier system property.
In order to test the platform in emulators that are orders of magnitude
slower than real hardware we need to be able to avoid hitting timeouts
that prevent it from coming up properly. For this purpose introduce
a system property, ro.hw_timeout_multiplier, which may be set to
an integer value that acts as a multiplier for various timeouts on
the system.

Bug: 178231152
Change-Id: I6d7710beed0c4c5b1720e74e7abe3a586778c678
Merged-In: I6d7710beed0c4c5b1720e74e7abe3a586778c678
2021-03-11 14:04:18 -08:00
Yifan Hong
cda79266ab fastbootd: allow to fetch vendor_boot partition.
vendor_boot is labeled as boot_block_device. With
fastboot fetch command, fastbootd needs to read
the vendor_boot device and return it to the host.

Test: pass
Bug: 173654501
Change-Id: I197e39c9e7572dc9a714f36637c02ee9ead2e5f3
2021-03-11 12:47:04 -08:00
Tim Van Patten
2155031b53 Add ephemeral_app_api_service to game_service SEpolicy
Add instant app support to game_service.

Bug: b/182342775
Test: atest CtsGameManagerTestCases --instant
Change-Id: I400f740a1aa0d8afa2d8f65499eb98e7589790d2
2021-03-11 12:04:18 -07:00
Alistair Delva
7e3a17fe31 Merge "Add kernel permission for bootconfig proc file" 2021-03-11 15:52:02 +00:00
Treehugger Robot
20a1a984ad Merge "Keystore 2.0: Rename KeystoreUserManager to KeystoreMaintenance" 2021-03-11 11:20:11 +00:00
Treehugger Robot
b9b067ce5e Merge "Fix broken neverallow rules" 2021-03-11 07:33:30 +00:00
Inseob Kim
85acf6ef70 Fix broken neverallow rules
neverallow rules with allowlist should look like:

    neverallow { domain -allow1 -allow2 } ...

Bug: 181744894
Test: m selinux_policy
Test: pcregrep -M -r "neverallow\s+{(\s*#.*\s*)*\s+-" .
Change-Id: Ibab72ccc1fbacb99b62fe127b4122e1ac22b938a
2021-03-10 10:44:22 +09:00
Janis Danisevskis
f3fe4cfc06 Keystore 2.0: Rename KeystoreUserManager to KeystoreMaintenance
Test: N/A
Change-Id: I40c07e40cb0a852814058fe89d57c44ea85f1994
2021-03-09 14:35:16 -08:00
Alistair Delva
ab8b3dfec5 Add kernel permission for bootconfig proc file
Just before selinux is set up, the kernel context must be allowed to
access the /proc/bootconfig file to read the state of the
androidboot.selinux= property. Such permission was already granted for
accessing the /proc/cmdline file for the same reason.

Bug: 173815685
Test: launch_cvd -extra_kernel_cmdline androidboot.selinux=permissive
Test: launch_cvd -guest_enforce_security=false [bootconfig method]
[..]
init: Permissive SELinux boot, forcing sys.init.perf_lsm_hooks to 1.
[..]
Change-Id: I999c0c9d736bed18e5daea81bb0f8cc78350eba7
2021-03-09 19:37:22 +00:00
Paul Lawrence
c04f037629 Fix problem whereby incfs can't remove files from .incomplete
Test: adb install --incremental, check .incomplete folder is empty
Bug: 180643994
Change-Id: I7dfd18dd9e73cd683e93db1a588aab3b08f5fafa
2021-03-09 09:17:11 -08:00
Yiwei Zhang
86ca9c9131 Merge "sepolicy: allow hal_power_stats_client to access IPowerStats AIDL" 2021-03-09 07:09:50 +00:00
Hridya Valsaraju
69b91ffb1e Merge "Add missing permission for accessing the DMA-BUF system heap" 2021-03-09 06:11:17 +00:00
Yiwei Zhang
1f990facdb sepolicy: allow hal_power_stats_client to access IPowerStats AIDL
Bug: 178219601
Change-Id: I25f19939c69c225771e534cbd446eec8c7769f13
2021-03-08 22:19:47 +00:00