Commit graph

4731 commits

Author SHA1 Message Date
Marco Nelissen
52bcfdf5a0 Merge "Remove unneeded permissions" into qt-dev
am: 2b34e6ad9f

Change-Id: I74362a13fe68a37f30fafe53e606b8eb99e812e9
2019-05-09 23:10:28 -07:00
Marco Nelissen
2b34e6ad9f Merge "Remove unneeded permissions" into qt-dev 2019-05-10 01:45:29 +00:00
Maciej Żenczykowski
63067284f1 dontaudit su unlabeled:vsock_socket *
Fix for:
  type=1400 audit(): avc: denied { getopt } for comm=73657276657220736F636B6574 scontext=u:r:su:s0 tcontext=u:object_r:unlabeled:s0 tclass=vsock_socket
  type=1400 audit(): avc: denied { setopt } for comm=73657276657220736F636B6574 scontext=u:r:su:s0 tcontext=u:object_r:unlabeled:s0 tclass=vsock_socket
  type=1400 audit(): avc: denied { read } for comm="adbd" scontext=u:r:su:s0 tcontext=u:object_r:unlabeled:s0 tclass=vsock_socket
  type=1400 audit(): avc: denied { write } for comm="adbd" scontext=u:r:su:s0 tcontext=u:object_r:unlabeled:s0 tclass=vsock_socket

Test: now less audit warnings!
Bug: 131268436
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I3bd1b2262dc6dcb099403d24611db66aac9aecb0
Merged-In: I3bd1b2262dc6dcb099403d24611db66aac9aecb0
(cherry picked from commit ae68bf23b6)
2019-05-10 00:52:45 +00:00
Maciej Żenczykowski
5a56156bcc dnsmasq - allow getattr on unix stream sockets
Fix for:
  type=1400 audit(): avc: denied { getattr } for comm="dnsmasq" path="socket:[25224]" dev="sockfs" ino=25224 scontext=u:r:dnsmasq:s0 tcontext=u:r:netd:s0 tclass=unix_stream_socket permissive=0 b/77868789

Test: built and observed no more avc denials on aosp blueline

Bug: 77868789
Bug: 131268436
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5af4d01e17f2d37335f523a49c7b1f81886edfa2
Merged-In: I5af4d01e17f2d37335f523a49c7b1f81886edfa2
(cherry picked from commit 210cdc6fa4)
2019-05-10 00:52:12 +00:00
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
Marco Nelissen
ba258f0ec0 Remove unneeded permissions
Media component update service is removed, so selinux
permissions for it are no longer needed.

Bug: 123250010
Test: boot, play video
Change-Id: I0fec6839f5caf53d16399cb72dcdd6df327efc95
2019-05-09 22:19:33 +00:00
Maciej Żenczykowski
6e4758f6df Merge "selinux - remove clatd tun creation privs" am: fbae4d9b35
am: 4fbd081176

Change-Id: I7af021708896a47a7195526a2469c2074d4e4c42
2019-05-08 19:34:52 -07:00
Maciej Żenczykowski
fbae4d9b35 Merge "selinux - remove clatd tun creation privs" 2019-05-09 00:11:29 +00: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
8dcf89b41d Merge "Move ro.boot.dynamic_partitions to vendor" am: 5a883148a0
am: 252fae8c15

Change-Id: I8da6567c2d3e77136295da0c5502e5c18f2792b7
2019-05-08 15:30:21 -07: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
Treehugger Robot
5a883148a0 Merge "Move ro.boot.dynamic_partitions to vendor" 2019-05-08 21:39:26 +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
731d07c202 mtp: support using pppox_socket family am: 8fa5ebdee7
am: f1c7d23882

Change-Id: I0044d11bdce37045771f401920955cb5d9e98e33
2019-05-08 06:13:51 -07: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
3e41b297d2 selinux - remove clatd tun creation privs
No longer needed, since this is now done by netd.

In a separate commit so it can potentially not be backported to Q
if we so desire.

Test: build/installed on crosshatch with netd/clatd changes,
  and observed functioning ipv4 on ipv6 only network with no
  avc denials

Bug: 65674744
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id927ee73469d3e90f5111bd5e31ed760a58c8ebe
2019-05-08 10:22:48 +00:00
Maciej Żenczykowski
8fa5ebdee7 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
2019-05-08 01:16:38 -07:00
Hridya Valsaraju
761ce69a25 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
2019-05-07 16:16:27 -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
Maciej Żenczykowski
501ccd8931 Merge "dontaudit su unlabeled:vsock_socket *" am: 3e034a2270
am: 72ec9fca61

Change-Id: I7ef11b0826f8acb9d60bf9deabb557196fbccd11
2019-05-06 19:14:20 -07:00
Treehugger Robot
3e034a2270 Merge "dontaudit su unlabeled:vsock_socket *" 2019-05-07 00:36:51 +00:00
Nick Kralevich
387f7e3a75 Merge "ppp: support using pppox_socket family" am: 83dfb08842
am: 9342f02b2f

Change-Id: Id3d930c1e7adf604a7a9ef44495f69e7345d1687
2019-05-06 16:22:08 -07:00
Maciej Żenczykowski
ae68bf23b6 dontaudit su unlabeled:vsock_socket *
Fix for:
  type=1400 audit(): avc: denied { getopt } for comm=73657276657220736F636B6574 scontext=u:r:su:s0 tcontext=u:object_r:unlabeled:s0 tclass=vsock_socket
  type=1400 audit(): avc: denied { setopt } for comm=73657276657220736F636B6574 scontext=u:r:su:s0 tcontext=u:object_r:unlabeled:s0 tclass=vsock_socket
  type=1400 audit(): avc: denied { read } for comm="adbd" scontext=u:r:su:s0 tcontext=u:object_r:unlabeled:s0 tclass=vsock_socket
  type=1400 audit(): avc: denied { write } for comm="adbd" scontext=u:r:su:s0 tcontext=u:object_r:unlabeled:s0 tclass=vsock_socket

