Commit graph

20645 commits

Author SHA1 Message Date
Jeff Sharkey
1e4563c13e Expand deletion powers to all "sdcard_type".
am: 653d0f1f57

Change-Id: I27a897ffe75dc58e8323be41a4aa45db8cece757
2019-05-14 19:06:50 -07:00
Nick Kralevich
b5481387e8 Delete ineffective netd neverallow assertion am: 9fd6a90a4c
am: 3396740eb6

Change-Id: I7e7a3ffdb6b0d46e67e1c61161ef61306a1bd228
2019-05-14 16:11:12 -07:00
Nick Kralevich
3396740eb6 Delete ineffective netd neverallow assertion
am: 9fd6a90a4c

Change-Id: Ia126badac9b7f459ab5e23f631ee2bb28460b510
2019-05-14 16:05:07 -07:00
Jeff Sharkey
653d0f1f57 Expand deletion powers to all "sdcard_type".
installd has been deleting files on the primary (emulated) storage
device for awhile now, but it was lacking the ability to delete files
on secondary (physical) storage devices.

Even though we're always going through an sdcardfs layer, the
kernel checks our access against the label of the real underlying
files.

Instead of tediously listing each possible storage label, using
"sdcard_type" is more descriptive and future-proof as new
filesystems are added.

avc: denied { read open } for path="/mnt/media_rw/1B82-12F6/Android/data/com.android.cts.writeexternalstorageapp" dev="loop9p1" ino=1224 scontext=u:r:installd:s0 tcontext=u:object_r:vfat:s0 tclass=dir permissive=1
avc: denied { write search } for name="cache" dev="loop9p1" ino=1225 scontext=u:r:installd:s0 tcontext=u:object_r:vfat:s0 tclass=dir permissive=1
avc: denied { remove_name } for name="probe" dev="loop9p1" ino=1232 scontext=u:r:installd:s0 tcontext=u:object_r:vfat:s0 tclass=dir permissive=1
avc: denied { unlink } for name="probe" dev="loop9p1" ino=1232 scontext=u:r:installd:s0 tcontext=u:object_r:vfat:s0 tclass=file permissive=1
avc: denied { rmdir } for name="cache" dev="loop9p1" ino=1225 scontext=u:r:installd:s0 tcontext=u:object_r:vfat:s0 tclass=dir permissive=1

Bug: 113277754
Test: atest android.appsecurity.cts.StorageHostTest
Test: atest android.appsecurity.cts.ExternalStorageHostTest
Test: atest --test-mapping frameworks/base/services/core/java/com/android/server/pm/
Change-Id: Id79d8f31627c0bfb490b4280c3b0120d0ef699bf
2019-05-14 15:34:33 -06:00
Nick Kralevich
9fd6a90a4c Delete ineffective netd neverallow assertion
It doesn't make sense to write neverallow assertions where an attribute
negation exists allowing the operation. When such a negation exists,
domains can "opt-out" of the neverallow assertion by declaring their
use of the attribute. Such trivially bypassable assertions provide
no security nor architectural guarantees.

"netdomain" is such an attribute. This attribute is used by processes to
indicate that they communicate with the network, for example, using
TCP/UDP sockets. Vendor code is freely allowed to use network
communication by declaring their use of the attribute.

Because the attribute is usable to any vendor domain, the "no socket
connections to netd" restriction is pointless and provides a false sense
of security. Any process can opt-out of these restrictions by just
declaring their use of networking functionality. This also results in
ineffective policy bloat, making it difficult to reason about the policy
and make changes.

Delete the ineffective, misleading neverallow assertion.

Test: compiles
Change-Id: Ia72d9660a337ef811e56c9227af29b17d043b99f
2019-05-14 01:33:55 -07:00
Joel Galenson
81c543c7ba Merge "Dontaudit unneeded denials." am: 62f0e4f9d0
am: 44dbfc9c31

