Commit graph

2725 commits

Author SHA1 Message Date
Hridya Valsaraju
4ae8fe9b84 Define 'super_block_device' type
Bug: 78793464
Test: fastboot getvar partition-size:super

'super_block_device' corresponds to the super partition
required for flashing dynamic partitions.

Change-Id: I323634b6797ead7c5face117a7028bf9ab947aea
2018-08-20 10:55:03 -07:00
Dario Freni
e217ab1b4d s/product-services/product_services/g
Attempting to reduce the number of different spellings we have for
"product services" partition in the codebase.

Bug: 112431447
Test: m
Change-Id: I1499c60e3d6c6c9fbe2e3f30f097f83b1e837c1c
Merged-In: I1499c60e3d6c6c9fbe2e3f30f097f83b1e837c1c
2018-08-20 17:46:16 +00:00
Jerry Zhang
5c9d0ce1b6 Merge "Add sepolicy for fastbootd"
am: 50ca0a0d18

Change-Id: I6bfb32d3603733b998ee890e2f6d006e1ddcdaf6
2018-08-15 14:57:25 -07:00
Treehugger Robot
50ca0a0d18 Merge "Add sepolicy for fastbootd" 2018-08-15 20:36:56 +00:00
Joel Galenson
7f8f10b253 Merge "bug_map: track new pm/storage denials"
am: a28f4d156c

Change-Id: I27549b36f01ef4f49077a102f1aaa45ed09f20d3
2018-08-15 12:57:20 -07:00
Joel Galenson
a68b104452 bug_map: track new pm/storage denials
avc: denied { getattr } for comm="Binder:1231_1" path="/storage/emulated" dev="tmpfs" ino=72787 scontext=u:r:system_server:s0 tcontext=u:object_r:storage_stub_file:s0 tclass=dir

Bug: 112609936
Test: Built policy.
Change-Id: Ib772aca11bad4ba267de259be4ad065f228ef1df
2018-08-15 10:21:23 -07:00
Jerry Zhang
1d85efa9f4 Add sepolicy for fastbootd
Also allow adb and fastboot to talk to recovery
through recovery_socket. This enables changing
between modes with usb commands.

Test: No selinux denials
Bug: 78793464
Change-Id: I80c54d4eaf3b94a1fe26d2280af4e57cb1593790
2018-08-15 08:45:22 -07:00
Florian Mayer
67eeee0535 Revert "Add sepolicy for fastbootd"
am: c2ab15b798

Change-Id: Idb7dc194781bbf098e705b6fa59a886ca5d8f274
2018-08-15 06:41:22 -07:00
Florian Mayer
c2ab15b798 Revert "Add sepolicy for fastbootd"
This reverts commit 0fd3ed3b8b.

Reason for revert: Broke user builds.

Change-Id: If95f1a25d22425a5a2b68a02d1561352fb5a52f0
2018-08-15 09:38:40 +00:00
Jerry Zhang
b3fe201ea7 Add sepolicy for fastbootd
am: 0fd3ed3b8b

Change-Id: I538723368f223ee0e190523c0b35f54ebe0d98f8
2018-08-14 15:55:43 -07:00
Mark Salyzyn
f41313f4ff fs_mgr: use ro.persistent_properties.ready
am: 7ab1450d8c

Change-Id: I4d37eb9bda525f7626502d6f88395feac70358c2
2018-08-14 14:00:40 -07:00
Jerry Zhang
0fd3ed3b8b Add sepolicy for fastbootd
Also allow adb and fastboot to talk to recovery
through recovery_socket. This enables changing
between modes with usb commands.

Test: No selinux denials
Bug: 78793464
Change-Id: I1f97659736429fe961319c642f458c80f199ffb4
2018-08-14 20:21:36 +00:00
Mark Salyzyn
7ab1450d8c fs_mgr: use ro.persistent_properties.ready
Replace more complicated logic that determines that persistent
properties are now valid with a simple check of
ro.persistent_properties.ready.

Test: manual
Bug: 109821005
Change-Id: I8c63beb294377ea9ce6eb6336b83f529deedd830
2018-08-14 07:51:49 -07:00
Tri Vo
e5374e6784 Sepolicy for system suspend HAL.
am: dac2a4a3a4

Change-Id: Ia03441639efe7f2147db104c7b1533b941c60f9e
2018-08-13 18:52:30 -07:00
Tri Vo
dac2a4a3a4 Sepolicy for system suspend HAL.
Bug: 78888165
Test: device can boot with HAL running.
Change-Id: I3bf7c8203e038b892176c97ec006152a2904c7be
2018-08-13 17:26:34 -07:00
Xin Li
71e3ecb9e0 Merge "Merge stage-dr1-aosp-master into stage-aosp-master" into stage-aosp-master 2018-08-13 23:42:28 +00:00
Xin Li
3dc2139f1e Merge stage-dr1-aosp-master into stage-aosp-master
Bug: 112535855
Change-Id: Ib687f6cd68735c953dc1d575517c30a07639a451
2018-08-13 13:01:25 -07:00
Treehugger Robot
949019625d Merge "Revert "Change priv-apps /home/home labels to privapp_data_file"" 2018-08-13 19:54:25 +00:00
Nick Kralevich
cdc6649acc Revert "Change priv-apps /home/home labels to privapp_data_file"
There is a problem with on-disk labeling of files created by secondary
dex background compilation which is causing unexpected denials to show
up. Restore the old labeling until we are able to fix the underlying
problem.

Steps to reproduce:
  1) boot android device.
  2) adb root
  3) Run cmd package compile -r bg-dexopt --secondary-dex com.google.android.gms
  4) Examine the files in /data/user_de/0/com.google.android.gms
Expected:
  All files have the label privapp_data_file
Actual:
  The files in /data/user_de/0/com.google.android.gms/app_chimera/m
  are labeled "app_data_file", not "privapp_data_file".

This reverts commit 4df57822fc.

Bug: 112357170
Test: policy compiles
Change-Id: I38ba75c92c9c46e6a1fdbc02e3dc80c63adccaa8
2018-08-13 11:41:04 -07:00
Nick Kralevich
c47e149a0b Revert "auditallow app_data_file execute"
There is a problem with on-disk labeling of files created by secondary
dex background compilation which is causing unexpected denials to show
up. Drop the auditallow rule to avoid logspam.

Steps to reproduce:
  1) boot android device.
  2) adb root
  3) Run cmd package compile -r bg-dexopt --secondary-dex com.google.android.gms
  4) Examine the files in /data/user_de/0/com.google.android.gms
Expected:
  All files have the label privapp_data_file
Actual:
  The files in /data/user_de/0/com.google.android.gms/app_chimera/m
  are labeled "app_data_file", not "privapp_data_file".

Addresses the following audit logspam:
  type=1400 audit(0.0:117): avc: granted { execute } for comm=4173796E635461736B202331 path="/data/user_de/0/com.google.android.gms/app_chimera/m/00000002/oat/arm/DynamiteLoader.odex" dev="dm-0" ino=5775 scontext=u:r:untrusted_app:s0:c111,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file app=com.android.chrome

Additionally, this removes auditallow statements for older untrusted
apps. Lots of big apps are executing files from their home directory.
Additional restrictions in this area will need to be tied to API
versions.

Addresses the following audit logspam:
  type=1400 audit(0.0:619): avc: granted { execute } for comm="na:notification" path="/data/data/com.facebook.katana/lib-xzs/libbreakpad.so" dev="dm-3" ino=28333 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file app=com.facebook.katana
  type=1400 audit(0.0:129): avc: granted { execute } for comm="ticlock" path="/data/data/is.shortcut/files/ticlock/ticlock" dev="dm-3" ino=58614 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file app=is.shortcut
  type=1400 audit(0.0:1239): avc: granted { execute } for comm="Analytics-Norma" path="/data/data/com.facebook.orca/lib-xzs/libchipsetmerged.so" dev="dm-3" ino=50243 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file app=com.facebook.orca
  type=1400 audit(0.0:58): avc: granted { execute_no_trans } for comm="sh" path="/data/data/is.shortcut/files/ticlock/ticlock" dev="dm-3" ino=58614 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file app=is.shortcut
  type=1400 audit(0.0:1948): avc: granted { execute_no_trans } for comm="sh" path="/data/data/com.mxdata.tube.Market/files/osmcore" dev="sda13" ino=2752651 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file app=com.mxdata.tube.Market
  type=1400 audit(0.0:2875): avc: granted { execute_no_trans } for comm="ThreadPoolManag" path="/data/data/com.amazon.kindle/files/hardwareTest" dev="sda13" ino=1935346 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file app=com.amazon.kindle

This reverts commit 4738b93db2.

Bug: 112357170
Test: policy compiles
2018-08-13 11:23:02 -07:00
Chia-I Wu
7c5e18c494 Allow signals to hal_graphics_allocator_server from dumpstate
This is needed for bugreport to include ANR trace for the process.

Bug: 111604912
Test: adb bugreport
Change-Id: I3f09e17523ccf9b637fd9590e53a13e03e80ccaa
2018-08-13 10:41:48 -07:00
David Ng
5a33163678 Explicitly allow system_server to (m)map data files am: 383471c267
am: 521ab8f556

Change-Id: Icec07febd479d85dd4caf9bafc81a6ab7ab9e444
2018-08-10 16:10:57 -07:00
Suren Baghdasaryan
c85ed76582 Selinux: Allow lmkd write access to sys.lmk. properties am: c8ed855ede
am: 4fd3aab93b

Change-Id: I1116837c319c4f9dbc2ac1a093a97f15a4fc07cd
2018-08-10 16:10:38 -07:00
Yifan Hong
562a0d2f97 Merge "Add sepolicy for health filesystem HAL" am: 3dd465a097
am: 33eee9c584

Change-Id: I84d7cc56ec9280957218357ed97c1ca606b24795
2018-08-10 16:10:17 -07:00
David Ng
383471c267 Explicitly allow system_server to (m)map data files
Linux kernel 4.14+ SELinux starts explicit map
permission check for file mmap operations.  Add this
permission to system_server for data file access,
which is used in scenario such as "adb install" of
APK's.

test: no longer see SELinux map denial on "adb install"
Change-Id: Id6016dd0b3f15dfdb0f02509ea812dee61ac78ed
2018-08-10 20:56:45 +00:00
Suren Baghdasaryan
c8ed855ede Selinux: Allow lmkd write access to sys.lmk. properties
Allow lmkd write access to sys.lmk. properties to be able to set
sys.lmk.minfree_levels.

