Commit graph

21508 commits

Author SHA1 Message Date
Robert Shih
75c0fa4517 Merge "Allow apps to access hal_drm" 2019-09-30 18:08:32 +00:00
Florian Mayer
d54f4487bc Merge "Allow shell to unlink perfetto_traces_data_file." 2019-09-30 17:40:01 +00:00
Eric Biggers
35cd1c6f37 Merge "Allow shell to get encryption policy for CTS" 2019-09-30 17:14:29 +00:00
Suren Baghdasaryan
d210b7e729 sepolicy: Allow lmkd access to vmstat file
Lmkd needs read access to /proc/vmstat to read workingset_refault and
pgscan metrics.

Bug: 132642304
Test: lmkd_unit_test
Change-Id: I7db1b85552c6ca2d5ad76041ca29687146bde769
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-09-30 16:57:35 +00:00
Florian Mayer
c069bc134e Allow shell to unlink perfetto_traces_data_file.
Bug: 141704436
Test:
blueline:/ $ ls -lZa /data/misc/perfetto-traces
total 186
drwxrwx-wx  2 root   shell u:object_r:perfetto_traces_data_file:s0    3488 2019-09-30 14:12 .
drwxrwx--t 46 system misc  u:object_r:system_data_file:s0             3488 2019-09-30 14:08 ..
-rw-------  1 shell  shell u:object_r:perfetto_traces_data_file:s0  180467 2019-09-30 14:12 profile-shell
blueline:/ $ rm /data/misc/perfetto-traces/profile-shell
rm ro /data/misc/perfetto-traces/profile-shell (y/N):y
blueline:/ $ ls -lZa /data/misc/perfetto-traces
total 6
drwxrwx-wx  2 root   shell u:object_r:perfetto_traces_data_file:s0  3488 2019-09-30 14:13 .
drwxrwx--t 46 system misc  u:object_r:system_data_file:s0           3488 2019-09-30 14:08 ..
blueline:/ $


Change-Id: Ia710068c3cca53a415347fb0a7064740e500d15d
2019-09-30 13:13:14 +00:00
Robert Shih
f58be478de Allow apps to access hal_drm
Bug: 134787536
Test: MediaDrmClearkeyTest#testClearKeyPlaybackCenc
Change-Id: I931ccdfa3b78c7210f9f94e94b48d2d6908a371d
Merged-In: I931ccdfa3b78c7210f9f94e94b48d2d6908a371d
2019-09-30 04:51:24 +00:00
Treehugger Robot
3cda2d5c2b Merge changes from topic "system_ext_sepolicy"
* changes:
  Separate system_ext_mac_permissions.xml out of system sepolicy.
  Separate system_ext_service_contexts out of system sepolicy.
  Separate system_ext_property_contexts out of system sepolicy.
  Separate system_ext_hwservice_contexts out of system sepolicy.
  Separate system_ext_seapp_contexts out of system sepolicy.
  Separate system_ext_file_contexts out of system sepolicy.
  Separate system_ext_sepolicy.cil out of system sepolicy
2019-09-28 00:28:57 +00:00
Eric Biggers
b57af5d0e6 Allow shell to get encryption policy for CTS
Allow the shell domain to use the FS_IOC_GET_ENCRYPTION_POLICY and
FS_IOC_GET_ENCRYPTION_POLICY_EX ioctls so that we can write a CTS test
which checks that the device complies with the CDD requirements to use
appropriate algorithms for file-based encryption.

The information returned by these ioctls is already available in logcat,
but scraping the log for a CTS test seems fragile; I assume that people
would prefer a more robust solution.

For more details see change I9082241066cba82b531e51f9a5aec14526467162

Bug: 111311698
Test: the CTS test works after this change.
Change-Id: Ib9ce6b42fcfb6b546eb80a93ae8d17ac5a433984
2019-09-27 15:24:27 -07:00
Tri Vo
bfcddbe25e sepolicy: remove ashmemd
Bug: 139855428
Test: m selinux_policy
Change-Id: I8d7f66b16be025f7cb9c5269fae6fd7540c2fdc9
2019-09-27 17:43:53 +00:00
Joel Galenson
7548885e54 Add jiyong@ to OWNERS file.
Test: None
Change-Id: I5c279cf7d67f48ed1d8ebf3a4e16804813ca1229
2019-09-27 07:41:09 -07:00
Steven Moreland
b081eee00e Deprecate libhwbinder/libhidltransport from VNDK.
Since these libraries were vndk-sp, previously, passthrough HALs were
able to load them. However, now that they have been removed from the
vndk-sp set (these libraries are empty), marking them as
same_process_hal_file so that vendor passthrough implementations that
still link against these empty libraries can still use them.

