Commit graph

20876 commits

Author SHA1 Message Date
Jinguang Dong
0570db683d Merge "fix memory leaks in sepolicy-analyze tool"
am: 5dda7f70db

Change-Id: I212e8c7bba86bf20a169cb132cd9fca2cc3b84ad
2019-05-17 11:14:12 -07:00
Ady Abraham
24f80d1d50 Merge "Add ro.surface_flinger.set_touch_timer_ms to sepolicy" into qt-dev
am: 676d9590f4

Change-Id: Iee0fd3f4844b21faabca2a25a1d045afe622424d
2019-05-17 10:45:51 -07:00
Ady Abraham
676d9590f4 Merge "Add ro.surface_flinger.set_touch_timer_ms to sepolicy" into qt-dev 2019-05-17 17:20:12 +00:00
Treehugger Robot
5dda7f70db Merge "fix memory leaks in sepolicy-analyze tool" 2019-05-17 17:14:20 +00:00
Hridya Valsaraju
217e977107 Allow init to set context for super_block_device
Fixes the following denial during boot:

[    1.358156] selinux: SELinux: Could not set context for
/dev/block/platform/soc/1d84000.ufshc/by-name/super:  Permission denied\x0a
[    1.358275] audit: type=1400 audit(951562.676:7):
avc:  denied  { relabelto } for  pid=1 comm="init" name="super"
dev="tmpfs" ino=17657 scontext=u:r:init:s0 tcontext=u:object_r:super_block_device:s0
tclass=lnk_file permissive=0

Bug: 124410201
Test: make
Change-Id: Ib6752b8a6ae4211ba8c0a7417295b8144a2fed67
2019-05-17 09:35:51 -07:00
Ryan Savitski
19459a3802 atrace: debug: allow notifying camera HAL of a change in sysprops
Similar to aosp/961857, but enables the logging of atrace events from
the camera HAL (primarily HIDL interactions, but also a couple of ION
events).

Keeping it confined to userdebug_or_eng. Longer-term planning belongs on
b/78136428.

Not adding fwk_camera_hwservice, as it is a HIDL interface to
cameraserver (which is already covered above).

Plus slight reorganization of existing atrace.te contents, and donaudits
to reduce logspam from denials (including pre-existing ones that were
hitting the rate limiter).

Specific denials addressed (listing HALs, finding camera HAL, notifying it):
05-15 18:07:19.684   618   618 E SELinux : avc:  denied  { list } for  scontext=u:r:atrace:s0 tcontext=u:r:hwservicemanager:s0 tclass=hwservice_manager permissive=1
05-15 18:07:19.701   618   618 E SELinux : avc:  denied  { find } for interface=android.hardware.camera.provider::ICameraProvider sid=u:r:atrace:s0 pid=10137 scontext=u:r:atrace:s0 tcontext=u:object_r:hal_camera_hwservice:s0 tclass=hwservice_manager permissive=1
05-15 18:07:19.698 10137 10137 I atrace  : type=1400 audit(0.0:273): avc: denied { call } for scontext=u:r:atrace:s0 tcontext=u:r:hal_camera_default:s0 tclass=binder permissive=1

Bug: 130543265
Tested: flashed blueline-userdebug, took a trace with perfetto, confirmed HIDL atrace slices present in camera hal trace.
Change-Id: I0f8ce989355603e41d6c05c3de07e7dd615555eb
2019-05-17 12:20:06 +01:00
Xin Li
327187e50e [automerger skipped] Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190505.001) into master." am: 3c5d416369 -s ours
am: 97c0edd642 -s ours
am skip reason: subject contains skip directive

Change-Id: Iddd47d9376b107e2513aa779bfd87cedfd980f38
2019-05-16 22:18:54 -07:00
Xin Li
97c0edd642 [automerger skipped] Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190505.001) into master."
am: 3c5d416369 -s ours
am skip reason: subject contains skip directive

