Commit graph

18119 commits

Author SHA1 Message Date
Treehugger Robot
3cba24a81a Merge "Move pf_key socket creation permission to netd" 2019-04-12 22:35:52 +00:00
Treehugger Robot
9c4ebe2bc9 Merge "sepolicy: allow hal_omx to access audio devices" 2019-04-12 19:00:17 +00:00
Treehugger Robot
bf7ae04865 Merge "Deprecate /mnt/sdcard -> /storage/self/primary symlink." 2019-04-12 16:18:57 +00:00
Treehugger Robot
addc1c234c Merge "Allow webview_zygote to read the /data/user/0 symlink." 2019-04-12 05:37:33 +00:00
Maciej Żenczykowski
add6473632 sepolicy: proper labelling of /sys/devices/virtual/net/...
While we're at it also label /sys/module/tcp_cubic/parameters correctly.

Before:
  [40/54] BinderTest#InterfaceSetMtu: FAILED (4ms)

  STACKTRACE:
  system/netd/tests/binder_test.cpp:2724: Failure
  Value of: status.isOk()
  Actual: false
  Expected: true
  Remote I/O error
  system/netd/tests/binder_test.cpp:2580: Failure
  Expected equality of these values:
  mtu
  Which is: 1200
  mtuSize
  Which is: 1500

  Summary
  -------
  libbpf_android_test: Passed: 9, Failed: 0, Ignored: 0
  libnetdbpf_test: Passed: 11, Failed: 0, Ignored: 0
  netd_integration_test: Passed: 53, Failed: 1, Ignored: 0
  netd_unit_test: Passed: 179, Failed: 0, Ignored: 0
  netdutils_test: Passed: 68, Failed: 0, Ignored: 0
  resolv_integration_test: Passed: 67, Failed: 0, Ignored: 0
  resolv_unit_test: Passed: 67, Failed: 0, Ignored: 0

  1 test failed
  -------------
  BinderTest#InterfaceSetMtu

Test: failing test now passes

Bug: 130318253
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2f7e9824ccce9d1597a18400a9ddd74b53ded857
Merged-In: I2f7e9824ccce9d1597a18400a9ddd74b53ded857
(cherry picked from commit f4aeb81eec)
2019-04-11 21:32:02 -07:00
Tri Vo
8eff3e23d8 Deprecate /mnt/sdcard -> /storage/self/primary symlink.
"This symlink was suppose to have been removed in the Gingerbread
time frame, but lives on."
https://android.googlesource.com/platform/system/core/+/d2f0a2c%5E!/

Apps targeting R+ must NOT use that symlink.

For older apps we allow core init.rc to create
/mnt/sdcard -> /storage/self/primary symlink.

Bug: 129497117
Test: boot device, /mnt/sdcard still around.
Change-Id: I6ecd1928c0f598792d9badbf6616e3acc0450b0d
2019-04-12 03:15:52 +00:00
Chenbo Feng
8a5539b5f0 Move pf_key socket creation permission to netd
Allow netd to trigger the kernel synchronize rcu with open and close
pf_key socket. This action was previously done by system_server but now
it need to be done by netd instead because there might be race issue
when netd is operating on a map that is cleaned up by system server.

Bug: 126620214
Test: android.app.usage.cts.NetworkUsageStatsTest
      android.net.cts.TrafficStatsTest

Change-Id: Id5ca86aa4610e37a2752709ed9cfd4536ea3bfaf
2019-04-12 02:24:46 +00:00
Treehugger Robot
0d86ec526d Merge "Revert "audit use of net.dns. property"" 2019-04-12 01:16:29 +00:00
Chalard Jean
628ebcda14 Merge "Let dumpstate get netd stack traces." 2019-04-12 00:57:27 +00:00
Torne (Richard Coles)
d40f7fd9d5 Allow webview_zygote to read the /data/user/0 symlink.
ART follows the /data/user/0 symlink while loading cache files, leading
to:

avc: denied { getattr } for comm="webview_zygote" path="/data/user/0"
dev="sda35" ino=1310726 scontext=u:r:webview_zygote:s0
tcontext=u:object_r:system_data_file:s0 tclass=lnk_file permissive=0

Allow this access, the same as app and app_zygote do.

Bug: 123246126
Test: DeviceBootTest.SELinuxUncheckedDenialBootTest
Change-Id: I90faa524e15a17b116a6087a779214f2c2142cc2
2019-04-11 16:18:32 -04:00
Jeff Vander Stoep
d5bf5c0e31 Revert "audit use of net.dns. property"
This is just causing unnecessary log spam. Remove.