Bug: 135686713
Test: boot device using these libraries from an sphal (otherwise,
    bootloops)
Change-Id: Ic5170eb0fcbb87c82bbea840dcfcb17899eaa899
2019-09-26 15:49:50 -07:00
Victor Hsieh
369d35d531 Allow fsverity_init to load key from keystore
Also, since fsverity_init has been rewriten in C++, shell execution is no
longer needed.

Test: no denial is generated
Bug: 112038744
Change-Id: I7e409cadd68cb6d5d8557a126a3b9e78063190be
2019-09-26 11:05:20 -07:00
Treehugger Robot
e612ecd6ed Merge "sepolicy: ashmem entry point for libcutils" 2019-09-26 17:56:53 +00:00
Bowgo Tsai
a3429fcc2b Separate system_ext_mac_permissions.xml out of system sepolicy.
Bug: 137712473
Test: boot crosshatch
Test: Moving product sepolicy to system_ext and checks the file contents in
      /system_ext/etc/selinux are identical to previous contents in
      /product/etc/selinux.
Change-Id: I434e7f23a1ae7d01d084335783255330329c44e9
2019-09-26 21:29:36 +08:00
Bowgo Tsai
9823116355 Separate system_ext_service_contexts out of system sepolicy.
Bug: 137712473
Test: boot crosshatch
Change-Id: If483e7a99dc07f082dd0ecd0162a54140a3267de
2019-09-26 21:29:30 +08:00
Bowgo Tsai
1864cd02fc Separate system_ext_property_contexts out of system sepolicy.
Bug: 137712473
Test: boot crosshatch
Change-Id: I27db30edfd9948675793fdfec19081288f8017eb
2019-09-26 21:29:22 +08:00
Bowgo Tsai
241d36eedd Separate system_ext_hwservice_contexts out of system sepolicy.
Bug: 137712473
Test: boot crosshatch
Change-Id: Ic5774da74e200b9d7699ac2240a12e7616dc512a
2019-09-26 21:29:15 +08:00
Bowgo Tsai
7bc47f4ba7 Separate system_ext_seapp_contexts out of system sepolicy.
Bug: 137712473
Test: boot crosshatch
Change-Id: I2c2acbcf234861feb39834c867a4eb74c506692d
2019-09-26 21:29:05 +08:00
Bowgo Tsai
86a048d4df Separate system_ext_file_contexts out of system sepolicy.
Bug: 137712473
Test: boot crosshatch
Change-Id: I09f63771d08ad18fb41fca801dd587b086be58c7
2019-09-26 21:28:07 +08:00
Bowgo Tsai
948934bae3 Separate system_ext_sepolicy.cil out of system sepolicy
Currently system sepolicy can be extended via:
  - BOARD_PLAT_PUBLIC_SEPOLICY_DIR
  - BOARD_PLAT_PRIVATE_SEPOLICY_DIR

To support having a single shared core system sepolicy, those
customization should be moved to the newly added system_ext partition.