Change-Id: Iff27d2b2f320e0d2ef9af4381c2b1237d32d67b0
2019-05-13 09:26:31 -07:00
Joel Galenson
44dbfc9c31 Merge "Dontaudit unneeded denials."
am: 62f0e4f9d0

Change-Id: I30893cf5b64ed90d38c84827b47c30f68e75b436
2019-05-13 09:20:13 -07:00
Treehugger Robot
62f0e4f9d0 Merge "Dontaudit unneeded denials." 2019-05-13 15:35:46 +00:00
Maciej enczykowski
5dbcbaed2c sepolicy - move public clatd to private am: 44328c061d
am: 765845c7d9

Change-Id: I574d33fa8b3906e40c2378b72f0b094033dc566b
2019-05-12 00:01:50 -07:00
Maciej enczykowski
765845c7d9 sepolicy - move public clatd to private
am: 44328c061d

Change-Id: Ib6156c7047dee7f20c91654d3efdd3a51a27b46e
2019-05-11 23:56:46 -07:00
Maciej Żenczykowski
44328c061d sepolicy - move public clatd to private
Clatd is effectively an internal implementation detail of netd.
It exists as a separate daemon only because this gives us a better
security boundary.  Netd is it's only launcher (via fork/exec) and
killer.

Generated via:
  { echo; cat public/clatd.te; echo; } >> private/clatd.te
  rm -f public/clatd.te

  plus a minor edit to put coredomain after clatd type declaration
  and required changes to move netd's clatd use out of public into private.

Test: build and install on non-aosp test device, atest, check for selinux clat denials
Change-Id: I80f110b75828f3657986e64650ef9e0f9877a07c
2019-05-11 17:47:25 -07:00
Nicolas Geoffray
6f476b3712 [automerger skipped] Merge "Allow system server to lock system files." into qt-dev
am: 622992fd49 -s ours
am skip reason: change_id I4339f19af999d43e07995ddb77478a2384bbe209 with SHA1 db3fde05b5 is in history

Change-Id: Ia1b175f2c19e5e3f3e104f85777c081ebc093a54
2019-05-10 17:31:38 -07:00
Nicolas Geoffray
622992fd49 Merge "Allow system server to lock system files." into qt-dev 2019-05-10 22:40:00 +00:00
Nicolas Geoffray
9fdb9cd464 Merge "Allow system server to lock system files." am: 8f5436a19a
am: 37b90c0d14

Change-Id: I56281d7ed23d921b86fc0a784f2c79dccfa6fe2f
2019-05-10 09:56:01 -07:00
Nicolas Geoffray
37b90c0d14 Merge "Allow system server to lock system files."
am: 8f5436a19a

Change-Id: I4025adb1799fa7c96d06aca0db1c572f64fab136
2019-05-10 09:50:55 -07:00
Nicolas Geoffray
52414b2d59 Allow system server to lock system files.
ART generically locks profile files, and this avoids
special casing the ART code for read-only partitions.

An example on how ART does it:
https://android-review.googlesource.com/c/platform/art/+/958222/3/runtime/jit/jit.cc#731

Bug: 119800099
Test: system server locking a system file, no denial

(cherry picked from commit db3fde05b5)

Change-Id: I5623f5d548dd1226e5788e369333922a27f14021
Merged-In: I4339f19af999d43e07995ddb77478a2384bbe209
2019-05-10 17:37:14 +01:00
Nicolas Geoffray
8f5436a19a Merge "Allow system server to lock system files." 2019-05-10 16:34:08 +00:00
Joel Galenson
5d5ac9ad6e 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
(cherry picked from commit 654ceeb93f)
2019-05-10 08:14:54 -07:00
Yiwei Zhang
11eba05a01 Allow dumpstate to dumpsys gpu am: 0051c93e0b
am: 93257b0d61

Change-Id: I4f958d661bc68ac652df545f5332817eb9f23bbb
2019-05-10 07:45:36 -07:00
Yiwei Zhang
93257b0d61 Allow dumpstate to dumpsys gpu
am: 0051c93e0b

