Commit graph

13787 commits

Author SHA1 Message Date
Treehugger Robot
2b7fbbe917 Merge "Added sepolicy for activity_task service" 2018-06-05 16:02:51 +00: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
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
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
Tri Vo
1156d59389 Use hal_attribute for all HALs.
Bug: 72757373
Test: policy builds
Change-Id: I7cc5e28aac8ed381c9c350f540826e069941f6c4
2018-05-30 18:18:07 -07: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
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
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
Tom Cherry
a5db154ece Merge "Finer grained permissions for ctl. properties" 2018-05-24 16:28:24 +00:00
Treehugger Robot
35c9537b64 Merge "Account for multiple BOARD_PLAT_PUBLIC[PRIVATE]_SEPOLICY_DIR dirs" 2018-05-22 22:50:59 +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
Tri Vo
111cdce6ac Account for multiple BOARD_PLAT_PUBLIC[PRIVATE]_SEPOLICY_DIR dirs
After https://android-review.googlesource.com/688488
BOARD_PLAT_PUBLIC[PRIVATE]_SEPOLICY_DIR can now specify multiple
directories.

Bug: n/a
Test: build sepolicy
Change-Id: Ie2af81a4f9462cd05352db71fd1e515531d42334
2018-05-22 09:25:07 -07:00
Joel Galenson
98f83b67cc Exclude bug_map from the sepolicy_freeze_test.
The bug_map file is only used whitelisting known test failures.  It
needs to change fairly often to fix new failures and it doesn't affect
users, so it shouldn't matter if it diverges from prebuilts.

Test: Enable this test and build with and without different bug_maps.
Change-Id: I9176a6c7e9f7852a0cd7802fd121b1e86b216b22
2018-05-22 09:22:41 -07:00
Logan Chien
60227ea7c0 Merge "Add ro.vndk.lite to property_contexts" 2018-05-22 04:04:07 +00:00
Treehugger Robot
cfaaa9f42d Merge "Add sync and fence tracepoints to user-visible list of tracepoints." 2018-05-21 23:09:30 +00: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
Jordan Liu
fdb38fa6d0 Merge "Setup policy for downloaded apns directory" 2018-05-21 19:06:54 +00: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
Tri Vo
7710647a65 Merge "audioserver: add access to wake locks." 2018-05-21 16:28:10 +00:00
Treehugger Robot
1606d5601a Merge "ueventd: allow reading kernel cmdline" 2018-05-18 05:55:00 +00: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
Treehugger Robot
4c14d75369 Merge "storaged: add storaged_pri service" 2018-05-17 18:44:00 +00:00
Jeff Tinker
226ad93b81 Allow dumpstate to trace drm hals
Change-Id: Id7823a3130443107beb4d97426807a6395cf6930
related-to-bug:74607984
Test: adb bugreport and check for drm trace dumps
(cherry picked from commit 4f2739bd95)
2018-05-17 17:22:45 +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
Treehugger Robot
bf94b0204d Merge "Fix diff in cherry-pick" 2018-05-17 16:38:24 +00:00
Bowgo Tsai
98ef2abb12 ueventd: allow reading kernel cmdline
This is needed when ueventd needs to read device tree files
(/proc/device-tree). Prior to acccess, it tries to read
"androidboot.android_dt_dir" from kernel cmdline for a custom
Android DT path.

Bug: 78613232
Test: boot a device without unknown SELinux denials
Change-Id: Iff9c882b4fcad5e384757a1e42e4a1d1259bb574
2018-05-17 18:47:42 +08:00
Logan Chien
2e6e72208f Add ro.vndk.lite to property_contexts
Bug: 78605339
Test: aosp_walleye-userdebug builds
Change-Id: I37c84e20f2284d50cbe29bfa1b7597dd2c01fb4b
Merged-In: I37c84e20f2284d50cbe29bfa1b7597dd2c01fb4b
(cherry picked from commit 9f55f3455f)
2018-05-17 14:32:40 +08:00
Treehugger Robot
f8b60abfeb Merge "Allow auto HAL clients to access hw services" 2018-05-17 00:32:43 +00:00
Treehugger Robot
73682e4ec2 Merge "Fingerprint data is now stored in one of two ways depending on the" 2018-05-16 23:08:21 +00:00
Treehugger Robot
02f8296439 Merge "Allow to specify platform sepolicy dir mult. times" 2018-05-16 23:07:47 +00:00
Pavel Maltsev
f2763fa0a1 Allow auto HAL clients to access hw services
Bug: 70637118
Test: m && emulator ; also verified
Change-Id: I39dd17d20acc8d380f36e207679b8b1eba63a72e
Merged-In: I39dd17d20acc8d380f36e207679b8b1eba63a72e
(cherry picked from commit 368ae61fc7)
2018-05-16 15:46:34 -07: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
Treehugger Robot
15ee49d106 Merge "Allow to use sockets from hal server for auto" 2018-05-16 21:42:09 +00: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
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
Pavel Maltsev
8d7f503336 Allow to use sockets from hal server for auto
Add an exemption to neverallow rule to use sockets from HAL servers only
for automotive build

Bug: 78901167
Test: assign this attribute to hal_vehicle_default and try to open
socket from HAL implementation
Test: verify that new CTS test will fail for non-automotive build with
this attribute buing used
Test: make cts && cts-tradefed run singleCommand cts --skip-device-info
 --skip-preconditions --abi arm64-v8a --module CtsSecurityHostTestCases
 -t android.security.cts.SELinuxHostTest

Merged-In: I27976443dad4fc5b7425c089512cac65bb54d6d9

(cherry picked from commit 4cafae77a4)

Change-Id: I58e25a0f86579073aa568379b10b6599212134c6
2018-05-15 14:38:00 -07: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