Commit Graph

20311 Commits

Author SHA1 Message Date
Luke Huang
2cdbd3a38c Sepolicy for netutils_wrapper to use binder call
Bug: 65862741
Test: built, flashed, booted

Merged-In: I346520c47b74fde5137ad7c777f0a9eca50a06d7
(cherry picked from commit 554b334d7b)

Change-Id: I0a03b88369bd2eca6593d252c4dff3ce7745b6cc
2019-04-26 02:46:39 +00:00
Paul Crowley
1739bceaab Add /data/vendor_ce/0/facedata alongside its vendor_de relation
Bug: 131084614
Test: Modify vold_prepare_subdirs to match and test on Crosshatch.
Change-Id: Id5402e6b5da3f1e5549f49f8273dd9f052c348d7
2019-04-25 19:26:32 +00:00
TreeHugger Robot
4ac9186958 Merge "Allow mediaserver to find "audio" service" into qt-dev 2019-04-25 18:01:02 +00:00
Winson Chiu
019037a810 Merge "DO NOT MERGE: Allow idmap1 to read vmdl*.tmp APK install files" into qt-dev 2019-04-25 15:56:18 +00:00
Winson Chiu
4b33d68d35 DO NOT MERGE: Allow idmap1 to read vmdl*.tmp APK install files
When upgrading a package, PackageParser acts on the temporary
APK file copied from the install location. This is passed to
idmap, which doesn't have read access because it's missing an
SELinux rule.

This is needed to fix a bug with manifest overlaying on updating
an app, a feature kept alive for Q.

Relevant logs when updating a target:
[  550.068083] type=1400 audit(1556124408.583:3812): avc: denied { read } for comm="idmap" name="base.apk" dev="vdc" ino=8770 scontext=u:r:idmap:s0 tcontext=u:object_r:apk_tmp_file:s0 tclass=file permissive=1
[  550.090115] type=1400 audit(1556124408.583:3812): avc: denied { read } for comm="idmap" name="base.apk" dev="vdc" ino=8770 scontext=u:r:idmap:s0 tcontext=u:object_r:apk_tmp_file:s0 tclass=file permissive=1
[  550.092064] type=1400 audit(1556124408.603:3813): avc: denied { open } for comm="idmap" path="/data/app/vmdl1238645679.tmp/base.apk" dev="vdc" ino=8770 scontext=u:r:idmap:s0 tcontext=u:object_r:apk_tmp_file:s0 tclass=file permissive=1
[  550.096202] type=1400 audit(1556124408.603:3813): avc: denied { open } for comm="idmap" path="/data/app/vmdl1238645679.tmp/base.apk" dev="vdc" ino=8770 scontext=u:r:idmap:s0 tcontext=u:object_r:apk_tmp_file:s0 tclass=file permissive=1
[  550.098459] type=1400 audit(1556124408.613:3814): avc: denied { map } for comm="idmap" path="/data/app/vmdl1238645679.tmp/base.apk" dev="vdc" ino=8770 scontext=u:r:idmap:s0 tcontext=u:object_r:apk_tmp_file:s0 tclass=file permissive=1
[  550.101640] type=1400 audit(1556124408.613:3814): avc: denied { map } for comm="idmap" path="/data/app/vmdl1238645679.tmp/base.apk" dev="vdc" ino=8770 scontext=u:r:idmap:s0 tcontext=u:object_r:apk_tmp_file:s0 tclass=file permissive=1
[  550.104239] type=1400 audit(1556124408.613:3815): avc: denied { getattr } for comm="idmap" path="/data/app/vmdl1238645679.tmp/base.apk" dev="vdc" ino=8770 scontext=u:r:idmap:s0 tcontext=u:object_r:apk_tmp_file:s0 tclass=file permissive=1

Bug: 130559507

Test: manual adb push /system/product/app/TestApp.apk with
/system/product/overlay/TestOverlay.apk enabling disabled launcher
Activity in TestApp; adb install -r TestApp.apk keeps enabled state
with changes