Change-Id: I97926d32185082e1607448e773f83136b014fbfa
2019-05-10 07:40:31 -07:00
Maciej enczykowski
d21b21990b [automerger skipped] selinux - netd - tighten down bpf policy
am: 7c40e0bb6e -s ours
am skip reason: change_id I1ebd82e6730d62d1966da3c4634ecd78ce703543 with SHA1 487fcb87c0 is in history

Change-Id: I4c57a1b329f9ae1a2e66369658861baf379046b2
2019-05-10 01:57:07 -07:00
Maciej enczykowski
bcb4595b71 [automerger skipped] selinux - remove clatd tun creation privs
am: 24dd16b650 -s ours
am skip reason: change_id Id927ee73469d3e90f5111bd5e31ed760a58c8ebe with SHA1 3e41b297d2 is in history

Change-Id: I14bc89d2151b790278dd6e877312b8edfc05aac4
2019-05-10 01:24:27 -07:00
Tri Vo
fabfb36b8e Merge "priv_app: suppress denials to proc_net" am: 6c4f6d0f5a
am: a61c720e15

Change-Id: I49eee3ecebcf751864b0ada30220c5c18b222c90
2019-05-10 01:16:02 -07:00
Tri Vo
a61c720e15 Merge "priv_app: suppress denials to proc_net"
am: 6c4f6d0f5a

Change-Id: I1fcffa1ed22fd02bf03f1a847da14ba3310dd967
2019-05-10 00:58:22 -07:00
Yiwei Zhang
0051c93e0b Allow dumpstate to dumpsys gpu
Bug: 132402890
Test: adb bugreport and verify dumpsys gpu is included.
Change-Id: Ib145937889f9616a0dcdabb7b58839fb715bf6c3
2019-05-09 23:15:49 -07:00
Luke Huang
3b52b0f17a Merge "Clean sepolicy of unused netd_socket" into qt-dev
am: dc4dc55784

Change-Id: I396104eedf91564d186c408dac4dd637e23a240d
2019-05-09 23:11:01 -07:00
Marco Nelissen
52bcfdf5a0 Merge "Remove unneeded permissions" into qt-dev
am: 2b34e6ad9f

Change-Id: I74362a13fe68a37f30fafe53e606b8eb99e812e9
2019-05-09 23:10:28 -07:00
Maciej enczykowski
c8802b80bf [automerger skipped] dontaudit su unlabeled:vsock_socket *
am: 63067284f1 -s ours
am skip reason: change_id I3bd1b2262dc6dcb099403d24611db66aac9aecb0 with SHA1 ae68bf23b6 is in history

Change-Id: I177f0150b4d4ba19841a19fee6d8f15a49cd7fc3
2019-05-09 23:10:00 -07:00
Maciej enczykowski
3fc9a4e149 [automerger skipped] dnsmasq - allow getattr on unix stream sockets
am: 5a56156bcc -s ours
am skip reason: change_id I5af4d01e17f2d37335f523a49c7b1f81886edfa2 with SHA1 210cdc6fa4 is in history

Change-Id: I97fb79ff555ecffdef5f8e88e4022e076083f7f8
2019-05-09 23:09:41 -07:00
Maciej Żenczykowski
7c40e0bb6e 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

Bug: 131268436
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1ebd82e6730d62d1966da3c4634ecd78ce703543
Merged-In: I1ebd82e6730d62d1966da3c4634ecd78ce703543
(cherry picked from commit 487fcb87c0)
2019-05-10 05:52:30 +00:00
Tri Vo
6c4f6d0f5a Merge "priv_app: suppress denials to proc_net" 2019-05-10 05:35:19 +00:00
Maciej Żenczykowski
24dd16b650 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
Bug: 131268436
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id927ee73469d3e90f5111bd5e31ed760a58c8ebe
Merged-In: Id927ee73469d3e90f5111bd5e31ed760a58c8ebe
(cherry picked from commit 3e41b297d2)
2019-05-10 05:13:44 +00:00
Xin Li
0262dc3710 [automerger skipped] Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master." am: f4c31d3f14 -s ours
am: 20b1e98c3c -s ours
am skip reason: subject contains skip directive

