Commit graph

13745 commits

Author SHA1 Message Date
Pavel Maltsev
fdec2530ef Allow to specify platform sepolicy dir mult. times
For automotive (and I assume for other verticals) it make sense to keep
vertical-specific policies outside of /system/sepolicy as those not used
by the phones. However, there's no way to do it rather than using
BOARD_PLAT_{PUBLIC|PRIVATE}_SEPOLICY_DIR build variables.

Bug: 70637118
Test: lunch device && m
Test: verify it builds, boots and logs seems to be reasonable
Test: enable full treble for aosp_car_x86 - verify it builds, boots and
no denials in the logs

Change-Id: Ia5fd847f7a6152ff6cf99bbbc12e1e322f7946ab
(cherry picked from commit 34f233640a)
2018-05-16 13:12:09 -07:00
Treehugger Robot
8c70622e57 Merge "Always build system and vendor policies (and related artifacts)." 2018-05-16 18:40:05 +00:00
Treehugger Robot
117d69fd2a Merge "domain.te & kernel.te: allow kernel to write nativetest_data_file" 2018-05-16 02:53:03 +00:00
Treehugger Robot
2d01df0ae4 Merge "Allow vendor_init to getattr vold_metadata_file." 2018-05-15 20:19:45 +00:00
Yongqin Liu
64ff9e9523 domain.te & kernel.te: allow kernel to write nativetest_data_file
to workaround some VTS VtsKernelLtp failures introduced by
change on vfs_iter_write here:
abbb65899a%5E%21/#F3

for discussion please check threads here:
https://www.mail-archive.com/seandroid-list@tycho.nsa.gov/msg03348.html

Sandeep suggest to re-order the events in that thread,
that should be the right solution,
this change is only a tempory workaround before that change.

Test: manually with -m VtsKernelLtp -t VtsKernelLtp#fs.fs_fill_64bit

Change-Id: I3f46ff874d3dbcc556cfbeb27be21878574877d1
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
2018-05-15 19:19:05 +00:00
Jerry Zhang
b0e87e61ce Merge "Allow mediaprovider to search /mnt/media_rw" 2018-05-15 18:13:25 +00:00
Joel Galenson
be31a68e92 Allow vendor_init to getattr vold_metadata_file.
This relaxes the neverallow rule blocking vendor_init from doing
anything to vold_metadata_file.  The rules above it still prevent it
from doing anything other than relabelto and getattr.

Bug: 79681561
Test: Boot device and see no denials.
Change-Id: I1beb25bb9f8d69323c9fee53a140c2a084b12124
(cherry picked from commit 597be44e96)
2018-05-15 08:03:41 -07: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
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
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
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
Tri Vo
1f4a28b159 Always build system and vendor policies (and related artifacts).
Part of an effort to remove Treble-specifics from the way be build
sepolicy.

Bug: 70851112
Test: build and boot bullhead.
Change-Id: I236f031e1b017875fb1afcc4f1b201699139516a
2018-05-09 14:00:54 -07: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
Mark Salyzyn
2a3f55b5e0 Merge "init: support /dev/input" 2018-05-09 16:49:56 +00:00
Dan Willemsen
d32437e975 Merge "Remove unused tags property from Android.bp files" 2018-05-09 05:59:03 +00:00
Tri Vo
41d35c6f8d Merge changes from topic "selinux_soong"
* changes:
  Soong module for selinux files including board-specific directories.
  Soong module selinux compat maps
2018-05-09 01:57:14 +00:00
Dan Willemsen
76b7f7b311 Remove unused tags property from Android.bp files
The tags property is (and has always been) unused by Soong. The property has
been defined as a list of strings, and the `androidmk` converted any
LOCAL_MODULE_TAGS entries over to it, but we've never done anything with it.

In preparation for removing the definition from Soong, I'm removing it from all
Android.bp files in the tree.

Since this has never done anything, this is a no-op, but if you really did want
the Android.mk behavior, the proper way to define a module to be installed in
userdebug / eng builds is to use PRODUCT_PACKAGES_DEBUG or PRODUCT_PACKAGES_ENG
in the appropriate product makefile.

Change-Id: Ia9a9b1c35533e02047cbb183b317ab93f1eeec6b
Exempt-From-Owner-Approval: global no-op build change
Test: remove `tags` from Soong, see errors go away.
2018-05-08 17:15:33 -07:00
Dongwon Kang
f261c7f5e7 Merge "Allow sdcardfs:file read access on mediaextractor" 2018-05-09 00:08:17 +00:00
android-build-prod (mdb)
81bb3c6e18 Merge "Adding ability for hal keymaster to read vendor SPL" 2018-05-08 18:36:58 +00:00
Tri Vo
84e247abeb Soong module for selinux files including board-specific directories.
se_filegroup is used to export selinux files from board-specific
directories (e.g. device/google/wahoo/sepolicy).

Use se_filegroup module to export partner extension of compatibility
mapping to build logic in system/sepolicy.

