Commit Graph

20329 Commits

Author SHA1 Message Date
Maciej Żenczykowski
9bb7844efa selinux - allow dnsmasq to getattr on fifos
This is presumably libc isatty detection on stdin/out/err.
Either way - allowing it is harmless.

This fixes:
  type=1400 audit(): avc: denied { getattr } for comm="dnsmasq" path="pipe:[38315]" dev="pipefs" ino=38315 scontext=u:r:dnsmasq:s0 tcontext=u:r:netd:s0 tclass=fifo_file permissive=0

Test: built and observed no more avc denials on crosshatch

Bug: 77868789
Bug: 131268436
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ieab51aeb67ebb85b6c778410ba96963612277ae4
Merged-In: Ieab51aeb67ebb85b6c778410ba96963612277ae4
(cherry picked from commit afa10f7223)
2019-05-10 00:51:42 +00:00
Joel Galenson
654ceeb93f Dontaudit unneeded denials.
These denials are intermittent and unnecessary.  Hide them while we
investigate how to properly fix the issue.

Bug: 131096543
Bug: 132093726
Test: Build
Change-Id: I1950c10a93d183c19c510f869419fcfccd5006d2
2019-05-09 10:43:59 -07:00
TreeHugger Robot
24c34d9379 Merge "Move ro.boot.dynamic_partitions to vendor" into qt-dev 2019-05-08 23:28:51 +00:00
Hridya Valsaraju
033177893f Move ro.boot.dynamic_partitions to vendor
VTS tests are run after flashing a GSI image on the device.
The properties ro.boot.dynamic_partitions and ro.boot.dynamic_partitions_retrofit
are currently placed in product partition and will be overwritten by the GSI image.
We need to move these properties to vendor partition so that they will be available
even after the device is flashed with GSI.

Bug: 132197773
Test: build and flash, adb getprop ro.boot.dynamic_partitions
Change-Id: Ib04896ef744d8d2daa5cb3feee2cbf45aae2ba51
Merged-In: Ib04896ef744d8d2daa5cb3feee2cbf45aae2ba51
2019-05-08 21:40:48 +00:00
Maciej Zenczykowski
036a9b36a6 Merge "mtp: support using pppox_socket family" into qt-dev 2019-05-08 19:13:37 +00:00
Maciej Żenczykowski
7f4b50e306 mtp: support using pppox_socket family
Kernel commit da69a5306ab92e07224da54aafee8b1dccf024f6
("selinux: support distinctions among all network address families")
modified the kernel to support fine grain differentiation of socket
families, if userspace enables it (which Android does).

Modify the mtp SELinux policy to allow the use of pppox_socket
(needed for kernels 4.14 or greater) and the generic "socket" family
(for kernels below 4.14).

Bug: 130852066
Test: compiles
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8ac4c2f98f823120060e51438b39254898f4a27e
Merged-In: I8ac4c2f98f823120060e51438b39254898f4a27e
(cherry picked from commit 8fa5ebdee7)
2019-05-08 06:01:58 -07:00
Maciej enczykowski
532980fb0b selinux - allow netd to create tun device and pass it in via open fd across execve to clatd cli
This is needed to resolve some race conditions between clatd startup and interface naming/numbering.

This resolves:
  type=1400 audit(): avc: denied { read write } for comm="Binder:820_4" name="tun" dev="tmpfs" ino=20564 scontext=u:r:netd:s0 tcontext=u:object_r:tun_device:s0 tclass=chr_file
  type=1400 audit(): avc: denied { open } for comm="Binder:820_4" path="/dev/tun" dev="tmpfs" ino=20564 scontext=u:r:netd:s0 tcontext=u:object_r:tun_device:s0 tclass=chr_file
  type=1400 audit(): avc: denied { ioctl } for comm="Binder:820_4" path="/dev/tun" dev="tmpfs" ino=20564 ioctlcmd=0x54ca scontext=u:r:netd:s0 tcontext=u:object_r:tun_device:s0 tclass=chr_file
  type=1400 audit(): avc: denied { create } for comm="Binder:820_4" scontext=u:r:netd:s0 tcontext=u:r:netd:s0 tclass=tun_socket