Change-Id: Ieeb7fb4f79ae091d0febf42ca358e7ffdfa6c3ff
(cherry picked from commit 7e7291a763)
2019-04-25 11:05:07 +00:00
Miao Wang
aa568e1c79 Allow NNAPI HAL services access model files provided by privapp.
Bug: 131169221
Test: mm
Change-Id: I1004821bd30e2a0586b14178e352e885cabfc002
2019-04-24 21:14:32 -07:00
TreeHugger Robot
5f30c238ec Merge "Allow signals to power/thermal HAL from dumpstate" into qt-dev 2019-04-24 20:18:26 +00:00
TreeHugger Robot
58a9b10bb2 Merge "Add new surfaceflinger ro props" into qt-dev 2019-04-24 19:55:07 +00:00
TreeHugger Robot
5e967d8780 Merge "Allow zygote to scan static overlays on /oem" into qt-dev 2019-04-24 08:33:39 +00:00
TreeHugger Robot
e28daa6172 Merge "Fix denial of /debug_ramdisk/adb_debug.prop" into qt-dev 2019-04-24 02:47:19 +00:00
Bowgo Tsai
62fb037476 Fix denial of /debug_ramdisk/adb_debug.prop
This CL fix the following SELinux denial, by allowing init to getatter
for tmpfs:file.

audit: type=1400 audit(15464939.926:4): avc:  denied  { getattr } for
pid=1 comm="init" path="/debug_ramdisk/adb_debug.prop" dev="tmpfs"
ino=25480 scontext=u:r:init:s0 tcontext=u:object_r:tmpfs:s0 tclass=file
permissive=0

Note: the current sepolicy (before this change) has the following rules
for tmpfs:file:

$ sesearch --allow -t tmpfs -c file $OUT/vendor/etc/selinux/precompiled_sepolicy
  allow dex2oat tmpfs:file { read map getattr };
  allow init tmpfs:file { read unlink open setattr };
  allow postinstall_dexopt tmpfs:file read;
  allow profman tmpfs:file { read map };
  allow vendor_init tmpfs:file { read map open setattr };

Bug: 126493225
Test: boot a device with debug ramdisk, checks related files are loaded
Change-Id: I6dd356de989d597828a6e04846b793d611c477fa
Merged-In: I6dd356de989d597828a6e04846b793d611c477fa
(cherry picked from commit 5a234338c1)
2019-04-23 23:13:43 +00:00
Tri Vo
0b0f1cf708 Merge "Treble-ize sepolicy for fwk HIDL services." into qt-dev 2019-04-23 22:10:50 +00:00
TreeHugger Robot
847149180c Merge "Move pf_key socket creation permission to netd" into qt-dev 2019-04-23 21:57:09 +00:00
Wei Wang
76d93f0ce8 Allow signals to power/thermal HAL from dumpstate
Bug: 129711808
Test: Take BR
Change-Id: Ibcb03698a6e2966f4913ddb6e674502bce4df235
2019-04-23 14:21:03 -07:00
Ady Abraham
ff9d4bdd63 Add new surfaceflinger ro props
add the new ro properties added to surfaceflinger:
ro.surface_flinger.set_idle_timer_ms
ro.surface_flinger.use_smart_90_for_video

Bug: 131054357
Test: Boot with SELinux enforcing
Change-Id: I887b318a95db200280344a11fcf7deaadafdeca9
2019-04-23 14:17:32 -07:00
Mikhail Naganov
afcdbefb43 Allow mediaserver to find "audio" service
mediaserver uses libaudioclient (via libmediaplayerservice).
The code in libaudioclient may access IAudioManager.
For that, mediaserver has to be allowed to find "audio" service.

Bug: 123312504
Test: MediaRecorderTest#testAudioRecordInfoCallback
Merged-In: Iaa3651c692fd550f72e7ce6eafbf3386ee07a0c0
Change-Id: Iaa3651c692fd550f72e7ce6eafbf3386ee07a0c0
2019-04-23 09:49:33 -07:00
Bowgo Tsai
f89ea09308 Adding userdebug_plat_sepolicy.cil
The userdebug sepolicy will be installed into debug ramdisk.
When the ramdisk is used, the device must be unlocked and init will load
this userdebug version of platform sepolicy to allow adb root.