Change-Id: I899bdd20475bf8b6a6670402d50a9beee67d0aa7
2019-05-09 21:53:33 -07:00
TreeHugger Robot
dc4dc55784 Merge "Clean sepolicy of unused netd_socket" into qt-dev 2019-05-10 03:15:56 +00:00
Xin Li
20b1e98c3c [automerger skipped] Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master."
am: f4c31d3f14 -s ours
am skip reason: subject contains skip directive

Change-Id: I161d19915c84f455eb50137cb962fecfd00e1277
2019-05-09 19:53:59 -07:00
Nicolas Geoffray
db3fde05b5 Allow system server to lock system files.
ART generically locks profile files, and this avoids
special casing the ART code for read-only partitions.

An example on how ART does it:
https://android-review.googlesource.com/c/platform/art/+/958222/3/runtime/jit/jit.cc#731

Bug: 119800099
Test: system server locking a system file, no denial
Change-Id: I4339f19af999d43e07995ddb77478a2384bbe209
2019-05-10 03:00:18 +01:00
Marco Nelissen
2b34e6ad9f Merge "Remove unneeded permissions" into qt-dev 2019-05-10 01:45:29 +00:00
Maciej enczykowski
1749e15016 [automerger skipped] selinux - allow dnsmasq to getattr on fifos
am: 9bb7844efa -s ours
am skip reason: change_id Ieab51aeb67ebb85b6c778410ba96963612277ae4 with SHA1 afa10f7223 is in history

Change-Id: Ie31a3810a21ee64be15310e62ecbec3da2f3abb8
2019-05-09 18:09:16 -07: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
Android Build Merger (Role)
5cb090d977 Merge "[automerger skipped] DO NOT MERGE - Merge Pie Bonito/Sargo into master. am: 199072d2be -s ours am: 1691a7b80e -s ours am skip reason: subject contains skip directive" into qt-dev-plus-aosp 2019-05-10 00:49:57 +00:00
Joel Galenson
68ec29c861 Dontaudit unneeded denials.
am: 654ceeb93f

Change-Id: I32074b390e6044a8aebc8fbb239a5b51bfe2559a
2019-05-09 17:39:28 -07:00
Xin Li
3eb30aa7d2 [automerger skipped] DO NOT MERGE - Merge Pie Bonito/Sargo into master. am: 199072d2be -s ours
am: 1691a7b80e -s ours
am skip reason: subject contains skip directive

Change-Id: I2c6a86af0b868ccac2a97fe1ace5a3cd5f8921d0
2019-05-09 17:30:38 -07:00
Xin Li
1691a7b80e [automerger skipped] DO NOT MERGE - Merge Pie Bonito/Sargo into master.
am: 199072d2be -s ours
am skip reason: subject contains skip directive

Change-Id: Ic2613a41f0bdd2ec1865668ac22bde12fa5ad83f
2019-05-09 16:16:13 -07:00
Tri Vo
e319c03673 priv_app: suppress denials to proc_net
avc: denied { read } for comm="UserFacing3" name="arp" dev="proc"
ino=4026532043 scontext=u:r:priv_app:s0:c512,c768
tcontext=u:object_r:proc_net:s0 tclass=file permissive=0
app=com.google.android.googlequicksearchbox

Bug: 132376360
Test: m selinux_policy
Change-Id: I6ebe8b6806268f31885026a81ebea0ed15b532d2
2019-05-09 16:14:45 -07: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
Xin Li
f4c31d3f14 Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master." 2019-05-09 22:05:51 +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
Xin Li
199072d2be DO NOT MERGE - Merge Pie Bonito/Sargo into master.
Bug: 131756210
Change-Id: I671e7465545522755b090018c4d9941c72b15008
2019-05-09 09:27:07 -07:00