Commit graph

6864 commits

Author SHA1 Message Date
Roshan Pius
7c539b1c96 sepolicy: Add permissions for wpa_supplicant binder
Add the necessary permissions for |wpa_supplicant| to expose a binder
interface. This binder interface will be used by the newly added
|wificond| service (and potentially system_server).
|wpa_supplicant| also needs to invoke binder callbacks on |wificond|.

Changes in the CL:
1. Allow |wpa_supplicant| to register binder service.
2. Allow |wpa_supplicant| to invoke binder calls on |wificond|.
3. Allow |wificond| to invoke binder calls on |wpa_supplicant|

Denials:
06-30 08:14:42.788   400   400 E SELinux : avc:  denied  { add } for
service=wpa_supplicant pid=20756 uid=1010 scontext=u:r:wpa:s0
tcontext=u:object_r:default_android_service:s0 tclass=service_manager
permissive=1

BUG:29877467
TEST: Compiled and ensured that the selinux denials are no longer
present in logs.
TEST: Ran integration test to find the service.

Change-Id: Ib78d8e820fc81b2c3d9260e1c877c5faa9f1f662
(cherry picked from commit 18883a93b7)
2016-08-26 13:13:51 -07:00
Ningyuan Wang
b83c8cb139 sepolicy: add sepolicy binder support for wificond
This allows wificond to publish binder interface using
service manager.

Denial warnings:

wificond: type=1400 audit(0.0:8): avc:
denied { call } for scontext=u:r:wificond:s0
tcontext=u:r:servicemanager:s0 tclass=binder permissive=1

wificond: type=1400 audit(0.0:9): avc:
denied { transfer } for scontext=u:r:wificond:s0
tcontext=u:r:servicemanager:s0 tclass=binder permissive=1

servicemanager: type=1400
audit(0.0:10): avc: denied { search } for name="6085" dev="proc"
ino=40626 scontext=u:r:servicemanager:s0 tcontext=u:r:wificond:s0
tclass=dir permissive=1

servicemanager: type=1400
audit(0.0:11): avc: denied { read } for name="current" dev="proc"
ino=40641 scontext=u:r:servicemanager:s0 tcontext=u:r:wificond:s0
tclass=file permissive=1

servicemanager: type=1400
audit(0.0:12): avc: denied { open } for path="/proc/6085/attr/current"
dev="proc" ino=40641 scontext=u:r:servicemanager:s0
tcontext=u:r:wificond:s0 tclass=file permissive=1

servicemanager: type=1400
audit(0.0:13): avc: denied { getattr } for
scontext=u:r:servicemanager:s0 tcontext=u:r:wificond:s0 tclass=process
permissive=1

SELinux : avc:  denied  { add } for
service=wificond pid=6085 uid=0 scontext=u:r:wificond:s0
tcontext=u:object_r:wifi_service:s0 tclass=service_manager permissive=1

BUG=28867093
TEST=compile
TEST=use a client to call wificond service through binder

Change-Id: I9312892caff171f17b04c30a415c07036b39ea7f
(cherry picked from commit d56bcb1c54)
2016-08-26 13:13:51 -07:00
Ningyuan Wang
3cbf14a183 Sepolicy files for wificond
This sepolicy change allows wificond to run as a deamon.

BUG=28865186
TEST=compile
TEST=compile with ag/1059605
  Add wificond to '/target/product/base.mk'
  Adb shell ps -A | grep 'wificond'

Change-Id: If1e4a8542ac03e8ae42371d75aa46b90c3d8545d
(cherry picked from commit 4ef44a616e)
2016-08-26 13:13:51 -07:00
Chad Brubaker
a3f6339a49 Allow apps to read keychain_data_file links
am: f247dcba46