Test: built/installed on crosshatch with netd->clatd tunfd passing and observed no selinux denials
Bug: 65674744
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ib501c755e11ec8a3a22c8aa333b5af7ec0bff306
Merged-In: Ib501c755e11ec8a3a22c8aa333b5af7ec0bff306
(cherry picked from commit 6450e0038b)
2019-05-07 10:29:15 +00:00
Nick Kralevich
64aa71a430 ppp: support using pppox_socket family
Kernel commit da69a5306ab92e07224da54aafee8b1dccf024f6
("selinux: support distinctions among all network address families")
modified the kernel to support fine grain differentiation of socket
families, if userspace enables it (which Android does).

Modify the ppp SELinux policy to allow the use of pppox_socket
(needed for kernels 4.14 or greater) and the generic "socket" family
(for kernels below 4.14).

Addresses the following denials:

04-19 20:25:34.059 16848 16848 I pppd    : type=1400 audit(0.0:8703): avc: denied { read write } for dsm=HS_Q path="socket:[171178]" dev="sockfs" ino=171178 scontext=u:r:ppp:s0 tcontext=u:r:mtp:s0 tclass=pppox_socket permissive=1
04-19 20:25:34.075 16848 16848 I pppd    : type=1400 audit(0.0:8704): avc: denied { ioctl } for dsm=HS_Q path="socket:[171179]" dev="sockfs" ino=171179 ioctlcmd=0x7437 scontext=u:r:ppp:s0 tcontext=u:r:mtp:s0 tclass=pppox_socket permissive=1

Bug: 130852066
Test: compiles
Change-Id: I00cc07108acaac5f2519ad0093d9db9572e325dc
Merged-In: I00cc07108acaac5f2519ad0093d9db9572e325dc
2019-05-06 14:11:02 -07:00
TreeHugger Robot
6f1800f6df Merge "Allow psi monitor users to setched kernel threads" into qt-dev 2019-05-02 14:48:56 +00:00
Anton Hansson
5f5f32271a Merge "Make new vendor properties settable by vendor_init" into qt-dev 2019-05-02 08:24:48 +00:00
Wei Wang
a3d6302c57 Allow psi monitor users to setched kernel threads
psi monitor sched_setscheduler(kworker->task, SCHED_FIFO, &param) was added into pa/1282597

Bug: 131252752
Bug: 129476847
Test: build
Change-Id: I69fdd90e4a39da8d33b417efc7ea7a0da9d9290b
2019-05-01 10:18:48 -07:00
TreeHugger Robot
b5b796adcd Merge "Sepolicy: add dynamic_system_prop" into qt-dev 2019-05-01 10:32:28 +00:00
TreeHugger Robot
e1757623ee Merge "Add sepolicy for nfc hal v1.2" into qt-dev 2019-04-30 20:33:35 +00:00
Hung-ying Tyan
dea144c1e5 Sepolicy: add dynamic_system_prop
and allow shell and system_app (Settings) to set it to enable Dynamic System Update.
Also allow priv_app (user of the API) to read it.

Bug: 119647479
Bug: 129060539
Test: run the following command on crosshatch-user:
      adb shell setprop persist.sys.fflag.override.settings_dynamic_system 1

Change-Id: I24a5382649c64d36fd05a59bc87faca87e6f0eb8
Merged-In: I24a5382649c64d36fd05a59bc87faca87e6f0eb8
2019-04-30 05:36:19 +00:00
Anton Hansson
63c402acec Make new vendor properties settable by vendor_init
These properties were moved to /vendor as part of b/130025216.
Allow them to be set by vendor_init, too.

Bug: 130025216
Bug: 131066061
Test: no SELinux warnings for said props at boot
Change-Id: I5293831bedb89e9c8d3ddf13cf7babde26872f28
Merged-In: I5293831bedb89e9c8d3ddf13cf7babde26872f28
2019-04-29 15:35:09 +01:00
TreeHugger Robot
f546fd8ee5 Merge "Add selinux rule to allow Traceur to enable the traced daemon." into qt-dev 2019-04-26 19:18:20 +00:00
Carmen Jackson
ac55fe955f Add selinux rule to allow Traceur to enable the traced daemon.
Bug: 130784724
Test: manual
Change-Id: Ic1903e273f5a136b3e0b14a901a60d8d0a81b211
2019-04-25 23:59:06 -07:00
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
Jack Yu
58329f6536 Add sepolicy for nfc hal v1.2
Bug: 130509605
Test: No avc denial log and NFC works with hal v1.2
Change-Id: If54884f76a32705d11f2085f66fe83b9e0354f79
Merged-In: If54884f76a32705d11f2085f66fe83b9e0354f79
(cherry picked from commit a5dde796b5)
2019-04-24 09:58:44 +08: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