System-ext-specific sepolicy files will be installed into
/system_ext/etc/selinux/*. system_ext_sepolicy.cil is merged into
precompiled_sepolicy at build-time. In case precompiled_sepolicy can't
be used (e.g. system-only-ota), the init will merge this file with
the rest of the sepolicy at runtime.

Bug: 137712473
Test: boot aosp_crosshatch with system_ext_sepolicy.cil
Test: boot aosp_crosshatch without system_ext_sepolicy.cil
Change-Id: I53984e8a973eff15de0653916203020dbabe9c03
2019-09-26 21:25:53 +08:00
Tom Cherry
38dfd3080a Merge changes from topic "boringssl-kmsg"
* changes:
  Redirect boringssl_self_test stdio to kmsg
  allow init to open kmsg_debug
2019-09-25 19:56:03 +00:00
Tri Vo
a7f61021b7 sepolicy: ashmem entry point for libcutils
This duplicated ashmem device is intended to replace ashmemd.

Ashmem fd has a label of the domain that opens it. Now with ashmemd
removed, ashmem fds can have labels other than "ashmemd", e.g.
"system_server". We add missing permissions to make ashmem fds usable.

Bug: 139855428
Test: boot device
Change-Id: Iec8352567f1e4f171f76db1272935eee59156954
2019-09-25 11:26:18 -07:00
Paul Crowley
8cb6460058 Merge "Export vold FDE algorithm properties" 2019-09-25 16:34:52 +00:00
yuguoxu
a894a1aa66 Export vold FDE algorithm properties
ro.crypto.fde_algorithm
ro.crypto.fde_sector_size
ro.crypto.volume.contents_mode

These properties were not added to sepolicy export2vold. vold can't access
crypto algorithm type when flashing a GSI image and when the properties are in
/vendor/build.prop. This prevents FDE from working.

Bug: 141518844
Change-Id: I234bda439f6be7a2211a194856baf75800396232
Signed-off-by: yuguoxu <yuguoxu@allwinnertech.corp-partner.google.com>
2019-09-25 16:29:54 +00:00
Steven Moreland
8271e66e46 Merge "PRODUCT_SEPOLICY_SPLIT forces Treble tests to run." 2019-09-25 15:57:04 +00:00
Steven Moreland
1cb64c4f59 PRODUCT_SEPOLICY_SPLIT forces Treble tests to run.
This is the flag for when sepolicy is split. Also removed other
commented-out heuristics around fake-treble. We should aim to remove it
entirely instead.

Fixes: 141348590
Test: build w/ and without adding binder_in_vendor_violators to a vendor
    process (and see the expected error there)

Change-Id: I29fb335cc5b5d6e117d93038fe458b8c74acf321
2019-09-25 15:56:52 +00:00
Treehugger Robot
4ab718a216 Merge "Update bug_map to explicitly have the b/ prefix" 2019-09-24 21:50:58 +00:00
Tom Cherry
80b85f0ecd Redirect boringssl_self_test stdio to kmsg
To aid in debugging if there are failures.

Bug: 137267623
Test: add prints to boringssl_self_test and see them
Change-Id: I34b20225514898911b3f476d4517430433eb379e
2019-09-24 12:45:57 -07:00
Tom Cherry
7108a21d59 allow init to open kmsg_debug
The 'stdio_to_kmsg' option will print stdout and stderr to
kmsg_debug.  This requires init to be able to open kmsg_debug.

Test: services with stdio_to_kmsg can print to kmsg_debug
Change-Id: I63f0af8f079f7327c1224aa9e46f19d6549d875b
2019-09-24 12:45:57 -07:00
Treehugger Robot
3af73fdf1f Merge "Allow dumpstate to call incident CLI" 2019-09-24 01:01:31 +00:00
Ashwini Oruganti
a661148bc0 Update bug_map to explicitly have the b/ prefix
This is part of a series of updates to bug_map across all of android
tree.

Bug: 141014771
Test: Generated a denial, verified that the bug id in the dmesg logs
remains unchanged.

Change-Id: I852e8ac38a162cc074232f15d919212548d485bf
2019-09-23 14:28:07 -07:00
Tao Bao
987aa96d30 install_recovery no longer needs to access /cache.
applypatch (called by install_recovery) used to back up the source
partition to /cache when installing the recovery image on non-A/B
devices. The change from the same topic drops the backup behavior.

The access to /cache was also the reason for having dac_override_allowed
(applypatch runs as root:root, while /cache is owned by system:cache
with 0770).

Bug: 68319577
Test: Invoke the code that installs recovery image; check that recovery
      is installed successfully without denials.
Change-Id: I0533ba82260d0adb23b328e6eef8bd6dda3d0439
2019-09-23 11:35:47 -07:00
Treehugger Robot
93b9db56aa Merge "app_zygote need access to oem partition" 2019-09-20 12:22:20 +00:00
Inseob Kim
07c6671bc4 Merge "Add attributes for exported properties" 2019-09-20 03:01:21 +00:00
Inseob Kim
19b99f18c8 Add attributes for exported properties
This introduces some attributes that can be used to restrict access to
exported properties so that one can easily check from which the
properties can be accessed, and that OEMs can extend their own exported
properties.

Bug: 71814576
Bug: 131162102
Test: boot aosp_cf_x86_phone-userdebug
Test: logcat | grep "avc: "
Change-Id: I6f988ec1cb94fa64563ca6cb91b7702da5d604e3
2019-09-19 05:07:50 +00:00
Treehugger Robot
f38b478272 Merge "Add file_contexts for "com.android.vndk" APEX" 2019-09-18 17:35:07 +00:00
Treehugger Robot
ff75b228ae Merge "idmap: add binderservice permissions" 2019-09-18 14:18:08 +00:00
Jeff Vander Stoep
0f00cd283e idmap: add binderservice permissions
Allow dumpsys to dump process information for bug reports.

Test: build
Test: adb bugreport
Bug: 140541614
Change-Id: Ia361e8c8de2cc5f798e746dffcf067393fd6bcae
2019-09-18 13:47:09 +02:00
Jooyung Han
42d33e0226 Add file_contexts for "com.android.vndk" APEX
This new apex is a VNDK APEX which is going to replace /system/lib/vndk
libraries.

Bug: 134357236
Bug: 139772411
Test: m com.android.vndk

Change-Id: I9bdda5bc7862917a196b894cc562e0351db76c52
2019-09-18 10:35:39 +09:00
Treehugger Robot
4db20c6922 Merge "neverallow init *:process noatsecure" 2019-09-17 06:08:18 +00:00
Paul Crowley
aaf2a5e09a Merge "Allow toolbox to rm -rf /data/per_boot" 2019-09-17 05:40:05 +00:00
Paul Crowley
2367ba358f Allow toolbox to rm -rf /data/per_boot
Bug: 140882488
Test: create files and dirs in /data/per_boot, check they're removed.
Change-Id: Idf0ba09cbe51cbff6a7b2a464c4651a1f7fcf343
2019-09-16 10:18:57 -07:00
Nick Kralevich
a1458c64d3 neverallow init *:process noatsecure
The use of sensitive environment variables, such as LD_PRELOAD, is disallowed
when init is executing other binaries. The use of LD_PRELOAD for init spawned
services is generally considered a no-no, as it injects libraries which the
binary was not expecting. This is especially problematic for APEXes. The use
of LD_PRELOAD via APEXes is a layering violation, and inappropriately loads
code into a process which wasn't expecting that code, with potentially
unexpected side effects.

Test: compiles
Bug: 140789528
Change-Id: Ia781ec7318e700cddfd52df97c504b771f413504
2019-09-16 09:50:32 -07:00
Andrei Onea
87c885b135 Allow platform signed apps to access platform_compat service
This exception is needed for overriding gated changes in tests.
Bug: 140367850
Test: http://aosp/1113771
Change-Id: I2a76f92fe06c1c759a537dea7539a8899f02b15e
2019-09-13 12:38:37 +01:00
Pete Bentley
aada820069 Revert "SEPolicy: dontaudit attempts to create marker files."
This reverts commit a9b718a1ed.

Reason for revert: No longer be necessary after
http://r.android.com/1120246 lands as this causes BoringSSL to only write
flag files if a particular environment variable is set, and this variable
will only be set for the self test binaries which have permission to
write to /dev/boringssl.

Bug: 140918050
Test: Manually observed audit log after change
Change-Id: I851f4aea991d91c67b64535829eea5b9594a3e2c
2019-09-13 12:25:13 +01:00
Steven Thomas
726150eda4 Merge "Allow access to the "refresh_rate_switching" system property" 2019-09-13 00:55:33 +00:00
Tom Cherry
2176375a8a Merge "ueventd: allow using external firmware handlers" 2019-09-12 22:52:37 +00:00
Steven Thomas
f98c3902c2 Allow access to the "refresh_rate_switching" system property
Bug: 136592946
Bug: 138261472

Test: Ran with the patch applied, confirmed surface flinger can access
the system property.

Change-Id: I259a488399c5e698de384322852ea81ea1a96e7d
Merged-In: I259a488399c5e698de384322852ea81ea1a96e7d
2019-09-11 18:30:50 -07:00
Tobias Thierer
a9b718a1ed SEPolicy: dontaudit attempts to create marker files.
Binaries other than boringssl_self_test_exec are not allowed
to create marker files /dev/boringssl/selftest/[hash].

Right now, some processes still attempt to because:
 - Some binaries run so early during early-init that
   boringssl_self_test{32,64} hasn't had a chance to
   run yet, so the marker file doesn't exist yet, so
   the unprivileged process attempts to create it.
 - Some binaries statically link libcrypto so their
   [hash] is different from that used by
   boringssl_self_test{32,64}.

There's some ongoing work to stop those binaries even
attempting to create the marker files but it's not a
big deal if they do. Similarly, there is ongoing work
to minimize or eliminate static linking of this library.

For now, this CL turns off audit logs for this behavior
since it is harmless (a cosmetic issue) and in order to
not hold up the bulk of the logic being submitted.

Bug: 137267623
Test: Treehugger

Change-Id: I3de664c5959efd130f761764fe63515795ea9b98
2019-09-11 19:37:40 +01:00
Henrik Baard
8c94186ca5 app_zygote need access to oem partition
app_zygote used by for example Google Chrome needs access
to at least search /oem partition.

Google chrome version: 76.0.3809.132 is running in app_zygote
and the following access is blocked by selinux causing Chrome
to hang.

avc:  denied  { search } for  pid=813 comm="d.chrome_zygote"
name="/" dev="sda42" ino=2 scontext=u:r:app_zygote:s0:c214,c256,c512,c768
tcontext=u:object_r:oemfs:s0 tclass=dir permissive=0 ppid=798
pcomm="d.chrome_zygote" pgid=798 pgcomm="d.chrome_zygote"

Change-Id: Idcce1a5ad1a8be3d7bd057c12ec477baa9669235
2019-09-11 13:31:12 +02:00