Bug: 33691272
Bug: 74669108
Test: .cil mapping files can be correctly added from vendor directory.
Change-Id: Iaa2a95d0e326cb03a478fc12c1a14ba40e57e117
2018-05-08 11:28:47 -07:00
Tri Vo
a5cfd3e537 Soong module selinux compat maps
And migrate 26.0.cil and 27.0.cil build targets from Android.mk to
Android.bp

Bug: 33691272
Test: 26.0.cil and 27.0.cil mapping files on the device are unchanged.
Change-Id: Id0ea45c149e096996bc0657615ea98915df3c9e1
2018-05-08 11:28:47 -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
android-build-prod (mdb)
a99a069868 Merge "give audioserver access to media.metrics" 2018-05-07 23:06:37 +00: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
Max Bires
7332216811 Adding ability for hal keymaster to read vendor SPL
Keymaster hal needs to be able to read the vendor SPL for purposes of
rollback protection.

Test: Keymaster can access the hal_keymaster_default property
Change-Id: Ifa53adb23f6ab79346e9dd9616b34d8b24395a0a
2018-05-07 13:25:44 -07:00
Tri Vo
594488f8b0 Build sepolicy tools with Android.bp.
Bug: 33691272
Test: make clean && mmma system/sepolicy
Change-Id: I6bbd6271c375338e7d24cd6089c6f826080c98b6
2018-05-07 12:51:54 -07:00
Mark Salyzyn
5e6b6bc421 init: support /dev/input
Test: compile
Bug: 64114943
Change-Id: I2bbf84a6e472d720f02282e10d56795b75ac62d1
2018-05-07 14:28:24 +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)
8c139df845 Merge "FrameworksServicesTests: allow access to test.sys.boot.reason property" 2018-05-04 21:19:46 +00:00
android-build-prod (mdb)
5d34bbcb5e Merge "Allow lmkd to log to statsd" 2018-05-04 20:11:27 +00:00
Jeffrey Vander Stoep
54f61fe53c Merge "Never expand proc_type attribute" 2018-05-04 20:10:28 +00:00
Dan Cashman
9e4aa226ad Remove dcashman@google.com from OWNERS.
Buh-bye!
Test: none

Change-Id: Ib1917adf03f9e777c7fc4bcb749c34c051176860
2018-05-04 09:42:26 -07:00
Calin Juravle
6ff840033c Merge "Allow system server to record its own profile" 2018-05-04 15:06:24 +00: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
Jeffrey Vander Stoep
bba94f80bb Merge "Revert "FrameworksServicesTests: allow access to test.sys.boot.reason property"" 2018-05-04 14:25:31 +00:00
Jeff Vander Stoep
a6295412b4 Never expand proc_type attribute
It's used in build-time tests and in CTS.

Bug: 78898770
Test: build user-build
Change-Id: I254bf4d7ed0c0cb029b55110ceec982b84e4a91b
Merged-In: I254bf4d7ed0c0cb029b55110ceec982b84e4a91b
2018-05-04 06:44:58 +00:00
Jeffrey Vander Stoep
9c6749d772 Revert "FrameworksServicesTests: allow access to test.sys.boot.reason property"
This reverts commit 0ab13a8dff.

Reason for revert: broken presubmit tests
https://sponge.corp.google.com/target?show=FAILED&sortBy=STATUS&id=83e847b2-8e30-4417-9b15-8e66af4b2bc3&target=DeviceBootTest

Change-Id: Id173c8e7fa28ba04070f507098f301f076e4aae7
2018-05-04 06:23:42 +00:00
Calin Juravle
71d8467b75 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
Change-Id: Iaf9575d3cda19ae4c38f1e20a8e1b9288b7abc83
2018-05-03 20:15:18 -07:00
yro
db2e6085bb Allow lmkd to log to statsd
Bug: 78603347
Test: build and locally tested
Change-Id: Ib9b041af63d1fac7a689b932e7a2b202fa8d0f83
2018-05-03 16:43:03 -07:00
android-build-prod (mdb)
0e055173b1 Merge "FrameworksServicesTests: allow access to test.sys.boot.reason property" 2018-05-03 23:21:58 +00:00
android-build-prod (mdb)
fc9afc4d2b Merge "Sepolicy: Fix system server calling perfprofd" 2018-05-03 20:12:40 +00:00
Tri Vo
59e9d2d8c9 Merge "SELinux type for vendor public libs." 2018-05-03 19:52:58 +00:00
Andreas Gampe
986b9af4fa Sepolicy: Fix system server calling perfprofd
Give all the right permissions to find and send a message to
perfprofd from the system server.

Bug: 73175642
Test: m
Test: manual
Change-Id: I82b63ec097dcd445d9e8169fe0df4398d62ac184
2018-05-03 10:57:30 -07:00
Mark Salyzyn
0ab13a8dff 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)

Test: compile
Bug: 78245377
Change-Id: Id21436d281bab27823969a9f7e92318d70b5a2d6
2018-05-03 16:45:36 +00:00