Bug: 111521182
Test: getprop sys.lmk.minfree_levels returns value set by lmkd
Change-Id: I86ff11d75917966857d3a76876a56799bb92a5ad
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-08-10 20:05:46 +00:00
Yifan Hong
3dd465a097 Merge "Add sepolicy for health filesystem HAL" 2018-08-10 20:00:56 +00:00
Yifan Hong
0814795c79 Add sepolicy for health filesystem HAL
Test: builds
Test: vts
Bug: 111655771
Change-Id: Iabad3d124bf476cb624addf7d7898e0c2894d550
2018-08-10 11:02:21 -07:00
Chia-I Wu
f1166714d7 Allow signals to hal_graphics_allocator_server am: c3aec707f1
am: 43c6f49f7c

Change-Id: I6ad81a526adb868d534731bc8261f16b98203a13
2018-08-10 09:51:37 -07:00
Chia-I Wu
c3aec707f1 Allow signals to hal_graphics_allocator_server
This is needed to dump ANR traces for the process.

Bug: 111604912
Test: adb shell am hang
Change-Id: Icadc2de95a12818fe623271d1afb955843ccddbf
2018-08-09 15:56:47 -07:00
Mark Salyzyn
151642560d Merge "fs_mgr: add overlayfs handling for squashfs system filesystems" am: ccfffe6e0d
am: ae3410152b

Change-Id: I3ab42b9188cef685361143815c94109ab64c9b3f
2018-08-08 12:20:08 -07:00
Nick Kralevich
6ae170f5ae Remove legacy execmod access from API >= 26. am: f3eb985447
am: e5662c6513

Change-Id: I52a3b1722a7826fd3e4fc89d19fe1f66c6e1ce0f
2018-08-08 12:00:36 -07:00
Nick Kralevich
efbbb53b37 Revert "Remove legacy execmod access." am: d90d001a78
am: a213d958dd

Change-Id: I1cba2e601b7aa5f723411791784d62af08da3855
2018-08-08 11:06:54 -07:00
Mark Salyzyn
9b398f3fb7 fs_mgr: add overlayfs handling for squashfs system filesystems
/cache/overlay directory in support of overlayfs mounts on userdebug
and eng devices.  Overlayfs in turn can be capable of supporting
adb remount for read-only or restricted-storage filesystems like
squashfs or right-sized (zero free space) system partitions
respectively.

Test: compile
Bug: 109821005
Bug: 110985612
Change-Id: I3ece03886db7cc97f864497cf93ec6c6c39bccd1
2018-08-08 07:33:10 -07:00
Nick Kralevich
f3eb985447 Remove legacy execmod access from API >= 26.
Text relocation support was removed from the linker for apps targeting
API >= 23. See
https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#text-relocations-enforced-for-api-level-23

However, the security policy was not updated to remove the execmod
permission at that time, since we didn't have support for targeting
SELinux policies to API versions.

Remove execmod permissions for apps targeting API 26 or greater. The
linker support was removed, so it's pointless to keep around the SELinux
permissions.

Retain execmod support for apps targeting API 25 or lower. While in
theory we could remove support for API 23-25, that would involve the
introduction of a new SELinux domain (and the associated rule
explosion), which I would prefer to avoid.

This change helps protect application executable code from modification,
enforcing W^X properties on executable code pages loaded from files.
https://en.wikipedia.org/wiki/W%5EX

Test: auditallow rules were added and nothing triggered for apps
      targeting API >= 26. Code compiles and device boots.
Bug: 111544476

Change-Id: Iab9a0bd297411e99699e3651c110e57eb02a3a41
2018-08-08 01:39:09 +00:00
Gao Xiang
f9fc873e5c Merge "fs_use: Enabled loading security xattrs for erofs" am: 0860253239
am: be23064cb5

Change-Id: Ib7331ac2aa43dac03bccc129747fdc41c4126744
2018-08-07 11:13:52 -07:00
Tom Cherry
9be120a935 Merge "Second stage init is on system" am: 07dfaec076
am: 6c53b7b265

Change-Id: Ia6bb04b962bb1301f70e83f9141ddecda2ce3803
2018-08-07 11:09:03 -07:00
Gao Xiang
be23064cb5 Merge "fs_use: Enabled loading security xattrs for erofs"
am: 0860253239

Change-Id: Ic7547db41d7269a8961423cd61ed27d3a8c6d6ad
2018-08-07 10:54:04 -07:00
Tom Cherry
6c53b7b265 Merge "Second stage init is on system"
am: 07dfaec076

Change-Id: I0fdcb2ea509b8de1133fce686034713f009c68e7
2018-08-07 10:48:16 -07:00
Nick Kralevich
d90d001a78 Revert "Remove legacy execmod access."
This reverts commit 0f11ffccf9.

Reason for revert: libmono crashes

Bug: 112292089
Bug: 111544476
Test: policy compiles, device boots
Change-Id: I064090aa9337cf17b80cd2c9af9342df851a3b27
2018-08-07 17:03:07 +00:00
Xin Li
c05fa1a5cf Merge Android Pie into master
Bug: 112104996
Change-Id: Icf411d8b04e12dd33dd82a26328b4156585cb5ff
2018-08-07 09:46:55 -07:00
Treehugger Robot
0860253239 Merge "fs_use: Enabled loading security xattrs for erofs" 2018-08-07 16:09:53 +00:00
Tom Cherry
07dfaec076 Merge "Second stage init is on system" 2018-08-07 16:08:55 +00:00
Gao Xiang
910cd95354 fs_use: Enabled loading security xattrs for erofs
Bug: 112292714
Change-Id: I0026c13fd4335e0365496bc00c26021d83f3c39d
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
2018-08-07 22:13:12 +08:00
Nick Kralevich
25f763e374 auditallow app_data_file execute am: 4738b93db2
am: ca8749a0b3

Change-Id: Icbde5e0e612e6fe08e17f91713518bb7e724f2b3
2018-08-06 19:19:56 -07:00
Nick Kralevich
ca8749a0b3 auditallow app_data_file execute
am: 4738b93db2

Change-Id: I4278bd3d4e7786be716324d1817a81b6c19eec2e
2018-08-06 18:59:55 -07:00
Nick Kralevich
7ebdfb4b0a Delete untrusted_v2_app am: 41b21ee96a
am: fed2c09cfa

Change-Id: Iba40417ab69a16765eb2c9c13f4b1bcab1b151a3
2018-08-06 16:10:24 -07:00
Nick Kralevich
fed2c09cfa Delete untrusted_v2_app
am: 41b21ee96a

Change-Id: I85087c37b7c575e9b50d7090d155281d4f7c4f74
2018-08-06 15:35:16 -07:00
Nick Kralevich
4738b93db2 auditallow app_data_file execute
Executing files from an application home directory violates
W^X (https://en.wikipedia.org/wiki/W%5EX) constraints (loading executable code
from a writable file) and is an unsafe application behavior. Test to see if we
can get rid of it and establish some baseline metrics.

Test: device boots and no obvious problems.
Change-Id: I756c281fcbf750821307327642cc0d06605951b0
2018-08-06 14:49:45 -07:00
Nick Kralevich
41b21ee96a Delete untrusted_v2_app
As of https://android-review.googlesource.com/c/platform/system/sepolicy/+/536356 ,
the untrusted_v2_app domain is no longer used.

Bug: 112233317
Test: policy compiles, device boots, and no problems
Change-Id: I5a47c8305bef374b7fea06cd789e06cd48b847e6
2018-08-06 12:52:37 -07:00
Nick Kralevich
5bac67659b resolve merge conflicts of 601b4422ae to stage-aosp-master
am: bd39081ea3

Change-Id: I717b52703549574a383f17131512a9eda930c576
2018-08-03 18:52:59 -07:00
Nick Kralevich
bd39081ea3 resolve merge conflicts of 601b4422ae to stage-aosp-master
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ic6dd370d6549c9dd1eb1e690c1c2f2fa441624b9
2018-08-03 17:37:32 -07:00
Treehugger Robot
601b4422ae Merge "Change priv-apps /home/home labels to privapp_data_file" 2018-08-04 00:07:44 +00:00
Tom Cherry
99d9c6b6d6 Allow init to execute services marked with seclabel u:r:su:s0 in userdebug/eng am: 938ab05d72
am: 5f49b6a2d6

Change-Id: Ie160e10f709b513e4885c0a28ec7655598e74dd3
2018-08-03 16:33:51 -07:00
Tom Cherry
5f49b6a2d6 Allow init to execute services marked with seclabel u:r:su:s0 in userdebug/eng
am: 938ab05d72

Change-Id: If632608a9e7acc6e59b468674207bc80a4833a26
2018-08-03 16:07:11 -07:00
Tom Cherry
2faf4854d6 Second stage init is on system
Test: boot hikey
Change-Id: I8f26f858af8ccde1d7f4b346966bbb6bbeab5a92
2018-08-03 22:45:01 +00:00
Nick Kralevich
4df57822fc Change priv-apps /home/home labels to privapp_data_file
Currently, both untrusted apps and priv-apps use the SELinux file label
"app_data_file" for files in their /data/data directory. This is
problematic, as we really want different rules for such files. For
example, we may want to allow untrusted apps to load executable code
from priv-app directories, but disallow untrusted apps from loading
executable code from their own home directories.

Commit 23c9d91b46 introduced a new type
called privapp_data_file and added rules necessary to preserve
compatibility. However, that change did not relabel any existing files,
so effectively the change was a no-op.

This change performs the switch, relabeling priv-app's /data/data files
from app_data_file to privapp_data_file. Due to the compatibility rules
added in 23c9d91b46, there should be no
noticeable effect from this change.

Test: Factory reset and boot - no problems on fresh install.
Test: Upgrade to new version and test. No compatibility problems on
      filesystem upgrade.

Merged-In: I9a476726bf01f4bcc7952d11fd57dba803a9fd8d
Change-Id: I23a26cd3906fc43cbd225c05c3a2abd3cab8bd06
2018-08-03 13:50:21 -07:00
Tom Cherry
0dd5121f0e Move watchdogd out of init and into its own domain am: d840374e65
am: 09386d41a8

Change-Id: I6185e0faa8caa78a11265e14335300e82dab1cea
2018-08-03 12:49:30 -07:00
Tom Cherry
938ab05d72 Allow init to execute services marked with seclabel u:r:su:s0 in userdebug/eng
This is do aid developers pushing debug services to not need to modify
the underlying SEPolicy

avc: denied { transition } for comm="init" path="/system/bin/awk"
dev="dm-0" ino=1934 scontext=u:r:init:s0 tcontext=u:r:su:s0
tclass=process
avc: denied { rlimitinh } for comm="awk" scontext=u:r:init:s0
tcontext=u:r:su:s0 tclass=process
avc: denied { siginh } for comm="awk" scontext=u:r:init:s0
tcontext=u:r:su:s0 tclass=process
avc: denied { noatsecure } for comm="awk" scontext=u:r:init:s0
tcontext=u:r:su:s0 tclass=process