Change-Id: I03ffc161a4b5421bfbfbbe48ceb29412153d6077
2019-05-16 21:55:49 -07:00
Xin Li
5050536461 [automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190505.001) into master. am: d7d639dbdd -s ours
am: 2f84cf4038 -s ours
am skip reason: subject contains skip directive

Change-Id: I185a8a8a7f9c07781abbd08f45389beb771bbd30
2019-05-16 21:29:30 -07:00
Xin Li
2f84cf4038 [automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190505.001) into master.
am: d7d639dbdd -s ours
am skip reason: subject contains skip directive

Change-Id: Iec6c07597713f3a7ca05888952a41124057659c5
2019-05-16 19:27:12 -07:00
Jinguang Dong
ee62756a7c fix memory leaks in sepolicy-analyze tool
Test: check sepolicy-analyze tool can work well
 sepolicy-analyze out/target/product/<board>/root/sepolicy typecmp -e
 sepolicy-analyze out/target/product/<board>/root/sepolicy typecmp -d
 sepolicy-analyze out/target/product/<board>/root/sepolicy dups
 sepolicy-analyze out/target/product/<board>/root/sepolicy permissive
 sepolicy-analyze out/target/product/<board>/root/sepolicy booleans
 sepolicy-analyze out/target/product/<board>/root/sepolicy attribute <name>

Change-Id: I09d30967f00062c6a807ae4711ccc87b0fd6064c
2019-05-17 09:57:43 +08:00
Xin Li
3c5d416369 Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190505.001) into master." 2019-05-17 00:58:10 +00:00
Stephen Hines
1a2eb96f1f Merge "Ensure avrule is initialized." am: 22cade09bf
am: 903742027c

Change-Id: Idfb9049a33b623360241f2ca8439c47a4b1dab3f
2019-05-16 14:51:08 -07:00
Ady Abraham
a6ba39bde1 Add ro.surface_flinger.set_touch_timer_ms to sepolicy
Test: set ro.surface_flinger.set_touch_timer_ms from init
Bug: 131906818
Change-Id: If489ae4ac993984305f764fb172014f42c41df67
2019-05-16 14:07:32 -07:00
Stephen Hines
903742027c Merge "Ensure avrule is initialized."
am: 22cade09bf

Change-Id: I3d28a4dae1fc0750998507366bdcfccf217f6a0d
2019-05-16 13:37:50 -07:00
Ryan Savitski
4d06233399 [automerger skipped] atrace.te: allow notifying cameraserver of a change in sysprops
am: fb897428f6 -s ours
am skip reason: change_id Ifd3fd5fd3a737c7618960343b9f89d3bf7141c94 with SHA1 232295e8db is in history

Change-Id: I69bcc58e51344ea9d46d77055b04e50d7a1857f2
2019-05-16 12:06:00 -07:00
Treehugger Robot
22cade09bf Merge "Ensure avrule is initialized." 2019-05-16 18:50:34 +00:00
Ryan Savitski
fb897428f6 atrace.te: allow notifying cameraserver of a change in sysprops
This allows the atrace cmd to notify cameraserver (the host of
media.camera service) that the set of tracing-related system properties
have changed. This allows the cameraserver to notice that it might need
to enable its trace events.