Change-Id: Ie24129d68ee32fe0178dd0fe4aea4208e72f050f
2016-08-24 22:17:35 +00:00
Chad Brubaker
f247dcba46 Allow apps to read keychain_data_file links
Bug: 28746284
Change-Id: I59aa235ecba05e22aaa531e387a77f47267ac9ae
2016-08-24 12:08:36 -07:00
TreeHugger Robot
9b5b32c04c Merge "Port from pcre to pcre2 (Fix wrong merge decision)" into stage-aosp-master 2016-08-23 09:06:00 +00:00
Chad Brubaker
28a896bf9a Allow system_server to make keystore_data_file links
am: a67411c952

Change-Id: If2ab59c09b2ccf444281fdf9003e36119eb7295f
2016-08-23 01:21:02 +00:00
Chad Brubaker
a67411c952 Allow system_server to make keystore_data_file links
Bug: 28746284
Change-Id: Ib5e294402c549d8ed6764722220484c5655951a9
2016-08-22 13:47:12 -07:00
Janis Danisevskis
750d797b1c Port from pcre to pcre2 (Fix wrong merge decision)
Ports check_seapp to pcre2.

Change-Id: If3faac5b911765a66eab074f7da2511624c3fc97
2016-08-22 11:12:53 +01:00
Janis Danisevskis
a7d5e610a2 Port from pcre to pcre2
am: a15ea578ff  -s ours

Change-Id: I8acaaf29d6cd06291c45f3a1fb2e246718543922
2016-08-19 19:29:35 +00:00
Janis Danisevskis
a15ea578ff Port from pcre to pcre2
Ports check_seapp to pcre2.

Merged-In: Ib9977326cfbb19ce143b04504f41afb884f2ec17
Bug: 24091652
Change-Id: Ib9977326cfbb19ce143b04504f41afb884f2ec17
2016-08-19 15:17:19 +01:00
Hung-ying Tyan
a54911b639 Allow init to mount /odm, /vendor early
am: c37747202b