Test: init can execute a system_file marked with seclabel u:r:su:s0
Change-Id: I85d9528341fe08dbb2fb9a91e34a41f41aa093be
2018-08-03 19:41:03 +00:00
Tom Cherry
09386d41a8 Move watchdogd out of init and into its own domain
am: d840374e65

Change-Id: I93264ded0479ab0e101d0449c2ff52b9a92e3d6e
2018-08-03 12:39:53 -07:00
Tom Cherry
d840374e65 Move watchdogd out of init and into its own domain
Bug: 73660730
Test: watchdogd still runs
Change-Id: I31697c7c6fa2f7009731ff48c659af051838e42f
2018-08-03 19:28:05 +00:00
Nick Kralevich
7a04eff381 Start partitioning off privapp_data_file from app_data_file am: 23c9d91b46
am: 930614c7e6

Change-Id: Ib7c9743bf560a46fab22ae99f128bb0c5306b0c4
2018-08-02 21:32:01 -07:00
Nick Kralevich
930614c7e6 Start partitioning off privapp_data_file from app_data_file
am: 23c9d91b46

Change-Id: Id99688b1e9b4d8d43eb1833904ac47c2796166ab
2018-08-02 21:27:57 -07:00
Nick Kralevich
23c9d91b46 Start partitioning off privapp_data_file from app_data_file
Currently, both untrusted apps and priv-apps use the SELinux file label
"app_data_file" for files in their /data/data directory. This is
problematic, as we really want different rules for such files. For
example, we may want to allow untrusted apps to load executable code
from priv-app directories, but disallow untrusted apps from loading
executable code from their own home directories.

This change adds a new file type "privapp_data_file". For compatibility,
we adjust the policy to support access privapp_data_files almost
everywhere we were previously granting access to app_data_files
(adbd and run-as being exceptions). Additional future tightening is
possible here by removing some of these newly added rules.

This label will start getting used in a followup change to
system/sepolicy/private/seapp_contexts, similar to:

  -user=_app isPrivApp=true domain=priv_app type=app_data_file levelFrom=user
  +user=_app isPrivApp=true domain=priv_app type=privapp_data_file levelFrom=user

For now, this newly introduced label has no usage, so this change
is essentially a no-op.

Test: Factory reset and boot - no problems on fresh install.
Test: Upgrade to new version and test. No compatibility problems on
      filesystem upgrade.

Change-Id: I9618b7d91d1c2bcb5837cdabc949f0cf741a2837
2018-08-02 16:29:02 -07:00
Alan Stokes
7f8d117dbe Remove legacy execmod access. am: 0f11ffccf9
am: a8898820d6

Change-Id: I54a36a4d50c4ebf462176ef956ba4e19a5c95e8f
2018-08-02 07:03:17 -07:00
Alan Stokes
a8898820d6 Remove legacy execmod access.
am: 0f11ffccf9

Change-Id: I0f85ecb4a1dc6464becce64fb8539cd2f8e1a779
2018-08-02 06:59:12 -07:00
Alan Stokes
0f11ffccf9 Remove legacy execmod access.
Remove the exemptions for untrusted apps and broaden the neverallow so
they can't be reinstated. Modifying executable pages is unsafe. Text
relocations are not supported.

Bug: 111544476
Test: Builds.
Change-Id: Ibff4f34d916e000203e38574bb063513e4428bb7
2018-08-02 11:57:16 +01:00
Wale Ogunwale
cda347e8f3 Added sepolicy for uri_grants service am: 3280985971
am: c1ebd93528

Change-Id: Icd63d3c247a49ece8c514c3c1845b892f364e60f
2018-07-23 17:49:05 -07:00
Wale Ogunwale
c1ebd93528 Added sepolicy for uri_grants service
am: 3280985971

Change-Id: I17244cba89aa30d1fa560648f618e21d320ed87c
2018-07-23 17:36:57 -07:00
Wale Ogunwale
3280985971 Added sepolicy for uri_grants service
Bug: 80414790
Test: boots
Change-Id: I15233721fa138e0fdf1a30f66d52b64cbab18b81
2018-07-23 15:31:40 -07:00
Xin Li
57e1dba0fd Merge pi-dev-plus-aosp-without-vendor into stage-dr1-aosp-master
Bug: 111615259
Change-Id: If6887f7ee3af14ebb25440db9b654e9ff374bb23
2018-07-22 22:10:28 -07:00
Tri Vo
dc51b2bf21 28 mapping workaround for devices upgrading to P. am: 0cc68ea0b2
am: f832f2149d

Change-Id: Ic3f1a7f904f69b954a0f63187e02dfa433fe5e9e
2018-07-22 19:31:40 -07:00
Tri Vo
f832f2149d 28 mapping workaround for devices upgrading to P.
am: 0cc68ea0b2

Change-Id: Ie3d39420403eaba08ccfd2c3f3fb42a9594f07e6
2018-07-22 19:27:05 -07:00
Tri Vo
0cc68ea0b2 28 mapping workaround for devices upgrading to P.
Bug: 72458734
Test: Compile current system sepolicy with P vendor sepolicy
Test: Plug in a P device then do:
m selinux_policy
cp $OUT/system/etc/selinux/plat_sepolicy.cil  plat_sepolicy.cil
cp $ANDROID_BUILD_TOP/system/sepolicy/private/compat/28.0/28.0.cil 28.0.cil
adb pull /vendor/etc/selinux/plat_pub_versioned.cil
adb pull /vendor/etc/selinux/vendor_sepolicy.cil
secilc plat_sepolicy.cil -m -M true -G -N -c 30 28.0.cil \
plat_pub_versioned.cil vendor_sepolicy.cil
Change-Id: I399b3a204eb94bee0ba1b5024b1c3463219c678e
2018-07-20 15:19:36 -07:00
Alan Stokes
ac0bfccb2a Merge "Re-order rules to match AOSP." into stage-aosp-master am: 95b223b46f
am: 14c5117b65

Change-Id: Ifd915ad3b6864e037b5ab559d9bf3f0e71fa0fb0
2018-07-20 07:49:06 -07:00
Alan Stokes
14c5117b65 Merge "Re-order rules to match AOSP." into stage-aosp-master
am: 95b223b46f

Change-Id: I475cb1de1a9d953a23121b0366f734f1839fbab0
2018-07-20 07:45:32 -07:00
Alan Stokes
95b223b46f Merge "Re-order rules to match AOSP." into stage-aosp-master 2018-07-20 14:37:53 +00:00
Alan Stokes
7b377b1f59 Temporarily add auditing of execmod by apps. am: 708aa90dd2 am: a55f637a3d
am: 9563a64d93

Change-Id: Ied75b1303d2ad7061fb74f5185946cdbe7a2386e
2018-07-20 07:00:08 -07:00
Alan Stokes
9563a64d93 Temporarily add auditing of execmod by apps. am: 708aa90dd2
am: a55f637a3d

Change-Id: I7a7d2f284caaf264c6c74e9d8c8046ce9559789d
2018-07-20 06:56:44 -07:00
Alan Stokes
a55f637a3d Temporarily add auditing of execmod by apps.
am: 708aa90dd2

Change-Id: I4a0fdea7adead3baceb089644ed37a0c479d2e62
2018-07-20 06:52:41 -07:00
Alan Stokes
c2aad29d05 Re-order rules to match AOSP.
This is to avoid merge problems if we make any further changes in AOSP.

Test: Builds.
Change-Id: Ib4193d31c02dda300513f82f6c7426a2e81d8111
2018-07-20 13:32:30 +00:00
Alan Stokes
708aa90dd2 Temporarily add auditing of execmod by apps.
This is so we can get data on which apps are actually doing this.

Bug: 111544476
Test: Device boots. No audits seen on test device.
Change-Id: I5f72200ed8606775904d353c4d3d790373fe7dea
2018-07-20 12:40:29 +01:00
TreeHugger Robot
f7288e703c Merge "Merge pi-dev-plus-aosp-without-vendor into stage-dr1-aosp-master" into stage-dr1-aosp-master 2018-07-20 06:03:49 +00:00
Tri Vo
eee30d0d01 Merge "Add mapping files for 28.0.[ignore.]cil" am: 13e60ed1fa am: 6c32e0624f
am: a7bec59eaf

Change-Id: Iae7ec677989153c98e797471aca4cd61d4535618
2018-07-19 18:11:27 -07:00
Tri Vo
6c32e0624f Merge "Add mapping files for 28.0.[ignore.]cil"
am: 13e60ed1fa

Change-Id: I5b19874975830ddcb2765851544eebc9848d3df4
2018-07-19 18:03:05 -07:00
Xin Li
5818c714cd Merge pi-dev-plus-aosp-without-vendor into stage-dr1-aosp-master
Bug: 111615259
Change-Id: Ibfeb032b9e24541dcb3885cd15e31ca5ae3728e9
2018-07-19 13:50:39 -07:00
Jae Shin
1fa9634896 Add mapping files for 28.0.[ignore.]cil
Steps taken to produce the mapping files:

1. Add prebuilts/api/28.0/[plat_pub_versioned.cil|vendor_sepolicy.cil]
from the /vendor/etc/selinux/[plat_pub_versioned.cil|vendor_sepolicy.cil]
files built on pi-dev with lunch target aosp_arm64-eng

2. Add new file private/compat/28.0/28.0.cil by doing the following:
- copy /system/etc/selinux/mapping/28.0.cil from pi-dev aosp_arm64-eng
device to private/compat/28.0/28.0.cil
- remove all attribute declaration statement (typeattribute ...) and
sort lines alphabetically
- some selinux types were added/renamed/deleted w.r.t 28 sepolicy.
Find all such types using treble_sepolicy_tests_28.0 test.
- for all these types figure out where to map them by looking at
27.0.[ignore.]cil files and add approprite entries to 28.0.[ignore.]cil.

This change also enables treble_sepolicy_tests_28.0 and install 28.0.cil
mapping onto the device.

Bug: 72458734
Test: m selinux_policy
Change-Id: I90e17c0b43af436da4b62c16179c198b5c74002c
2018-07-18 20:08:38 -07:00
Todd Poynor
c3e9ff90d3 remove thermalcallback_hwservice
This hwservice isn't registered with hwservicemanager but rather passed
to the thermal hal, so it doesn't need sepolicy associated with it to
do so.

Test: manual: boot, inspect logs
Test: VtsHalThermalV1_1TargetTest
Bug: 109802374
Change-Id: Ifb727572bf8eebddc58deba6c0ce513008e01861
Merged-In: Ifb727572bf8eebddc58deba6c0ce513008e01861
(cherry picked from commit c6afcb7fc0)
2018-07-18 16:18:50 -07:00
Todd Poynor
d1ff81c2a7 reorder api 27 compat entries for removed types to match AOSP
Avoids subsequent merge conflicts in this section of the file.