The atrace cmd has the necessary permission when running as shell, but
not when it is running as the "atrace" domain (notably when exec'd by
perfetto's traced_probes).

We're adding cameraserver to the whitelist as it contains important
events for investigating the camera stack.

Example denial:
05-14 22:29:43.501  8648  8648 W atrace  : type=1400 audit(0.0:389): avc: denied { call } for scontext=u:r:atrace:s0 tcontext=u:r:cameraserver:s0 tclass=binder permissive=0

Tested: flashed blueline-userdebug, captured a perfetto trace with "camera" atrace category, confirmed that userspace atrace events are included in the trace.
Bug: 130543265
Merged-In: Ifd3fd5fd3a737c7618960343b9f89d3bf7141c94
Change-Id: Ifd3fd5fd3a737c7618960343b9f89d3bf7141c94
(cherry picked from commit 232295e8db)
2019-05-16 14:45:55 +01:00
Xin Li
8e8a6db44e [automerger skipped] Merge "DO NOT MERGE - Merge pi-platform-release (PPRL.190505.001) into stage-aosp-master" into stage-aosp-master
am: 466f763017 -s ours
am skip reason: subject contains skip directive

Change-Id: I824c12abe809b19b98d8b8f5029535ed2572b09e
2019-05-15 19:17:31 -07:00
Xin Li
ad2ff0dab1 [automerger skipped] DO NOT MERGE - Merge pi-platform-release (PPRL.190505.001) into stage-aosp-master
am: 64a0fe3eee -s ours
am skip reason: subject contains skip directive

Change-Id: I074ea37a8d6905153c794764de4824ae2484b30d
2019-05-15 17:45:18 -07:00
Xin Li
d7d639dbdd DO NOT MERGE - Merge pie-platform-release (PPRL.190505.001) into master.
Bug: 132622481
Change-Id: Ia7e5491f115cd49ea5aab7d1add93c73292e326f
2019-05-15 16:55:43 -07:00
TreeHugger Robot
466f763017 Merge "DO NOT MERGE - Merge pi-platform-release (PPRL.190505.001) into stage-aosp-master" into stage-aosp-master 2019-05-15 23:02:15 +00:00
Ian Pedowitz
f8b997fa64 SEPolicy Prebuilts for Q
am: 94b7372534

Change-Id: I8a3748ff07cb3e2e50858f4dd18252171f99b274
2019-05-15 13:56:26 -07:00
Ryan Savitski
35c5201f49 atrace.te: allow notifying cameraserver of a change in sysprops am: 232295e8db
am: 76eabb8c7b

Change-Id: I1379da22b7437e3ee9855c592d9ea3d22007c32a
2019-05-15 08:53:56 -07:00
Ryan Savitski
76eabb8c7b atrace.te: allow notifying cameraserver of a change in sysprops
am: 232295e8db

Change-Id: I3cb6bf2fa220cfe97e0810178d452e4e6b7a35a4
2019-05-15 08:47:51 -07:00
Ian Pedowitz
94b7372534 SEPolicy Prebuilts for Q
Bug: 129943426
Test: Build
Change-Id: I3e091652fa8d1757b1f71f7559186d5b32f000d5
2019-05-14 21:42:22 -07:00
Jeff Sharkey
1e4563c13e Expand deletion powers to all "sdcard_type".
am: 653d0f1f57

Change-Id: I27a897ffe75dc58e8323be41a4aa45db8cece757
2019-05-14 19:06:50 -07:00
Ryan Savitski
232295e8db atrace.te: allow notifying cameraserver of a change in sysprops
This allows the atrace cmd to notify cameraserver (the host of
media.camera service) that the set of tracing-related system properties
have changed. This allows the cameraserver to notice that it might need
to enable its trace events.

The atrace cmd has the necessary permission when running as shell, but
not when it is running as the "atrace" domain (notably when exec'd by
perfetto's traced_probes).

We're adding cameraserver to the whitelist as it contains important
events for investigating the camera stack.

Example denial:
05-14 22:29:43.501  8648  8648 W atrace  : type=1400 audit(0.0:389): avc: denied { call } for scontext=u:r:atrace:s0 tcontext=u:r:cameraserver:s0 tclass=binder permissive=0

Tested: flashed blueline-userdebug, captured a perfetto trace with "camera" atrace category, confirmed that userspace atrace events are included in the trace.
Bug: 130543265
Change-Id: Ifd3fd5fd3a737c7618960343b9f89d3bf7141c94
2019-05-15 00:54:08 +01: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
Xin Li
64a0fe3eee DO NOT MERGE - Merge pi-platform-release (PPRL.190505.001) into stage-aosp-master
Bug: 132622481
Change-Id: Iaee0bd41f640b57a58560c01708ba6ce327b46bb
2019-05-14 12:16:13 -07: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