Change-Id: I7ffbc6c1d4213fe68c52ded884bd9db9f6b37fb1
2016-08-18 05:04:50 +00:00
Hung-ying Tyan
c37747202b Allow init to mount /odm, /vendor early
Specifically we need init to relabel (/dev/device-mapper, /dev/block/dm-?)
and other files in /dev/block/* from tmpfs to dm_device and block_device
respectively.

BUG=27805372

Change-Id: I16af6e803f8e4150481137aba24d5406872f9c62
2016-08-15 08:20:41 +08:00
Nick Kralevich
9cb9c4bdfa Merge "fine-grained policy for access to /proc/zoneinfo"
am: 89a8ed4e9a

Change-Id: I3733a74a23b3ece3a38fa2d7a2b3ea996f95c87f
2016-08-14 18:28:49 +00:00
Nick Kralevich
89a8ed4e9a Merge "fine-grained policy for access to /proc/zoneinfo" 2016-08-14 18:21:49 +00:00
Elliott Hughes
b70abb6e05 Merge "Fix init's restorecon of /dev/kmsg."
am: c0937b6ebd

Change-Id: I06890bb6755d084f37bf6fb6564e4e1abeac8c06
2016-08-12 00:30:43 +00:00
Treehugger Robot
c0937b6ebd Merge "Fix init's restorecon of /dev/kmsg." 2016-08-12 00:12:12 +00:00
Elliott Hughes
bbf7d257b1 Fix init's restorecon of /dev/kmsg.
Bug: http://b/30699558
Change-Id: Id9b213967ab290f45d1b8a5ab6712845ac9a0b69
Merged-In: Id9b213967ab290f45d1b8a5ab6712845ac9a0b69
2016-08-11 15:19:23 -07:00
Alex Deymo
c2e2b4e007 resolve merge conflicts of d63084d to stage-aosp-master
Change-Id: I21dbd14d4e1bd89619e6fff91a85ed3fba02c324
2016-08-09 21:28:04 -07:00
Alex Deymo
d63084d32a Allow executing update_engine_sideload from recovery.
The recovery flow for A/B devices allows to sideload an OTA downloaded
to a desktop and apply from recovery. This patch allows the "recovery"
context to perform all the operations required to apply an update as
update_engine would do in the background. These rules are now extracted
into a new attributte called update_engine_common shared between
recovery and update_engine.

Bug: 27178350
Change-Id: I97b301cb2c039fb002e8ebfb23c3599463ced03a
2016-08-09 14:59:40 -07:00
dcashman
8ba28103bb resolve merge conflicts of 9cc3a58 to stage-aosp-master
Change-Id: I2593e100bdad420d0d988fbaeb8d2ec259b8df1d
2016-08-08 11:23:17 -07:00
Daniel Micay
7078e8b67a fine-grained policy for access to /proc/zoneinfo
Change-Id: Ica9a16311075f5cc3744d0e0833ed876e201029f
2016-08-08 13:48:01 -04:00
Treehugger Robot
9cc3a580c5 Merge "appdomain: neverallow direct input_device access" 2016-08-08 17:16:57 +00:00
dcashman
5e6aa65f62 resolve merge conflicts of 5423db6 to stage-aosp-master
Change-Id: I16706423534069f69bd0305ac500a9cd74db55a6
2016-08-05 15:01:15 -07:00
Daniel Micay
5423db6eb3 restrict access to timing information in /proc
These APIs expose sensitive information via timing side channels. This
leaves access via the adb shell intact along with the current uses by
dumpstate, init and system_server.

The /proc/interrupts and /proc/stat files were covered in this paper:

https://www.lightbluetouchpaper.org/2016/07/29/yet-another-android-side-channel/

The /proc/softirqs, /proc/timer_list and /proc/timer_stats files are
also relevant.

Access to /proc has been greatly restricted since then, with untrusted
apps no longer having direct access to these, but stricter restrictions
beyond that would be quite useful.

Change-Id: Ibed16674856569d26517e5729f0f194b830cfedd
2016-08-05 13:57:25 -04:00
William Roberts
98ff70cc7c Merge "te_macros: drop unused macros"
am: 2b33112a3c

Change-Id: I08987ae7229ebbbbcf980be4aaef2eb8fb7e24da
2016-08-05 17:55:58 +00:00
Treehugger Robot
2b33112a3c Merge "te_macros: drop unused macros" 2016-08-05 17:46:41 +00:00
William Roberts
2925c1cc7f te_macros: drop unused macros
boolean and setenforce macros are not used in base policy
and cannot be used in any policy, since they violate
neverallow rules.

Remove these from the policy.

Change-Id: Icc0780eaf06e95af36306031e1f615b05cb79869
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2016-08-04 11:37:10 -07:00
John Stultz
e4025649cf sepolicy: Add CAP_WAKE_ALARM to system_server.te
am: 19b6485f5e

Change-Id: I0574ab7e70a8b3d906a5b11368239d58d1d64e70
2016-08-03 06:51:46 +00:00
John Stultz
19b6485f5e sepolicy: Add CAP_WAKE_ALARM to system_server.te
With v4.8+ kernels, CAP_WAKE_ALARM is needed to set
alarmtimers via timerfd (this change is likely to be
backported to stable as well).

However, with selinux enabled, we also need to allow
the capability on the system_server so this enables it.

Change-Id: I7cd64d587906f3fbc8a129d48a4db07373c74c7e
Signed-off-by: John Stultz <john.stultz@linaro.org>
2016-08-02 20:15:44 -07:00
Elliott Hughes
98fbb31855 Merge \"Simplify /dev/kmsg SELinux policy.\"
am: aa2aa21902

Change-Id: I5e1634a8c0cee6cb759e0acea086b68dbd21fb7e
2016-07-27 15:47:13 +00:00
Elliott Hughes
aa2aa21902 Merge "Simplify /dev/kmsg SELinux policy." 2016-07-27 15:38:31 +00:00
William Roberts
e83b9f037c appdomain: neverallow direct input_device access
Applications should not access /dev/input/* for events, but
rather use events handled via the activity mechanism.

Change-Id: I0182b6be1b7c69d96e4366ba59f14cee67be4beb
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2016-07-26 20:04:29 +00:00
Elliott Hughes
63b33dc2db Simplify /dev/kmsg SELinux policy.
Bug: http://b/30317429
Change-Id: I5c499c48d5e321ebdf588a162d29e949935ad8ee
Test: adb shell dmesg | grep ueventd
2016-07-26 09:46:20 -07:00
Eric Bae
0f38c64250 allow policy to create a file by vfat (fs_type) for a case using sdcardfs
am: 362d6ff1b8

Change-Id: Ibe19ac1955bad48b5fa1db7ffada46aa78781781
2016-07-26 00:23:15 +00:00
Daniel Rosenberg
e88095d8b1 resolve merge conflicts of c15090b to stage-aosp-master
Change-Id: I87b6797cd2bc9efafe2590e1f69d5787de99af07
2016-07-25 17:22:00 -07:00
Eric Bae
362d6ff1b8 allow policy to create a file by vfat (fs_type) for a case using sdcardfs
Change-Id: Ia938d73b1a49b9ba4acf906df37095d21edee22e
2016-07-22 13:34:31 -07:00
Daniel Rosenberg
c15090b315 sepolicy: Add policy for sdcardfs and configfs
Change-Id: I4c318efba76e61b6ab0be9491c352f281b1c2bff
Bug: 19160983
2016-07-22 13:34:23 -07:00
Jorge Lucangeli Obes
4cffd85446 Merge \"logd: Add setpcap for Minijail use.\"
am: 23d703eee3

Change-Id: I98383d496812ced491a892c1ffb29527d77c63a9
2016-07-20 22:11:30 +00:00
Treehugger Robot
23d703eee3 Merge "logd: Add setpcap for Minijail use." 2016-07-20 22:04:27 +00:00
Jorge Lucangeli Obes
b6287b1eb1 logd: Add setpcap for Minijail use.
Bug: 30156807
Change-Id: Ie9faf72d35579fa69b4397bdffc8d674f040736c
2016-07-20 17:12:59 -04:00
Jeff Vander Stoep
2c4718fcee resolve merge conflicts of 56ed8a4 to stage-aosp-master
Change-Id: Ic549f8c8060a17981302f2af75debf34595475bb
2016-07-20 12:44:22 -07:00
Treehugger Robot
56ed8a4df6 Merge changes I86958ebc,I0449575a
* changes:
  adbd: allow reading apk_data_file
  adbd: allow reading rootfs dir
2016-07-20 18:49:32 +00:00
Jeff Vander Stoep
d743ddeab5 adbd: allow reading apk_data_file
avc: denied { search } for comm=73657276696365203139 name="app" dev="sda35" ino=770049 scontext=u:r:adbd:s0 tcontext=u:object_r:apk_data_file:s0 tclass=dir permissive=0

Bug: 30000600
Change-Id: I86958ebcca815ee1779f85fb425592493f40101a
2016-07-19 12:42:57 -07:00
Jeff Vander Stoep
7fcb3a6124 adbd: allow reading rootfs dir
Bug: 30213958
Change-Id: I0449575a5ec6cc4997bc36a13676474505a4190f
2016-07-19 12:38:39 -07:00
William Roberts
7d9487c996 Merge \"service_contexts: strip blank lines and comments\"
am: afad0c35ec

Change-Id: Id4a4937cc3b7c2ddd6d363144e6fafc90be60498
2016-07-18 22:56:49 +00:00
Treehugger Robot
afad0c35ec Merge "service_contexts: strip blank lines and comments" 2016-07-18 22:50:21 +00:00
William Roberts
a584f2f6cd Merge \"property_contexts: strip blank lines and comments\"
am: ee69a2e775

Change-Id: If61f5720180243ec1b5aa9e16d66c95c37f49b88
2016-07-15 21:24:34 +00:00
Treehugger Robot
ee69a2e775 Merge "property_contexts: strip blank lines and comments" 2016-07-15 21:13:03 +00:00
dcashman
e0585ca873 Grant untrusted_app dir access to asec_apk_file.
am: 83348b0b94

Change-Id: Ia19aeffe64e733deb695206dcbd8cb824c9db222
2016-07-15 17:21:38 +00:00