Commit graph

18131 commits

Author SHA1 Message Date
Jack Yu
a5dde796b5 Add sepolicy for nfc hal v1.2
Bug: 130509605
Test: No avc denial log and NFC works with hal v1.2
Change-Id: If54884f76a32705d11f2085f66fe83b9e0354f79
2019-04-22 12:08:20 +00:00
Treehugger Robot
40a71c6f7b Merge "add mediaswcodec to watchdog and dumpstate" 2019-04-20 00:14:07 +00:00
Treehugger Robot
63f8d4feb7 Merge "Adding /debug_ramdisk mount point" 2019-04-19 23:54:53 +00:00
Treehugger Robot
2fbb6f0637 Merge "Allow adb start/stop mdnsd via ctl.start/stop" 2019-04-19 19:17:14 +00:00
Chong Zhang
ad3621a7b7 add mediaswcodec to watchdog and dumpstate
bug: 130887807
test: adb bugreport and check mediaswcodec stack is there
Change-Id: I4a37e4e06c4905f435e96d8b1497e3617e688478
2019-04-19 12:13:33 -07:00
Bowgo Tsai
2e86fa0e81 Adding /debug_ramdisk mount point
This change allows first-stage init to mount a tmpfs under
/debug_ramdisk to preserve files from the debug ramdisk, for
second-stage init to load sepolicy and property files.

This is to allow adb root on a USER build if the device is unlocked.

Bug: 126493225
Test: boot a device with debug ramdisk, checks related files are loaded
Change-Id: Iad3b84d9bdf5d8e789219126c88701bf969253ef
2019-04-18 23:59:54 +08:00
Treehugger Robot
6e4d217991 Merge "Allow system_server to schedule mediaswcodec" 2019-04-17 20:09:36 +00:00
Treehugger Robot
1054b44b81 Merge "Allow zygote to scan static overlays on /oem" 2019-04-17 19:12:26 +00:00
Chong Zhang
042f844e54 Allow system_server to schedule mediaswcodec
bug: 130669553
Change-Id: I49d4ef473181d2270d90a9350c5e05b8b7db76bb
2019-04-17 09:51:51 -07:00
Ryan Mitchell
ef1a64e231 Allow zygote to scan static overlays on /oem
During preloading resources, zygote scans the overlay directories of
supported partitions looking for android RROs to apply statically. Zygote
currently is allowed to read overlays in /oem/overlay, but zygote does
not have the search permission to be able to scan /oem.

Without this patch, this denial is logged:
04-04 14:57:40.136   876   876 I auditd  : type=1400 audit(0.0:9):
avc: denied { search } for comm="main" name="oem" dev="dm-3" ino=46
scontext=u:r:zygote:s0 tcontext=u:object_r:oemfs:s0 tclass=dir
permissive=0

Bug: 121033532
Test: booting without denials and stat oem succeeds
Change-Id: I661f3e0aff7ec3513870d08ddc122fc359b8f995
2019-04-17 16:06:34 +00:00
Nick Kralevich
795add585c Remove isV2App
This selector is no longer used.

Bug: 123605817
Bug: 111314398
Test: compiles and boots
Change-Id: I61bb6b9f17ba4534569bd4a1c0489023cdaf698d
2019-04-16 16:01:08 -07:00
Changyeon Jo
cfeaa1c664 Allow adb start/stop mdnsd via ctl.start/stop
Bug: 128345139
Test: make selinux_policy
Change-Id: I477d6d94c16974f23f703d5f334ef108279ab3bb
Signed-off-by: Changyeon Jo <changyeon@google.com>
2019-04-16 08:39:33 -07:00
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