This reverts commit ecb00a109c.
Test: build
2019-04-11 19:25:59 +00:00
Jeff Vander Stoep
1ca7a4c8f5 fc_sort: delete c version, migrate to python version
Test: build aosp_blueline-userdebug, run build-time tests
Change-Id: I9c466cd718602e6068ee31abd6de7dbab84f4949
2019-04-11 10:19:16 -07:00
Jiyong Park
a0f998e6de Allow bootstrap bionic only to init, ueventd, and apexd
The bootstrap bionic (/system/lib/bootstrap/*) are only to the early
processes that are executed before the bionic libraries become available
via the runtime APEX. Allowing them to other processes is not needed and
sometimes causes a problem like b/123183824.

Bug: 123183824
Test: device boots to the UI
Test: atest CtsJniTestCases:android.jni.cts.JniStaticTest#test_linker_namespaces
Change-Id: Id7bba2e8ed1c9faf6aa85dbbdd89add04826b160
2019-04-11 09:51:38 +09:00
Treehugger Robot
4f81c8771b Merge "Fix fc_sort to be deterministic" 2019-04-11 00:01:54 +00:00
Vignesh Kulothungan
155ca12879 sepolicy: allow hal_omx to access audio devices
hal_omx needs to access audio devices to use OMX HW decoders and
encoders. Allow hal_omx to access audio devices.

authored-by: Banajit Goswami <bgoswami@codeaurora.org>

Change-Id: I742c29c4105e5647ca1a7e017e311559a0567b52
2019-04-10 11:31:04 -07:00
Treehugger Robot
9596d6d4c7 Merge "Re-label /data/pkg_staging files as staging." 2019-04-10 16:30:21 +00:00
Treehugger Robot
e8bdbdeeab Merge "ephemeral_app: restore /dev/ashmem open permissions" 2019-04-10 16:02:01 +00:00
Dario Freni
e7aaa0c273 Re-label /data/pkg_staging files as staging.
While the directory is not present anymore in Q, it has been shipped on
Q Beta 2 and the absence of such label might cause issues to devices
with pending installs which receive an OTA > Beta 2.

Bug: 130184133
Test: m
Merged-In: Ie3e77eebd2e7fd7b3a6a940d189cbc2bb386dc0e
Change-Id: Ie3e77eebd2e7fd7b3a6a940d189cbc2bb386dc0e
2019-04-10 15:53:01 +00:00
Inseob Kim
98c7ade609 Fix fc_sort to be deterministic
fc_sort uses its own implementation of merge sort, but it's
unnecessarily complex and sorting criteria isn't clear: it only
compares lengths and existences of fields. So it can give different
results on the same input (same set of entries, different order).

This fixes it so that output is always deterministic, regardless of
the order of lines in input files.

Bug: N/A
Test: try to run fc_sort several times on same input with different
      line orders, and see the results.

Change-Id: I982a35a4ae9e115030a8598027bbf1181ee77a7d
2019-04-10 07:42:10 +00:00
Treehugger Robot
083932b3be Merge "Fix typo in I3ede36a8084fdae22d3aedd92703811d279a7829." 2019-04-10 05:45:01 +00:00
Treehugger Robot
4d8333709c Merge "Add policy for /system/bin/auditctl" 2019-04-10 02:29:24 +00:00
Joel Galenson
2f26b34f5c Fix typo in I3ede36a8084fdae22d3aedd92703811d279a7829.
Test: Build
Change-Id: I060b0d929a9d147f6327432844106d8270222d18
2019-04-09 17:00:04 -07:00
Tri Vo
19200ae354 ephemeral_app: restore /dev/ashmem open permissions
ephemeral_app domain doesn't distinguish between apps that target Q vs
ones target pre-Q. Restore ashmem permissions for older apps.

Bug: 130054503
Test: start com.nextlatam.augmentedfaces instant app
Change-Id: I490323cce96d69e561fc808426a9dfba2aeac30f
Merged-In: I490323cce96d69e561fc808426a9dfba2aeac30f
(cherry picked from commit 0da2ecda62)
2019-04-09 14:18:18 -07:00
Nick Kralevich
622ab8a2ba Add policy for /system/bin/auditctl
/system/bin/auditctl is executed by init to set the kernel audit
throttling rate limit. Grant the rules necessary for this to happen.

Test: compiles and boots
Test: Perform an operation which generates lots of SELinux denials,
      and count how many occur before and after the time period.
Bug: 118815957

Change-Id: Id9df65497d1172ab7c2e84ff6a43722f11c61620
2019-04-09 12:47:10 -07:00
Benjamin Schwartz
f9b7a4c992 Allow signals to hal_power_stats_server from dumpstate
This is needed for bugreport to include ANR trace for the process.

Bug: 128878895
Test: adb bugreport
Change-Id: I31a2fceb9c8ec1d8588374bb97f3b518a075ddfb
2019-04-09 09:25:17 -07:00
Treehugger Robot
4a12576189 Merge "Fix denial during bugreport." 2019-04-08 21:55:37 +00:00
Treehugger Robot
f2c5821e50 Merge "Add producer socket to the selinux perfetto domain." 2019-04-08 16:48:35 +00:00
Joel Galenson
9b37627e50 Fix denial during bugreport.
Bug: 116711254
Test: Take bugreport and see no denial.
Change-Id: I3ede36a8084fdae22d3aedd92703811d279a7829
2019-04-08 09:19:44 -07:00
Hector Dearman
bc67b7b1b4 Merge "Re-add sys_traced prop" 2019-04-08 12:23:12 +00:00
Stephen Nusko
cdda2dc3c9 Add producer socket to the selinux perfetto domain.
This change allows the perfetto cmdline client to access
the (unprivileged) producer socket of traced, with the
intent of triggering finalization of already running traces
(see b/130135730). Matching change: aosp/932138

Note that:
- perfetto cmdline can already access the consumer socket
  (to start tracing sessions).
- The producer socket is already exposed to most domains,
  including unprivileged apps.

Bug: 130135730
Bug: 128966650
Change-Id: Id9106279584798e6689102085fa46a0b7ecb1ba7
2019-04-08 08:21:54 +00:00
Hector Dearman
0756dcc9da Re-add sys_traced prop
Add permissions for:
persist.device_config.global_settings.sys_traced

Bug: b/71737179
Test: As follows:
patch aosp/891475
patch aosp/891853
patch ag/6224352

$ adb shell
walleye:/ $ ps -A | grep traced
nobody        1135     1   52288   2200 0                   0 S traced
nobody        1136     1   52288   2256 0                   0 S
traced_probes
walleye:/ $ settings put global sys_traced 0
walleye:/ $ ps -A | grep traced
1|walleye:/ $
walleye:/ $ settings put global sys_traced 1
1|walleye:/ $ ps -A | grep traced
nobody       12386     1   52288   2208 0                   0 S traced
nobody       12387     1   52288   2248 0                   0 S
traced_probes
Change-Id: I8898672c8fdc9c5d87a31b90f6c7d5c03bef78ed
2019-04-05 15:53:57 +00:00
Isabelle Taylor
07b5bc635a Merge "Allow traced_probes access to atrace HAL" 2019-04-05 10:07:19 +00:00
Chalard Jean
a4c9f7b2c6 Let dumpstate get netd stack traces.
Test: manual
Bug: 128804277
Change-Id: Ibb3c0063f96f835edb13868b3e7a9fb9f6f94195
2019-04-05 17:33:56 +09:00
Treehugger Robot
16a9ab81e1 Merge "Allow surfaceflinger to access bufferhub" 2019-04-04 21:09:12 +00:00
Treehugger Robot
54524c9192 Merge "system_server_startup: allow SIGCHLD to zygote" 2019-04-04 20:06:48 +00:00
Isabelle Taylor
e8c4ba8137 Allow traced_probes access to atrace HAL
03-26 10:34:53.532   585   585 E SELinux : avc:  denied  { find } for interface=android.hardware.atrace::IAtraceDevice sid=u:r:traced_probes:s0 pid=917 scontext=u:r:traced_probes:s0 tcontext=u:object_r:hal_atrace_hwservice:s0 tclass=hwservice_manager permissive=0

Bug: 127378737
Test: manually
Change-Id: Icfeee8e8d62c9e11072d4f8cc1d04f256b9636c5
2019-04-04 16:31:50 +00:00
Jeff Vander Stoep
67dc274f87 system_server_startup: allow SIGCHLD to zygote
avc: denied { sigchld } for comm="main"
scontext=u:r:system_server_startup:s0 tcontext=u:r:zygote:s0
tclass=process permissive=0

Test: build
Change-Id: I98c106b17ba1740f953c3108bd0fc927c150096f
2019-04-04 09:25:15 -07:00
Colin Cross
f9394c01cc Merge "Enable gofmt in preupload hooks" 2019-04-04 15:14:37 +00:00
Colin Cross
bed92c2609 Merge "Fix package path of android/soong/android pctx" 2019-04-04 04:00:13 +00:00
Jiwen 'Steve' Cai
2177320456 Allow surfaceflinger to access bufferhub
Bug: 112940221
Test: AHardwareBufferTest
Change-Id: I3e0304d8e8e3a91860ea8ce4ebe740966beed301
2019-04-03 15:54:53 -07:00
Colin Cross
f29f97f895 Enable gofmt in preupload hooks
Test: none
Change-Id: I6a2e65efc84969058f8a540bdc4d0e8d4e661c9d
2019-04-03 11:38:17 -07:00
Treehugger Robot
849ac8020d Merge "wifi: Add a new property to indicate active wifi iface" 2019-04-03 16:51:55 +00:00
Jiyong Park
cff95d7b5f Remove apex_key_file
We no longer have /system/etc/security/apex/* as the public keys are all
bundled in APEXes. Removing the selinux label and policies for it.

Bug: 936942
Test: device is bootable

Change-Id: I6b6144a8d15910d1ba8584a0778244ed398dc615
2019-04-03 09:49:15 +00:00
Treehugger Robot
5686c383c8 Merge "Allow traced_probes to read packages.list." 2019-04-03 09:28:26 +00:00
Przemyslaw Szczepaniak
d385346ada Merge "NNAPI property to disable extensions use on GSI/AOSP product partition." 2019-04-03 08:51:53 +00:00
Treehugger Robot
61f28b33a4 Merge "Allow execmod for apps with targetSdkVersion=26-28" 2019-04-03 01:58:26 +00:00
Colin Cross
4f78d19ddc Fix package path of android/soong/android pctx
android/soong/common was renamed to android/soong/android long
ago, but the pctx package path was still "android/soong/common".
This required all users of rules defined in android/soong/android
to import "android/soong/android" and then
pctx.Import("android/soong/common").

Test: m checkbuild
Change-Id: Ic9e8bf25e76dbd61bb1cb1d0e7d095e73c0f279b
2019-04-02 16:22:59 -07:00
Nick Kralevich
99a5103585 rs.te: Allow ephemeral_app FD use
Allow renderscript to use file descriptors created by ephemeral apps.
This is needed to support renderscript execution by ephemeral apps.

Steps to reproduce:

  atest com.google.android.pm.gts.PackageManagerHostTest#testRenderScriptLoading

Expected:

  Test passes

Actual:
  03-26 03:33:45.373  4607  4607 F linker  : CANNOT LINK EXECUTABLE "/system/bin/bcc": can't enable GNU RELRO protection for "": Permission denied
  03-26 03:33:45.373  4566  4600 E RenderScript: Child process "/system/bin/bcc" terminated with status 256
  03-26 03:33:45.373  4566  4600 E RenderScript: bcc: FAILS to compile 'init_test'
  03-26 03:33:45.374  4566  4596 E TestRunner: failed: testRenderScriptLoading(com.google.android.gts.packagemanager.InstantAppTestCases)
  03-26 03:33:45.375  4566  4596 E TestRunner: ----- begin exception -----
  03-26 03:33:45.375  4566  4596 E TestRunner: java.lang.AssertionError: Instant App should be able to access RenderScript APIs.
  03-26 03:33:45.375  4566  4596 E TestRunner:  at org.junit.Assert.fail(Assert.java:88)
  03-26 03:33:45.375  4566  4596 E TestRunner:  at com.google.android.gts.packagemanager.InstantAppTestCases.testRenderScriptLoading(InstantAppTestCases.java:338)
  03-26 03:33:45.375  4566  4596 E TestRunner:  at java.lang.reflect.Method.invoke(Native Method)
  03-26 03:33:45.375  4566  4596 E TestRunner:  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)

Additional notes: Confusingly ephemeral_app is not part of untrusted_app_all,
but it is part of all_untrusted_apps, which is used for neverallow
assertions.

Bug: 129356700
Test: atest com.google.android.pm.gts.PackageManagerHostTest#testRenderScriptLoading
Change-Id: I47781012b9fd2cd1d03a3d50bed0c693bcf9ec7b
2019-04-02 13:59:39 -07:00
Jeff Vander Stoep
c9aba12002 Allow execmod for apps with targetSdkVersion=26-28
Bug: 129760476
Test: build
Change-Id: I239c16e8269b81c22738e7813c1d4ae46068aa53
2019-04-02 13:07:27 -07:00
Przemyslaw Szczepaniak
62a22ce5d6 NNAPI property to disable extensions use on GSI/AOSP product partition.
Property is NNAPI client-readable and writeable only by init/build.prop.

Bug: 129666983
Bug: 120483623
Test: flashed crosshatch/Cts tests for NNAPI
Change-Id: Ic4c0f176440610a2c54c078863f3d5382323cc65
2019-04-02 20:23:40 +01:00