Test: now less audit warnings!
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I3bd1b2262dc6dcb099403d24611db66aac9aecb0
2019-05-06 14:36:39 -07: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
Nick Kralevich
e9cafb91d2 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
2019-05-06 12:57:51 -07:00
Maciej enczykowski
1fe762278e selinux - allow netd to create tun device and pass it in via open fd across execve to clatd cli am: 6450e0038b
am: 7ee2d312be

Change-Id: Ibf8a721b050752616fd422d5ea1e86e408ea7e14
2019-05-05 17:16:47 -07:00
Maciej Żenczykowski
6450e0038b 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
2019-05-05 02:55:20 +00:00
Maciej Żenczykowski
0db05b8cd4 Merge "selinux - netd - tighten down bpf policy" am: b3b12729f4
am: 59c7ccf0ca

Change-Id: Iacb4e97a4e7d6740ee6296a58976826bc9d3cc3b
2019-05-03 17:24:36 -07:00
Maciej Żenczykowski
b3b12729f4 Merge "selinux - netd - tighten down bpf policy" 2019-05-03 22:28:00 +00:00
Maciej Żenczykowski
487fcb87c0 selinux - netd - tighten down bpf policy
bpf programs/maps are now loaded by the bpfloader, not netd

Test: built/installed on crosshatch which uses eBPF - no avc denials

Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1ebd82e6730d62d1966da3c4634ecd78ce703543
2019-05-03 19:39:46 +00:00
Maciej enczykowski
5610eaa701 dnsmasq - allow getattr on unix stream sockets am: 210cdc6fa4
am: 87106c90a8

Change-Id: Ie9cc96e5f6b58c7e20b4333450a174f1f89f94b0
2019-05-03 08:50:48 -07:00
Maciej Żenczykowski
210cdc6fa4 dnsmasq - allow getattr on unix stream sockets
Fix for:
  type=1400 audit(): avc: denied { getattr } for comm="dnsmasq" path="socket:[25224]" dev="sockfs" ino=25224 scontext=u:r:dnsmasq:s0 tcontext=u:r:netd:s0 tclass=unix_stream_socket permissive=0 b/77868789

Test: built and observed no more avc denials on aosp blueline

Bug: 77868789
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5af4d01e17f2d37335f523a49c7b1f81886edfa2
2019-05-03 06:16:57 +00:00
Nick Kralevich
e80b3ea8bc Merge "Add TODOs" am: 3db3b1148b
am: a0d0c96fc0

Change-Id: I54c5fb7ae2079cc3b1c73249d79548487948ffc1
2019-05-02 12:03:45 -07:00
Treehugger Robot
3db3b1148b Merge "Add TODOs" 2019-05-02 18:41:55 +00:00
Maciej Żenczykowski
88497c1622 Merge "selinux - allow dnsmasq to getattr on fifos" am: 21417a7965
am: 117661666a

Change-Id: I02d494d4149ab4eeef9b7cee24b91b83adb13bde
2019-05-02 11:03:21 -07:00
Treehugger Robot
21417a7965 Merge "selinux - allow dnsmasq to getattr on fifos" 2019-05-02 17:37:20 +00:00
Nick Kralevich
44b0efb332 Add TODOs
Bug: 131761776
Test: compiles
Change-Id: Iba3ad475ce25a1ece96717ceecb7c4df8e358d48
2019-05-02 08:29:21 -07:00
Wei Wang
d2aa8da5de Merge "Allow psi monitor users to setched kernel threads" am: 1415c2da7d
am: b8aa92f212

Change-Id: Ifd4f3a350c275da0f26b120cdee287f104e51f6a
2019-05-02 08:12:00 -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
Treehugger Robot
1415c2da7d Merge "Allow psi monitor users to setched kernel threads" 2019-05-02 14:48:41 +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
Maciej Żenczykowski
afa10f7223 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
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ieab51aeb67ebb85b6c778410ba96963612277ae4
2019-05-01 18:04:22 -07:00
Anton Hansson
cfbd1463df Make new vendor properties settable by vendor_init am: c165185e05
am: 36a5420f10

Change-Id: I1fe9913bec25252135b855833849e42649579721
2019-05-01 14:30:37 -07:00
Wei Wang
e95d8e9550 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:23:02 -07: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
Anton Hansson
c165185e05 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
2019-05-01 13:21:17 +01:00
Anton Hansson
0e2d985d50 resolve merge conflicts of b5b796adcd to qt-dev-plus-aosp
Test: presubmit
Bug: None
Merged-In: I24a5382649c64d36fd05a59bc87faca87e6f0eb8
Change-Id: I8c40cfba7b06cf3b431528eb94957022278edbbe
2019-05-01 13:15:22 +01:00
Treehugger Robot
4eb1a20c77 Merge "Sepolicy: add dynamic_system_prop" 2019-05-01 10:33:29 +00:00
TreeHugger Robot
b5b796adcd Merge "Sepolicy: add dynamic_system_prop" into qt-dev 2019-05-01 10:32:28 +00:00
Hung-ying Tyan
565384db61 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 18:29:56 +08:00