Test: manual: compile
Change-Id: I9af723dccff54039031dc4d8f3e5ee34be5960d1
Merged-In: I9af723dccff54039031dc4d8f3e5ee34be5960d1
(cherry picked from commit 6682530515)
2018-07-18 16:17:40 -07:00
Steven Thomas
f7d5d2d936 Merge "Selinux changes for vr flinger vsync service" am: 663a827b47
am: 4b3ec1984e

Change-Id: Ib6786e4c5a7cf3713d8cc4b3fb0ce013831e74d1
2018-07-17 16:26:06 -07:00
Steven Thomas
4b3ec1984e Merge "Selinux changes for vr flinger vsync service"
am: 663a827b47

Change-Id: Icc345eda8c645065cc30f14fe4d3de07ba888c25
2018-07-17 16:21:34 -07:00
Treehugger Robot
663a827b47 Merge "Selinux changes for vr flinger vsync service" 2018-07-17 23:15:13 +00:00
Josh Gao
dc86cc0da9 system_server: allow appending to debuggerd -j pipe. am: 5ca755e05e
am: 98545f075c

Change-Id: Ie60925c143519732d737fd82948aab7a88b050df
2018-07-17 15:29:40 -07:00
Josh Gao
98545f075c system_server: allow appending to debuggerd -j pipe.
am: 5ca755e05e

Change-Id: I92b326f5f1c9f1db083c329ecc8eca952039dc06
2018-07-17 15:25:36 -07:00
Yifan Hong
bf7bf3ba0e perfprofd: talk to health HAL.
am: 65c568d0dd

Change-Id: I67a358cb33f9ba546ab3b42f58d48c1c0a5c763e
2018-07-17 13:24:23 -07:00
Josh Gao
5ca755e05e system_server: allow appending to debuggerd -j pipe.
Test: debuggerd -j `pidof system_server`
Change-Id: I6cca98b20ab5a135305b91cbb7c0fe7b57872bd3
2018-07-17 12:46:01 -07:00
Yifan Hong
65c568d0dd perfprofd: talk to health HAL.
Test: perfprofd tests
Bug: 110890430
Change-Id: I0f7476d76b8d35b6b48fe6b77544ca8ccc71534d
2018-07-17 11:37:26 -07:00
Jeff Vander Stoep
3d4d8899d1 crash_dump: disallow ptrace of TCB components
am: 573d333589

Change-Id: I5d0bd81b6b486a6a5cffd8159d99cfcdcf0f464f
2018-07-13 21:35:08 -07:00
Steven Thomas
7bec967402 Selinux changes for vr flinger vsync service
Add selinux policy for the new Binder-based vr flinger vsync service.

Bug: 72890037

Test: - Manually confirmed that I can't bind to the new vsync service
from a normal Android application, and system processes (other than
vr_hwc) are prevented from connecting by selinux.

- Confirmed the CTS test
  android.security.cts.SELinuxHostTest#testAospServiceContexts, when
  built from the local source tree with this CL applied, passes.

- Confirmed the CTS test
  android.cts.security.SELinuxNeverallowRulesTest#testNeverallowRules521,
  when built from the local source tree with this CL applied, passes.

Change-Id: Ib7a6bfcb1c2ebe1051f3accc18b481be1b188b06
2018-07-13 17:17:01 -07:00
Jeff Vander Stoep
573d333589 crash_dump: disallow ptrace of TCB components
Remove permissions.

Bug: 110107376
Test: kill -6 <components excluded from ptrace>
Change-Id: If8b9c932af03a551e40e786d591544ecdd4e5c98
Merged-In: If8b9c932af03a551e40e786d591544ecdd4e5c98
(cherry picked from commit f1554f1588)
2018-07-12 11:33:30 -07:00
Florian Mayer
139bb3f279 Merge "Allow to read events/header_page with debugfs_tracing"
am: 7d7328b807