Bug: 126493225
Test: 'make' and checks that the userdebug sepolicy is in debug ramdisk
Change-Id: I9df514054a86d63449b3ebfd1afdee2aee649418
Merged-In: I9df514054a86d63449b3ebfd1afdee2aee649418
(cherry picked from commit e763667ee1)
2019-04-23 11:14:19 +08:00
Tri Vo
1bbbf810c9 Treble-ize sepolicy for fwk HIDL services.
Bug: 130734497
Test: m selinux_policy; system_server and statds still have permission
to export HIDL services.
Change-Id: I6e87b236bdbdd939fca51fb7255e97635118ed2d
Merged-In: I6e87b236bdbdd939fca51fb7255e97635118ed2d
(cherry picked from commit 1d34b8cc31)
2019-04-22 17:07:06 -07:00
TreeHugger Robot
f33351bc98 Merge "Adding /debug_ramdisk mount point" into qt-dev 2019-04-22 19:53:20 +00:00
TreeHugger Robot
2c25a31b7a Merge "add mediaswcodec to watchdog and dumpstate" into qt-dev 2019-04-22 19:24:44 +00:00
Bowgo Tsai
1c48f44992 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
Merged-In: Iad3b84d9bdf5d8e789219126c88701bf969253ef
(cherry picked from commit 2e86fa0e81)
2019-04-20 08:00:18 +08:00
Chong Zhang
785521e211 add mediaswcodec to watchdog and dumpstate
bug: 130887807
test: adb bugreport and check mediaswcodec stack is there
Change-Id: I4a37e4e06c4905f435e96d8b1497e3617e688478
(cherry-picked from https://android-review.googlesource.com/c/platform/system/sepolicy/+/947830)
2019-04-19 12:16:40 -07:00
Sudheer Shanka
5bce022dce Remove obsolete denials tracking.
Bug: 118185801
Test: manual
Change-Id: Ibc4590d6e7b825124035e8f51574afbe5ae4b750
2019-04-18 17:22:19 -07:00
TreeHugger Robot
625ed86bc9 Merge "Allow system_server to schedule mediaswcodec" into qt-dev 2019-04-18 03:24:14 +00:00
Chong Zhang
6fd8d82f31 Allow system_server to schedule mediaswcodec
bug: 130669553
Change-Id: I49d4ef473181d2270d90a9350c5e05b8b7db76bb
(cherry-picked from https://android-review.googlesource.com/c/platform/system/sepolicy/+/946836)
2019-04-17 20:51:51 +00:00
Ryan Mitchell
d6d6225d98 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 19:29:08 +00:00
Nick Kralevich
6b34e64ecb Remove isV2App
This selector is no longer used.

Bug: 123605817
Bug: 111314398
Test: compiles and boots

(cherry picked from commit 795add585c)

Change-Id: I673ce4b6898d58602e553e7cf194bb5eac8361e0
2019-04-17 00:10:26 -07:00
TreeHugger Robot
f9085929fb Merge "Allow bootstrap bionic only to init, ueventd, and apexd" into qt-dev 2019-04-15 16:39:14 +00:00
Chenbo Feng
3bf0e82198 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
Merged-In: Id5ca86aa4610e37a2752709ed9cfd4536ea3bfaf
(Cherry picked from commit 8a5539b5f0)
2019-04-12 23:41:35 +00:00
TreeHugger Robot
68f6ff2fff Merge "Allow webview_zygote to read the /data/user/0 symlink." into qt-dev 2019-04-12 19:51:51 +00:00
TreeHugger Robot
09a652eadc Merge "Fix package path of android/soong/android pctx" into qt-dev 2019-04-12 17:24:18 +00:00
Torne (Richard Coles)
180b243c2e 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
(cherry picked from commit d40f7fd9d5)
2019-04-12 11:35:43 -04:00
Maciej Żenczykowski
f4aeb81eec 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
2019-04-11 22:25:00 +00:00
Colin Cross
37fae0520a 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").

Bug: 130298888
Test: m checkbuild
Change-Id: Ic9e8bf25e76dbd61bb1cb1d0e7d095e73c0f279b
2019-04-11 11:02:31 -07:00
Joel Galenson
99149c9fbf Fix denial during bugreport.
Bug: 116711254
Test: Build.
Change-Id: Iafad9228a171796ce7ab18d60697eea396be4efa
Merged-In: I060b0d929a9d147f6327432844106d8270222d18
2019-04-11 09:41:50 -07:00
TreeHugger Robot
99a6d5317e Merge "Let dumpstate get netd stack traces." into qt-dev 2019-04-11 08:42:15 +00:00
Jiyong Park
972d4b6473 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
Merged-In: Id7bba2e8ed1c9faf6aa85dbbdd89add04826b160
Change-Id: Id7bba2e8ed1c9faf6aa85dbbdd89add04826b160
(cherry picked from commit a0f998e6de)
2019-04-11 13:04:19 +09:00
Nick Kralevich
c7a3140398 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

(cherry picked from commit 622ab8a2ba)

Change-Id: Ie5b4852fa217462557fce192c764305893968454
2019-04-09 20:55:30 -07:00
TreeHugger Robot
61cbd0a362 Merge "Allow signals to hal_power_stats_server from dumpstate" into qt-dev 2019-04-09 22:54:04 +00:00
Tri Vo
e65658c044 Merge "ephemeral_app: restore /dev/ashmem open permissions" into qt-dev 2019-04-09 22:27:10 +00:00
TreeHugger Robot
ae58322ba7 Merge "Re-label /data/pkg_staging files as staging." into qt-dev 2019-04-09 19:58:37 +00:00
Tri Vo
0da2ecda62 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
2019-04-09 11:53:53 -07:00
Benjamin Schwartz
b3ecb4e5b9 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: I92e6952b03ffb047e9fb75b0e44024f2623debb3
2019-04-09 10:25:58 -07:00
Dario Freni
b485a6ae20 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
Change-Id: Ie3e77eebd2e7fd7b3a6a940d189cbc2bb386dc0e
2019-04-09 17:12:13 +01:00
Stephen Nusko
ba27ad4806 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
Test: manual
(cherry picked from commit cdda2dc3c9)
Merged-In: Id9106279584798e6689102085fa46a0b7ecb1ba7
Change-Id: Id9106279584798e6689102085fa46a0b7ecb1ba7
2019-04-08 22:29:32 +01:00
Chalard Jean
18bf53fa4f Let dumpstate get netd stack traces.
Test: manual
Bug: 128804277
Change-Id: Ibb3c0063f96f835edb13868b3e7a9fb9f6f94195
(cherry picked from commit a4c9f7b2c6)
2019-04-05 18:09:04 +09:00
Roshan Pius
73449cee1a Merge "wifi: Add a new property to indicate active wifi iface" am: 849ac8020d am: 09b3e95f62
am: 2a65fd6fd5

Change-Id: I72cb4f33460d38b5c3b249a47d0cf0dec3e8ab6e
2019-04-03 10:48:37 -07:00
Roshan Pius
2a65fd6fd5 Merge "wifi: Add a new property to indicate active wifi iface" am: 849ac8020d
am: 09b3e95f62

Change-Id: I9aede4d79b1bb1a58a6a0a7f12ec716dee36c3a9
2019-04-03 10:37:56 -07:00
Roshan Pius
09b3e95f62 Merge "wifi: Add a new property to indicate active wifi iface"
am: 849ac8020d

Change-Id: Icc83697feb50e79f169e4a2b1464a9cf01284369
2019-04-03 10:25:35 -07:00
Treehugger Robot
849ac8020d Merge "wifi: Add a new property to indicate active wifi iface" 2019-04-03 16:51:55 +00:00