Change-Id: I6bd14e069dd07b81b6cf33cfe8dd22e641d8f1f9
2018-07-10 21:35:06 -07:00
Florian Mayer
a62ce04a8c Allow to read events/header_page with debugfs_tracing
Bug: 110900684
Change-Id: I9fd141e0d56d0135c563467b7ca2f08b6af6700b`
2018-07-03 09:36:42 +00:00
Bowgo Tsai
dc7e8d3de5 Merge "Sepolicy for rw mount point for product extensions."
am: 589dbe1429

Change-Id: Ife838a971f7145583d2d1444a2c366515060e5a4
2018-07-02 19:03:52 -07:00
Pawin Vongmasa
35f9e08bcd Merge "Allow surfaceflinger to call into mediacodec"
am: 48f1c4ce22

Change-Id: I9362732c00cf9daf4b68f30885664a000dd0f3b8
2018-07-02 19:03:07 -07:00
Treehugger Robot
589dbe1429 Merge "Sepolicy for rw mount point for product extensions." 2018-07-03 00:21:01 +00:00
Treehugger Robot
48f1c4ce22 Merge "Allow surfaceflinger to call into mediacodec" 2018-07-03 00:19:50 +00:00
Yabin Cui
ca685e9e91 Merge "Export more files in proc_perf."
am: 74f86551af

Change-Id: I16f29c89431a5ca4ac604869e21cd8312bd37f9e
2018-07-02 15:18:49 -07:00
Yabin Cui
74f86551af Merge "Export more files in proc_perf." 2018-07-02 22:12:03 +00:00
Yabin Cui
09464811ca Export more files in proc_perf.
Export /proc/sys/kernel/perf_cpu_time_max_percent and
/proc/sys/kernel/perf_event_mlock_kb in proc_perf. So
they can be read in shell and written by init.

This is needed by simpleperf to control cpu percent and
memory used for profiling.

Bug: 110706031
Test: build and boot hikey960 successfully.

Change-Id: I2a01f583508003ab73427bab30a7982a27dfa677
2018-07-02 11:39:40 -07:00
Pawin Vongmasa
ff2dccaf38 Allow surfaceflinger to call into mediacodec
Test: adb logcat | grep "Wrong interface type."

Bug: 77924251
Change-Id: Idf9d7ae6db0d41bb0c2f94b2183bfe23f0c21155
2018-07-01 19:04:03 -07:00
Todd Poynor
c6afcb7fc0 remove thermalcallback_hwservice
This hwservice isn't registered with hwservicemanager but rather passed
to the thermal hal, so it doesn't need sepolicy associated with it to
do so.

Test: manual: boot, inspect logs
Test: VtsHalThermalV1_1TargetTest
Bug: 109802374
Change-Id: Ifb727572bf8eebddc58deba6c0ce513008e01861
Merged-In: Ifb727572bf8eebddc58deba6c0ce513008e01861
2018-06-29 23:01:43 +00:00
Jeff Vander Stoep
9256ec00b8 Merge "priv_app: dontaudit read access to default sysfs label"
am: 05fc3f2526

Change-Id: Iebf4303790c7b87cd9e82abf073c895f7b4fa38e
2018-06-29 14:41:05 -07:00
Treehugger Robot
05fc3f2526 Merge "priv_app: dontaudit read access to default sysfs label" 2018-06-29 20:43:53 +00:00
Jeff Vander Stoep
4894d9fde8 priv_app: dontaudit read access to default sysfs label
Suppress selinux logspam for non-API files in /sys.

Bug: 110914297
Test: build
Change-Id: I9b3bcf2dbf80f282ae5c74b61df360c85d02483c
2018-06-29 11:06:10 -07:00
John Reck
10caa0c412 Merge "Add record-tgid tracefs support"
am: d6c47bc1b5

Change-Id: I9f8f996c182701bb52cb60c8403c9e817f777691
2018-06-29 10:54:55 -07:00
Bowgo Tsai
c287032f61 Sepolicy for rw mount point for product extensions.
Bug: 110808288
Test: device boots with /mnt/product present and selinux label
      mnt_product_file applied correctly.

Change-Id: I596e4b79285fe1a79d31ad1b07f4bcffe6a6cd98
2018-06-29 22:54:42 +08:00
John Reck
f6a375039f Add record-tgid tracefs support
Bug: 110757800
Test: none
Change-Id: I2627c43fc45a78c936fa4a7ca968c606c89b9728
2018-06-28 14:15:07 -07:00
Dmitry Shmidt
48bf5e998e Merge "btlinux: Move HAL definitions from system/bt"
am: 9214238418

Change-Id: Ib1a4c54dacb5e3999ffa130d170cdef04e383b57
2018-06-27 19:22:04 -07:00
Treehugger Robot
9214238418 Merge "btlinux: Move HAL definitions from system/bt" 2018-06-28 00:31:05 +00:00
Dmitry Shmidt
a0c3416b2a btlinux: Move HAL definitions from system/bt
Test: ls -laZ /vendor/bin/hw/android.hardware.bluetooth*
Change-Id: I394594ad041f87583ca6b5b44d836cfab5da8103
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Merged-In: I394594ad041f87583ca6b5b44d836cfab5da8103
2018-06-27 23:56:31 +00:00
Yi Jin
2f29d48e16 Merge "Allow incidentd to read kernel version"
am: 26d589a378

Change-Id: Icf8add102adce4f34f9800fdab872ad968989d49
2018-06-27 11:29:35 -07:00
Yi Jin
880de35b41 Allow incidentd to read kernel version
Bug: 110230810
Test: N/A
Change-Id: Ide135dd5a8da05f0ea639bf03ce9612862108225
2018-06-26 21:19:15 +00:00
Samuel Ha
eda0f3f372 Revert "Revert "Reduce the number of processes that can start adbd""
am: 22f98197b2

Change-Id: Ie2678a964788b3a064ec12b06cb7b129ccc9b4b5
2018-06-26 13:06:04 -07:00
Samuel Ha
22f98197b2 Revert "Revert "Reduce the number of processes that can start adbd""
This reverts commit b5dc6137ad.

Reason for revert: Reverted incorrect change

Change-Id: Ieafa3338e28ffeed40bcceb73486cffbfbd08b9d
2018-06-26 19:52:21 +00:00
Samuel Ha
d2bc137aed Revert "Reduce the number of processes that can start adbd"
am: b5dc6137ad

Change-Id: I27e69743664613630765598869203b71437182b2
2018-06-26 12:49:35 -07:00
Samuel Ha
b5dc6137ad Revert "Reduce the number of processes that can start adbd"
This reverts commit faebeacaa0.

Reason for revert: broke the build

Change-Id: I3d61ce011ad42c6ff0e9f122de3daa37e846407a
2018-06-26 19:36:38 +00:00
Luis Hector Chavez
72bebcec37 Reduce the number of processes that can start adbd
am: faebeacaa0

Change-Id: I263f10cc06e23a01f1928d3c8dae3ab4e6357788
2018-06-26 07:17:06 -07:00
Luis Hector Chavez
faebeacaa0 Reduce the number of processes that can start adbd
This change makes it such that only init can start adbd directly. It
also introduces new rules for ctl.{start,stop,restart} properties such
that only usbd and recovery (and su, since it's permissive) can directly
ask init to start adbd.

Bug: 64720460
Test: adbd still runs
Test: /data/nativetest64/adbd_test/adbd_test
Test: python system/core/adb/test_adb.py
Test: "USB debugging" in System Settings still start/stop adbd
Test: Recovery menu still make the device show as "recovery" in adb
      devices
Test: "Apply update from ADB" in recovery menu still works
Change-Id: Iafcda8aa44e85129afcc958036b472d856fa1192
2018-06-26 14:10:26 +00:00
Eino-Ville Talvala
67bd625c19 Make system property audio.camerasound.force a vendor-writable property,
am: 3ac71f8d82

Change-Id: Ia0db4d6a305d7f815f38a119475ebb346e873249
2018-06-25 22:00:50 -07:00
Eino-Ville Talvala
3ac71f8d82 Make system property audio.camerasound.force a vendor-writable property,
This property is read by the audio service in system server to toggle
camera shutter sound enforcement on a device-specific basis.

Test: Camera shutter sound enforcement works when audio.camerasound.force is set
Bug: 110126976
Change-Id: I2720d3c699c4712d1a328f59dde0b16bbf1016f3
2018-06-25 22:50:14 +00:00
Neil Fuller
43d2c3d0b5 Add label for time (zone) system properties
am: b794ad0f8d

Change-Id: I46c7aa4b511da69d7f852023cff23871b6c8468e
2018-06-25 13:31:29 -07:00
Eino-Ville Talvala
fef2be8130 Merge "Make system property audio.camerasound.force a vendor-writable property," into pi-dev 2018-06-25 17:39:17 +00:00
Neil Fuller
b794ad0f8d Add label for time (zone) system properties
This adds a label for system properties that will affect system-wide
time / time detection logic.

The first example will be something like:
persist.time.detection_impl_version

Bug: 78217059
Test: build
Change-Id: I46044f1e28170760001da9acf2496a1e3037e48a
2018-06-25 17:59:56 +01:00
Peiyong Lin
8942de0640 Merge "Allow SurfaceFlinger to use Power HAL."
am: 0474b119ca

Change-Id: Ie24f599f2d7e74aac38393c20762d16d6a48e355
2018-06-22 13:45:56 -07:00
Peiyong Lin
a0b52c6fa5 Allow SurfaceFlinger to use Power HAL.
When we have wide color gamut content, SurfaceFlinger might want to send a
PowerHint through Power Hal to boost GPU to higher frequency, to make sure GPU
composition can finish in time.

BUG: 110112323
Test: adb shell cat /sys/class/kgsl/kgsl-3d0/devfreq/cur_freq
Change-Id: If60c13aedc4ff84eaefd3430794dc15a478c5a73
(cherry picked from commit 02be5975d6)
2018-06-22 13:31:56 -07:00
Treehugger Robot
0474b119ca Merge "Allow SurfaceFlinger to use Power HAL." 2018-06-22 20:24:26 +00:00
Jeff Vander Stoep
ed3f2dba34 Merge "Update socket ioctl restrictions"
am: 4b9a3128fd

Change-Id: I91b225a67ba9a63ac325882bdbb8ac78e487b323
2018-06-22 11:03:21 -07:00
Treehugger Robot
4b9a3128fd Merge "Update socket ioctl restrictions" 2018-06-22 17:55:32 +00:00
Peiyong Lin
02be5975d6 Allow SurfaceFlinger to use Power HAL.
When we have wide color gamut content, SurfaceFlinger might want to send a
PowerHint through Power Hal to boost GPU to higher frequency, to make sure GPU
composition can finish in time.

BUG: 110112323
Test: adb shell cat /sys/class/kgsl/kgsl-3d0/devfreq/cur_freq
Change-Id: If60c13aedc4ff84eaefd3430794dc15a478c5a73
2018-06-22 17:49:53 +00:00
Dario Freni
fc3dcaa992 Merge "Add a rule for /product-services partition."
am: 512e1c4d09

Change-Id: I452b2ac620461bc7d16dda8a0ec9855a8dbfd593
2018-06-22 02:18:05 -07:00
Dario Freni
512e1c4d09 Merge "Add a rule for /product-services partition." 2018-06-22 09:11:17 +00:00
Jeff Vander Stoep
0597ade15c Update socket ioctl restrictions
Grant access to icmp_socket to netdomain. This was previously
labeled as rawip_socket which apps are allowed to use. Neverallow
all other new socket types for apps.

Kernels versions > 4.9 redefine ICMP sockets from rawip_socket
to icmp_socket. To pass neverallow tests, we need to define
which IOCTLs are allowed (and disallowed).

Note that this does not change behavior on devices with
kernel versions <=4.9. However, it is necessary (although not
sufficient) to pass CTS on kernel version 4.14.

Bug: 110520616
Test: Grant icmp_socket in net.te and build.
Change-Id: I5c7cb6867d1a4cd1554a8da0d55daa8e06daf803
2018-06-22 05:35:07 +00:00
Neil Fuller
f351f7c662 Merge "Remove unnecessary permission"
am: 981aac14a3

Change-Id: I0d15f9bb47e3c77256f8c904662bedccd55333f3
2018-06-21 13:33:04 -07:00
Treehugger Robot
981aac14a3 Merge "Remove unnecessary permission" 2018-06-21 20:26:02 +00:00
Eino-Ville Talvala
d375e733fe Make system property audio.camerasound.force a vendor-writable property,
This property is read by the audio service in system server to toggle camera shutter sound
enforcement on a device-specific basis.

Test: Camera shutter sound enforcement works when audio.camerasound.force is set
Bug: 110126976
Change-Id: I2720d3c699c4712d1a328f59dde0b16bbf1016f3
2018-06-21 13:12:48 -07:00
Dario Freni
53a0763703 Add a rule for /product-services partition.
Like /system and /product, /product-services will contain apps that
should have the same privileges as the one in other system partitions.

Bug: 80741439
Test: successfully tested e2e on two devices, one with
/product-services partition and another with /product-services
symlinking to -> /system/product-services
Change-Id: Ieee7a9a7641a178f44bb406dbdef39ed46713899
2018-06-21 17:08:10 +01:00
Neil Fuller
52494addd2 sepolicy entries for time zone detector service
am: 1662495aec

Change-Id: Id2fbe9d5107acf7bb5c78b5349778bc26fdb7f50
2018-06-20 09:19:20 -07:00
Neil Fuller
1662495aec sepolicy entries for time zone detector service
Add sepolicy entries for the new time zone detector service.

The timezonedetector_service will be called from the
telephony process.

Bug: 78217059
Test: make / booted device
Change-Id: Ib719a4bb444b2af7dd71910fb0bd12992df9d88c
2018-06-19 21:13:57 +01:00
Neil Fuller
63c904601b Remove unnecessary permission
There will likely be no need for platform apps
to call the timedetector_service; it was added
in error.

Bug: 78217059
Test: build / boot
Change-Id: Ie299c92a60f26fe6cb00562219e386a9f13e459f
2018-06-19 12:58:09 +01:00
Mark Salyzyn
8bc025a5f7 Merge "access to /proc/slabinfo"
am: e0637cfc8e

Change-Id: Ie5f10c93d27607879db52177cd498eec0d61f782
2018-06-15 08:04:18 -07:00
Mark Salyzyn
d6eaed854d access to /proc/slabinfo
init, dumpstate and shell

Test: check avc for init is now gone
Bug: 7232205
Bug: 109821005
Change-Id: I299a0ba29bcc97a97047f12a5c48f6056f5e6de5
2018-06-14 10:18:45 -07:00
Jiyong Park
d147fd8170 adbd is allowed to execute shell in recovery mode
am: bacf36480d

Change-Id: If48e1b57f1ee20f10c5aac5af5ce52b6433a227a
2018-06-13 16:44:28 -07:00
Treehugger Robot
b6639b0f52 Merge changes from topic "sharedlib_in_recovery"
* changes:
  init is a dynamic executable
  adbd is allowed to execute shell in recovery mode
2018-06-13 23:14:29 +00:00
Mark Salyzyn
6b2715cc0d Merge "persist.sys.boot.reason is cleared once read by bootstat"
am: 752bde548f

Change-Id: Ifbd311d8425fcd9caffe61c41400fbbfedb356c7
2018-06-12 14:10:01 -07:00
Mark Salyzyn
a1bce77973 persist.sys.boot.reason is cleared once read by bootstat
To ensure a surprise reboot does not take the last boot reason on
face value especially if coming from more than one boot sessions ago.
We shift and clear the value from persist.sys.boot.reason to
sys.boot.reason.last and establish a correct last reboot reason in
the canonical sys.boot.reason property.  As a result, the power
manager should read the canonical sys.boot.reason for a definitive
result rather than relying on the possibly incorrect values in the
persistent storage.  sys.boot.reason should be a core property as
it represents the canonical boot reason API.

Test: compile
Bug: 86671991
Bug: 63736262
Change-Id: If3742c487d6c0ab69c464f056bf48c786b66a945
2018-06-11 09:30:25 -07:00
Jiyong Park
bacf36480d adbd is allowed to execute shell in recovery mode
The shell is now available directly in the recovery ramdisk. We no
longer need to mount system.img to /system as the recovery ramdisk is
self-contained. However, there is a problem that every file in the
ramdisk is labeled as rootfs because the ramdisk does not support xattr.

This CL adds several recovery-only rules that are required to make the
recovery ramdisk self-contained. Most importantly, adbd is allowed to
domain_trans to shell. Also shell is allowe to execute files of type
rootfs. Finally, the recovery is allowed to mount on tmpfs since it now
mounts system.img to /mnt/system.

Bug: 63673171
Test: `adb reboot recovery; adb devices` shows the device ID
Test: `adb root && adb shell` and then
$ lsof -p `pidof adbd` shows that libm.so, libc.so, etc. are loaded from
the /lib directory.

Change-Id: If21b069aee63541344a5ca8939fb9a46ffef4d3e
2018-06-09 02:23:10 +09:00
Neil Fuller
4a77ea5eb3 Merge "Remove references to common_time / commontime" am: 44b86a3e5e
am: 304857d8be

Change-Id: I9d93260c280e8981a051bc4651a4a4942288acfe
2018-06-07 13:18:23 -07:00
Neil Fuller
44b86a3e5e Merge "Remove references to common_time / commontime" 2018-06-07 15:50:06 +00:00
Jeff Vander Stoep
d1f07835a7 Merge "Deprivilege haiku" am: 59f8e75a5d
am: b204ad930c

Change-Id: I23dd498f88e5d4fbff520defeef5baf7329e9ea4
2018-06-06 13:15:09 -07:00
Treehugger Robot
59f8e75a5d Merge "Deprivilege haiku" 2018-06-06 17:18:07 +00:00
Neil Fuller
c9fa040d1c Remove references to common_time / commontime
This change removes references to the common time management
service.

Bug: 80462439
Test: build / boot
Merged-In: I2c8fca44fe05e3a35f5580d23e23a4c033075613
Change-Id: I2c8fca44fe05e3a35f5580d23e23a4c033075613
2018-06-06 17:02:44 +01:00
Wale Ogunwale
dcf42c11f4 Merge "Added sepolicy for activity_task service" am: 2b7fbbe917
am: 93c6a36b07

Change-Id: If0038600c1fe4c97f55b3a09038586546ab1647c
2018-06-05 09:17:45 -07:00
Treehugger Robot
2b7fbbe917 Merge "Added sepolicy for activity_task service" 2018-06-05 16:02:51 +00:00
Steven Moreland
68e58a474b Merge "Find hal_foo_hwservice -> you are hal_foo_client." am: 58f4c6f01b
am: 0b783e875a

Change-Id: I6d760e257df73b8bf065563c9a1949cd8edca54a
2018-06-05 08:33:57 -07:00
Steven Moreland
58f4c6f01b Merge "Find hal_foo_hwservice -> you are hal_foo_client." 2018-06-05 15:19:23 +00:00
Wale Ogunwale
0075655ac3 Added sepolicy for activity_task service
Bug: 80414790
Test: boots
Change-Id: I3d6bb4e7da9d697ec8ff7502880543be89aee349
2018-06-05 14:13:45 +00:00
Neil Fuller
a7d92c64d6 Merge "selinux changes to add time detector service" am: 93953d0be6
am: c45525f7e3

Change-Id: I889eb40edaf765cdd7a7555403070cca4d0e2dd5
2018-06-04 17:07:38 -07:00
Treehugger Robot
93953d0be6 Merge "selinux changes to add time detector service" 2018-06-04 21:23:23 +00:00
Neil Fuller
e1dd6d07b5 selinux changes to add time detector service
This commit contains the changes needed to add the new
time detector system server service.

Bug: 78217059
Test: make / booted device
Change-Id: I7cfaac6cac876e4aa73e8af1aa5f837117bb9ad7
2018-06-04 19:40:37 +01:00
Jeff Vander Stoep
f45db06c2b Deprivilege haiku
Clatd and zygote
are all overprivileged
as is storaged

Test: Verify no "granted" messages from dogfooders. Build flash
aosp_taimen-userdebug. Verify no denials.
Change-Id: I735adcffed553962ad12072716a7200883930dcf
2018-06-04 11:07:08 -07:00
Jeff Vander Stoep
a5dd47fab3 Suppress denials for apps accessing storage too early am: 9c7396d554
am: 7c9b0ecf35

Change-Id: I94f5da3d8fafbea7746336c7d0d0cb6c4eea28d0
2018-06-01 15:45:39 -07:00
Jeff Vander Stoep
9c7396d554 Suppress denials for apps accessing storage too early
The recommended solution is to not access encrypted storage until
after the ACTION_USER_UNLOCKED intent is delivered.

Test: build
Fixes: 72811052
Fixes: 72550646
Change-Id: I80eb743e26047b7864de983c5a46c28b6f753a59
2018-06-01 19:15:55 +00:00
Steven Moreland
8fc7981885 Find hal_foo_hwservice -> you are hal_foo_client.
Before, it was possible to access a hwservice without declaring
that you were a client.

This introduces the following macro:
hal_attribute_hwservice_client(hal_foo, hal_foo_hwservice)

which makes sure the above implication holds using a neverallow rule.

Bug: 80319537
Test: boot + sanity
Change-Id: Iededae68f14f0f3bd412c1205aa3b650a54d55c6
2018-05-30 16:46:57 -07:00
Steven Moreland
d0c4d4e7db mediacodec->mediacodec+hal_omx{,_server,_client} am: 7baf725ea6
am: 6ad7e65447

Change-Id: I9b60e71be957d43f66605958915d3cfb45d42573
2018-05-30 13:51:23 -07:00
Steven Moreland
7baf725ea6 mediacodec->mediacodec+hal_omx{,_server,_client}
(breaks vendor blobs, will have to be regenerated
after this CL)

This moves mediacodec to vendor so it is replaced with
hal_omx_server. The main benefit of this is that someone
can create their own implementation of mediacodec without
having to alter the one in the tree. mediacodec is still
seccomp enforced by CTS tests.

Fixes: 36375899
Test: (sanity) YouTube
Test: (sanity) camera pics + video
Test: check for denials
Change-Id: I31f91b7ad6cd0a891a1681ff3b9af82ab400ce5e
2018-05-30 18:12:32 +00:00
Jeff Vander Stoep
85f508b83b Merge "Improve tests protecting private app data" am: db459a1b71
am: c4b2a88b9b

Change-Id: I6a0a5b778c209401cae33af605e66ab12db03aef
2018-05-30 09:34:40 -07:00
Treehugger Robot
db459a1b71 Merge "Improve tests protecting private app data" 2018-05-30 16:20:31 +00:00
Jeff Vander Stoep
ab82125fc8 Improve tests protecting private app data
In particular, add assertions limiting which processes may
directly open files owned by apps. Reduce this to just apps, init,
and installd. App data is protected by a combination of selinux
permissions and Unix permissions, so limiting the open permission to
just apps (which are not allowed to have CAP_DAC_OVERRIDE or
CAP_DAC_READ_SEARCH) ensures that only installd and init have
complete access an app's private directory.

In addition to apps/init/installd, other processes currently granted
open are mediaserver, uncrypt, and vold. Uncrypt's access appears to
be deprecated (b/80299612). Uncrypt now uses /data/ota_package
instead. b/80418809 and b/80300620 track removal for vold and
mediaserver.

Test: build/boot aosp_taimen-userdebug. Verify no "granted" audit
messages in the logs.
Bug: 80190017
Bug: 80300620
Bug: 80418809
Fixes: 80299612
Change-Id: I153bc7b62294b36ccd596254a5976dd887fed046
2018-05-29 13:47:49 -07:00
Joel Galenson
24b6158118 Hide bpfloader sys_admin denials.
am: d65f26f1b0

Change-Id: I0435b600f5a163089650c02417646109a97e3e56
2018-05-23 14:28:48 -07:00
Joel Galenson
d65f26f1b0 Hide bpfloader sys_admin denials.
Bug: 79524845
Test: Boot device and see no denials.
Change-Id: I9316bfd0e3718818a7613a421aedff7da8c87108
2018-05-23 08:36:40 -07:00
Jordan Liu
7af4a1f110 Merge "Setup policy for downloaded apns directory" into pi-dev 2018-05-22 21:12:31 +00:00
Tom Cherry
7b8be35ddf Finer grained permissions for ctl. properties
Currently, permissions for ctl. property apply to each action verb, so
if a domain has permissions for controlling service 'foo', then it can
start, stop, and restart foo.

This change implements finer grainer permissions such that permission
can be given to strictly start a given service, but not stop or
restart it.  This new permission scheme is mandatory for the new
control functions, sigstop_on, sigstop_off, interface_start,
interface_stop, interface_restart.

Bug: 78511553
Test: see appropriate successes and failures based on permissions
Merged-In: Ibe0cc0d6028fb0ed7d6bcba626721e0d84cc20fa
Change-Id: Ibe0cc0d6028fb0ed7d6bcba626721e0d84cc20fa
(cherry picked from commit 2208f96e9e)
2018-05-22 13:47:16 -07:00
Tom Cherry
e21e9e6373 Merge "Finer grained permissions for ctl. properties" into pi-dev
am: 0e403c8242

Change-Id: I778a16ae2bcc5713ba3ca1c81fd90c97b0a5d64d
2018-05-22 13:26:42 -07:00
Tom Cherry
0e403c8242 Merge "Finer grained permissions for ctl. properties" into pi-dev 2018-05-22 20:15:07 +00:00
Tom Cherry
2208f96e9e Finer grained permissions for ctl. properties
Currently, permissions for ctl. property apply to each action verb, so
if a domain has permissions for controlling service 'foo', then it can
start, stop, and restart foo.

This change implements finer grainer permissions such that permission
can be given to strictly start a given service, but not stop or
restart it.  This new permission scheme is mandatory for the new
control functions, sigstop_on, sigstop_off, interface_start,
interface_stop, interface_restart.

Bug: 78511553
Test: see appropriate successes and failures based on permissions

Change-Id: Ibe0cc0d6028fb0ed7d6bcba626721e0d84cc20fa
2018-05-22 09:13:16 -07:00
Alan Stokes
c8711592ad Remove fixed bug from bug_map.
Bug: 77816522
Bug: 73947096

Test: Flashed device, no denial seen
Change-Id: Ib2f1fc670c9a76abbb9ff6747fec00fa5bcde5af
(cherry picked from commit 62913dbfd2)
2018-05-22 08:41:23 -07:00
Treehugger Robot
cfaaa9f42d Merge "Add sync and fence tracepoints to user-visible list of tracepoints." 2018-05-21 23:09:30 +00:00
Niklas Lindgren
780cd6df4b Setup policy for downloaded apns directory
apns downloaded will enter a new directory that
TelephonyProvider can access.

Bug: 79948106
Test: Manual
Change-Id: I1e7660adf020dc7052da94dfa03fd58d0386ac55
Merged-In: I1e7660adf020dc7052da94dfa03fd58d0386ac55
2018-05-21 15:58:16 -07:00
Jordan Liu
05497ede82 Merge "Setup policy for downloaded apns directory" am: fdb38fa6d0
am: a968e32d7c

Change-Id: Ia7aa0f73ef36ec9c8f992a8e1412585ab54a10be
2018-05-21 14:49:22 -07:00
Carmen Jackson
e22f04c975 Add sync and fence tracepoints to user-visible list of tracepoints.
The 'sync' tracepoint was updated to be 'fence' in kernel 4.9, so this
change also adds that one to the list.

Bug: 79935503
Test: Took a trace using 'sync' in user mode and saw the tracepoints
being saved.

Change-Id: I793c6f54cd9364f33853983f8c5dfb28b98c2708
Merged-In: I793c6f54cd9364f33853983f8c5dfb28b98c2708
2018-05-21 14:18:46 -07:00
Carmen Jackson
8640cffa1e Merge "Add sync and fence tracepoints to user-visible list of tracepoints." into pi-dev
am: 09648d9ae3

Change-Id: I1821400703aa5dc41a485d3430946345978045c0
2018-05-21 14:12:20 -07:00
TreeHugger Robot
09648d9ae3 Merge "Add sync and fence tracepoints to user-visible list of tracepoints." into pi-dev 2018-05-21 21:06:39 +00:00
Carmen Jackson
f47f0c3869 Add sync and fence tracepoints to user-visible list of tracepoints.
The 'sync' tracepoint was updated to be 'fence' in kernel 4.9, so this
change also adds that one to the list.

Bug: 79935503
Test: Took a trace using 'sync' in user mode and saw the tracepoints
being saved.

Change-Id: I793c6f54cd9364f33853983f8c5dfb28b98c2708
2018-05-21 12:18:18 -07:00
Jordan Liu
fdb38fa6d0 Merge "Setup policy for downloaded apns directory" 2018-05-21 19:06:54 +00:00
Paul Crowley
c9e9b326d0 Merge "Move more metadata policy from device to here" into pi-dev
am: 5252ad93e2

Change-Id: I591f253f82a91b1e953f46ff2c29e48e4929665b
2018-05-21 10:46:45 -07:00
Tri Vo
87cd58bb33 Merge "audioserver: add access to wake locks." am: 7710647a65
am: 68760afb6c

Change-Id: I7695e7d5f20eda1820ff31663f74c72613f62c82
2018-05-21 10:33:12 -07:00
Niklas Lindgren
f3626f3a86 Setup policy for downloaded apns directory
apns downloaded will enter a new directory that
TelephonyProvider can access.

Bug: 79948106
Test: Manual
Change-Id: I1e7660adf020dc7052da94dfa03fd58d0386ac55
2018-05-21 18:45:50 +02:00
Paul Crowley
bb3ba3e5d9 Move more metadata policy from device to here
Test: booted metadata-encrypted device
Bug: 79781913
Change-Id: Ib4cb4a04145e5619994083da055f06fe7ae0137a
2018-05-18 14:12:40 -07:00
Tri Vo
ef81102a1d audioserver: add access to wake locks.
Bug: n/a
Test: audioserver is sucessfully able to acquire a wake lock
Change-Id: Ic3d3692eba2c1641ba3c9d8dc5f000f89105d752
2018-05-17 17:27:56 -07:00
Treehugger Robot
4876409114 Merge "Allow system_server to adjust cpuset for media.codec" 2018-05-17 22:06:03 +00:00
Chong Zhang
bcb6cc20f4 Allow system_server to adjust cpuset for media.codec
Bug: 72841545
Change-Id: I30c1758e631a57f453598e60e6516da1874afcbf
(cherry picked from commit ec0160a891)
2018-05-17 10:09:57 -07:00
Jin Qian
e11d499475 storaged: add storaged_pri service
"storaged" service will be used by external clients, e.g. vold, dumpsys
"storaged_pri" service will only be used by storaged cmdline.

Bug: 63740245
Change-Id: I7a60eb4ce321aced9589bbb8474d2d9e75ab7042
(cherry picked from commit 37ab7c0917)
2018-05-17 10:02:08 -07:00
Treehugger Robot
5deb7f4e20 Merge "Allow dumpstate to kill dumpstate vendor HAL in timeout case" 2018-05-17 16:41:11 +00:00
Wei Wang
a1db36e1c0 Allow dumpstate to kill dumpstate vendor HAL in timeout case
Bug: 77489941
Test: simulate delay in dumpstate HAL and get BR, see below from dumpstate_log.txt
    dumpstateBoard timed out after 10s, killing dumpstate vendor HAL
    dumpstateBoard failed: Status(EX_TRANSACTION_FAILED): 'DEAD_OBJECT: '
Change-Id: I90ed5cb8fe8da8ad21ae77676433936cb12d9d04
(cherry picked from commit 60d1767459)
2018-05-16 15:19:36 -07:00
Jeff Vander Stoep
141b00fb1e Fix diff in cherry-pick
Changes 2d626fd84ea0246c963ce2c87ae62461a60f8826 and
869562e9e3 are the same
commit, but with a different comment. Fix them up to be
the same.

Test: build
Change-Id: I6311413357f457d6ba95886b729ffa53ab80e016
2018-05-16 14:38:51 -07:00
Andreas Huber
4d6a5e8700 Fingerprint data is now stored in one of two ways depending on the
shipping API version:

For devices shipped on O-MR1 nothing changes, data is stored
under /data/system/users/<user-id>/fpdata/...

Devices shipped from now on will instead store fingerprint data under
/data/vendor_de/<user-id>/fpdata.

Support for /data/vendor_de and /data/vendor_ce has been added to vold.

Bug: 36997597
Change-Id: Ibc7cc33b756f64abe68a749c0ada0ca4f6d92514
Merged-In: Ibc7cc33b756f64abe68a749c0ada0ca4f6d92514
Test: manually
(cherry picked from commit 6116daa71a)
2018-05-16 14:22:14 -07:00
Jerry Zhang
6002126f88 Merge "Allow mediaprovider to search /mnt/media_rw" into pi-dev 2018-05-15 21:35:43 +00:00
Jerry Zhang
31c4b4eabf Allow mediaprovider to search /mnt/media_rw
Mtp needs access to this path in order to
change files on an sdcard.

Fixes denial:

05-14 17:40:58.803  3004  3004 W MtpServer: type=1400 audit(0.0:46):
avc: denied { search } for name="media_rw" dev="tmpfs" ino=10113
scontext=u:r:mediaprovider:s0:c512,c768
tcontext=u:object_r:mnt_media_rw_file:s0 tclass=dir permissive=0
b/77925342 app=com.android.providers.media

Bug: 77849654
Test: no denials using mtp with emulated sdcard
Change-Id: I27b5294fa211bb1eff6d011638b5fdc90334bc80
2018-05-15 11:46:52 -07:00
Jerry Zhang
fd65900541 Merge "Allow mediaprovider to search /mnt/media_rw" am: b0e87e61ce
am: 349ce7d88d

Change-Id: Id981ce476e7346343a6ff7f49ccbb96c059536b5
2018-05-15 11:36:59 -07:00
Jerry Zhang
b0e87e61ce Merge "Allow mediaprovider to search /mnt/media_rw" 2018-05-15 18:13:25 +00:00
Steven Moreland
db632b65f5 Allow dumpstate to be used as a lazy HAL.
hwservicemanager lost the permission to tell init to
start the dumpstate HAL when dumpstate was given this
permission exclusively.

Bug: 77489941 # problem introduced
Bug: 78509314 # converting dumpstate to lazy hals

Test: convert an instance of dumpstate into a lazy HAL,
    run bugreport, see denial, then add permission, and
    see bugreport start to work again.

Change-Id: I033701d8306200bebc0f250afe3d08f9e6ab98a1
(cherry picked from commit 0b1797b852)
Merged-In: I033701d8306200bebc0f250afe3d08f9e6ab98a1
2018-05-15 08:01:56 -07:00
Andreas Gampe
a94441b4d0 Merge "Sepolicy: Fix perfprofd permissions" am: bdac534cc0
am: 09fd609d33

Change-Id: Id7ba0fb239c2f902682976cb65986961f2edcaab
2018-05-14 16:01:17 -07:00
Treehugger Robot
bdac534cc0 Merge "Sepolicy: Fix perfprofd permissions" 2018-05-14 22:49:10 +00:00
Jerry Zhang
ddb89ab785 Allow mediaprovider to search /mnt/media_rw
Mtp needs access to this path in order to
change files on an sdcard.

Fixes denial:

05-14 17:40:58.803  3004  3004 W MtpServer: type=1400 audit(0.0:46):
avc: denied { search } for name="media_rw" dev="tmpfs" ino=10113
scontext=u:r:mediaprovider:s0:c512,c768
tcontext=u:object_r:mnt_media_rw_file:s0 tclass=dir permissive=0
b/77925342 app=com.android.providers.media

Bug: 77849654
Test: no denials using mtp with emulated sdcard
Change-Id: I27b5294fa211bb1eff6d011638b5fdc90334bc80
2018-05-14 12:37:11 -07:00
TreeHugger Robot
ce52208134 Merge "Track cppreopts SELinux denial." into pi-dev 2018-05-14 19:23:42 +00:00
Mark Salyzyn
2cdcdc6ec0 Merge "FrameworksServicesTests: allow access to test.sys.boot.reason property" into pi-dev 2018-05-10 23:06:17 +00:00
Mark Salyzyn
a60f4103ca llkd: add live-lock daemon am: e4b3e0b684
am: 2ab619226d

Change-Id: I3d441fd18d91680d8a5bf0732472c2f470076e02
2018-05-10 15:20:34 -07:00
Andreas Gampe
835881aaa4 Sepolicy: Fix perfprofd permissions
Let statsd find the service. The system server wants to read file
attributes for the perfprofd dropbox file.

Bug: 73175642
Test: m
Test: manual
Change-Id: I0c0b1dac057af90fff440286226093ec15b5e247
2018-05-10 15:07:09 -07:00
Mark Salyzyn
e4b3e0b684 llkd: add live-lock daemon
Introduce a standalone live-lock daemon (llkd), to catch kernel
or native user space deadlocks and take mitigating actions.

Test: llkd_unit_test
Bug: 33808187
Bug: 72838192
Change-Id: If869ecd06e5ce7b04bba1dafd0a77971b71aa517
2018-05-10 17:19:16 +00:00
Paul Crowley
11bfc05ced Merge "Add wait_for_keymaster" 2018-05-10 16:54:46 +00:00
Chris Fries
e22af8e711 Merge "Add wait_for_keymaster" into pi-dev
am: bb5b0a1e8f

Change-Id: I83e1b39cfe8db206af0e3752d8c56e98933d2da9
2018-05-09 23:55:36 -07:00
Chris Fries
bb5b0a1e8f Merge "Add wait_for_keymaster" into pi-dev 2018-05-10 06:49:59 +00:00
Calin Juravle
91989fcea5 Merge "Allow system server to write profile snapshots in /data/misc/profman" into pi-dev
am: dfaf39154f

Change-Id: I6f12c21a6c1cfda7d4a3b556e7f6066d0c2782c0
2018-05-09 14:49:25 -07:00
Calin Juravle
6ff0f490db Allow system server to write profile snapshots in /data/misc/profman
The goal is to allow creating profile snapshots from the shell command in
order to be able to write CTS tests.

The system server will dump profiles for debuggable in /data/misc/profman
from where they will be pulled and verified by CTS tests.

Test: adb shell cmd package snapshot-profile com.android.vending
Bug: 74081010

(cherry picked from commit 687d5e46ce)

Merged-In: I54690305284b92c0e759538303cb98c93ce92dd5
Change-Id: I54690305284b92c0e759538303cb98c93ce92dd5
2018-05-09 14:42:59 -07:00
Calin Juravle
dfaf39154f Merge "Allow system server to write profile snapshots in /data/misc/profman" into pi-dev 2018-05-09 21:35:08 +00:00
Paul Crowley
9f760306ae Add wait_for_keymaster
Bug: 79228237
Test: audit2allow finds no relevant denials on boot
Merged-In: Ia80b77ba9a1ec2354127cd0ef68d50ebcf593fb0
Change-Id: Ia80b77ba9a1ec2354127cd0ef68d50ebcf593fb0
2018-05-09 13:41:37 -07:00
Paul Crowley
6af7af151b Add wait_for_keymaster
Bug: 79228237
Test: audit2allow finds no relevant denials on boot
Change-Id: Ia80b77ba9a1ec2354127cd0ef68d50ebcf593fb0
2018-05-09 12:57:52 -07:00
Calin Juravle
687d5e46ce Allow system server to write profile snapshots in /data/misc/profman
The goal is to allow creating profile snapshots from the shell command in
order to be able to write CTS tests.

The system server will dump profiles for debuggable in /data/misc/profman
from where they will be pulled and verified by CTS tests.

Test: adb shell cmd package snapshot-profile com.android.vending
Bug: 74081010
Change-Id: I54690305284b92c0e759538303cb98c93ce92dd5
2018-05-09 11:41:39 -07:00
Mark Salyzyn
1b748766e3 FrameworksServicesTests: allow access to test.sys.boot.reason property
com.android.server.power.PowerManagerServiceTest#testGetLastShutdownReasonInternal due to "RuntimeException: failed to set system property"

W/roidJUnitRunner: type=1400 audit(0.0:6): avc: denied { write } for name="property_service" dev="tmpfs" ino=13178 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
W/libc    : Unable to set property "test.sys.boot.reason" to "shutdown,thermal": connection failed; errno=13 (Permission denied)

Had to use precise property definition as com.android.phone accesses
test properties as well.

Test: compile
Bug: 78245377
Change-Id: I2cc810846f8615f2a2fae8e0d4f41de585b7abd7
2018-05-09 11:01:39 -07:00
Joel Galenson
8e6b2d551c Track cppreopts SELinux denial.
This should help fix presubmit tests.

Bug: 79414024
Test: Built policy.
Change-Id: Ic840150767ff6c2799ac3b5ef22ba139108c94dd
(cherry picked from commit 06e09abd25)
2018-05-09 10:36:00 -07:00
Joel Galenson
43a4210e40 Track cppreopts SELinux denial. am: 06e09abd25
am: f9fa0d6dba

Change-Id: I1ddd845aeb7c9d80dd1322c6c13c75b4149a68c1
2018-05-08 10:42:01 -07:00
Joel Galenson
06e09abd25 Track cppreopts SELinux denial.
This should help fix presubmit tests.

Bug: 79414024
Test: Built policy.
Change-Id: Ic840150767ff6c2799ac3b5ef22ba139108c94dd
2018-05-08 08:43:07 -07:00
Ray Essick
b85e382f50 give audioserver access to media.metrics
Let the audioserver record metrics with media.metrics service.
This is for 'audiopolicy' metrics.

Bug: 78595399
Test: record from different apps, see records in 'dumpsys media.metrics'
Change-Id: Ie5c403d0e5ac8c6d614db5e7b700611ddd6d07e9
Merged-In: I63f9d4ad2d2b08eb98a49b8de5f86b6797ba2995
2018-05-07 13:30:53 -07:00
Ray Essick
7856fcd529 give audioserver access to media.metrics
am: 2306cc040a

Change-Id: I3fdf2b2b67b22a0db92e0356e39c373ceccbae50
2018-05-07 11:14:29 -07:00
Ray Essick
2306cc040a give audioserver access to media.metrics
Let the audioserver record metrics with media.metrics service.
This is for 'audiopolicy' metrics.

Bug: 78595399
Test: record from different apps, see records in 'dumpsys media.metrics'
Change-Id: I63f9d4ad2d2b08eb98a49b8de5f86b6797ba2995
2018-05-07 16:31:44 +00:00
Jeff Vander Stoep
1279a7ae85 resolve merge conflicts of bc34fa26ac to pi-dev-plus-aosp
Bug: None
Test: None
Change-Id: Ie9d2f35efd5bf39d0282ccc41fdd3f974d7c01bf
2018-05-04 19:03:03 -07:00
android-build-team Robot
7ea7f12d14 Merge "Allow system server to record its own profile" into pi-dev 2018-05-04 22:43:22 +00:00
Pavel Maltsev
43e172af66 Move automotive HALs sepolicy to system/
Bug: 70637118
Test: build, flash and boot automotive builds

Change-Id: I6db23258de30174d6db09d241e91b08aa5afedef
Merged-In: I6db23258de30174d6db09d241e91b08aa5afedef
(cherry picked from commit 394dbe34a0)
2018-05-04 21:36:48 +00:00
Pawin Vongmasa
19a74ec88a Put in sepolicies for Codec2.0 services
Test: Builds

Bug: 64121714
Bug: 31973802
Change-Id: Id37be8726a8bb297e35bca494964fdbcc48c6a73
(cherry picked from commit 4be2889477)
2018-05-04 21:36:41 +00:00
Jeff Vander Stoep
7a4af30b38 Start the process of locking down proc/net
Files in /proc/net leak information. This change is the first step in
determining which files apps may use, whitelisting benign access, and
otherwise removing access while providing safe alternative APIs.

To that end, this change:
* Introduces the proc_net_type attribute which will assigned to any
new SELinux types in /proc/net to avoid removing access to privileged
processes. These processes may be evaluated later, but are lower
priority than apps.
* Labels /proc/net/{tcp,tcp6,udp,udp6} as proc_net_vpn due to existing
use by VPN apps. This may be replaced by an alternative API.
* Audits all other proc/net access for apps.
* Audits proc/net access for other processes which are currently
granted broad read access to /proc/net but should not be including
storaged, zygote, clatd, logd, preopt2cachename and vold.

Bug: 9496886
Bug: 68016944
Test: Boot Taimen-userdebug. On both wifi and cellular: stream youtube
    navigate maps, send text message, make voice call, make video call.
    Verify no avc "granted" messages in the logs.
Test: A few VPN apps including "VPN Monster", "Turbo VPN", and
"Freighter". Verify no logspam with the current setup.
Test: atest CtsNativeNetTestCases
Test: atest netd_integration_test
Test: atest QtaguidPermissionTest
Test: atest FileSystemPermissionTest

Change-Id: I7e49f796a25cf68bc698c6c9206e24af3ae11457
Merged-In: I7e49f796a25cf68bc698c6c9206e24af3ae11457
(cherry picked from commit 087318957f)
2018-05-04 21:36:33 +00:00
Roshan Pius
d7b34a48ff sepolicy(hostapd): Add a HIDL interface for hostapd
* Note on cherry-pick: Some of the dependent changes are not in AOSP.
In order to keep hostapd running correctly in AOSP, I've modified this
change to only include policy additions.

Change sepolicy permissions to now classify hostapd as a HAL exposing
HIDL interface.

Sepolicy denial for accessing /data/vendor/misc/wifi/hostapd:
12-27 23:40:55.913  4952  4952 W hostapd : type=1400 audit(0.0:19): avc:
denied { write } for name="hostapd" dev="sda13" ino=4587601
scontext=u:r:hal_wifi_hostapd_default:s0
tcontext=u:object_r:system_data_file:s0 tclass=dir permissive=0

01-02 19:07:16.938  5791  5791 W hostapd : type=1400 audit(0.0:31): avc:
denied { search } for name="net" dev="sysfs" ino=30521
scontext=u:r:hal_wifi_hostapd_default:s0
tcontext=u:object_r:sysfs_net:s0 tclass=dir permissive=0

Bug: 36646171
Test: Device boots up and able to turn on SoftAp.
Change-Id: Ibacfcc938deab40096b54b8d0e608d53ca91b947
Merged-In: Ibacfcc938deab40096b54b8d0e608d53ca91b947
(cherry picked from commit 5bca3e860d)
2018-05-04 21:36:24 +00:00
android-build-prod (mdb)
64d56f81f8 Merge "FrameworksServicesTests: allow access to test.sys.boot.reason property" am: 8c139df845
am: 8f0e92bbfa

Change-Id: I5fc7d670c79d5415e5fdce3e17c033ea8a437bbd
2018-05-04 14:30:39 -07:00
android-build-prod (mdb)
8c139df845 Merge "FrameworksServicesTests: allow access to test.sys.boot.reason property" 2018-05-04 21:19:46 +00:00
Calin Juravle
035fcc46cc Allow system server to record its own profile
On userdebug builds we can now profile system server without disabling
selinux. This is the final piece, and allows the system server to save its
own profile.

Test: manual, on a device with system server profiling enabled
Bug: 73313191

(cherry picked from commit 71d8467b75)

Change-Id: I93e7e01bfbd3146a8cfd26a1f6e88b640e9c4e0f
2018-05-04 13:38:49 -07:00
Yao Chen
1d01bc94e7 Allow lmkd to log to statsd
am: 78e3ed447a

Change-Id: I0dd4ed7f448fc08b73608ddfecface1b6474d1bc
2018-05-04 13:23:15 -07:00
android-build-prod (mdb)
5d34bbcb5e Merge "Allow lmkd to log to statsd" 2018-05-04 20:11:27 +00:00
Calin Juravle
6d0b0605ab Merge "Allow system server to record its own profile" am: 6ff840033c
am: 6349325dfc

Change-Id: Id463d93fb7321bebc44495c8f5ebffb0d2aa67f2
2018-05-04 08:20:07 -07:00
Calin Juravle
6ff840033c Merge "Allow system server to record its own profile" 2018-05-04 15:06:24 +00:00
Jeffrey Vander Stoep
b8d870c18b Merge "Revert "FrameworksServicesTests: allow access to test.sys.boot.reason property"" am: bba94f80bb
am: cbae15fd69

Change-Id: I5941463f4252da1c6b77e685b5b4bdd13c53dc1b
2018-05-04 07:35:55 -07:00
Mark Salyzyn
3443cafa98 FrameworksServicesTests: allow access to test.sys.boot.reason property
com.android.server.power.PowerManagerServiceTest#testGetLastShutdownReasonInternal due to "RuntimeException: failed to set system property"

W/roidJUnitRunner: type=1400 audit(0.0:6): avc: denied { write } for name="property_service" dev="tmpfs" ino=13178 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
W/libc    : Unable to set property "test.sys.boot.reason" to "shutdown,thermal": connection failed; errno=13 (Permission denied)

Had to use precise property definition as com.android.phone accesses
test properties as well.

Test: compile
Bug: 78245377
Change-Id: I2cc810846f8615f2a2fae8e0d4f41de585b7abd7
2018-05-04 07:33:56 -07:00