Commit graph

11586 commits

Author SHA1 Message Date
Dan Cashman
5c6a227ebb Commit oc-dev sepolicy to prebuilts.
Copy the final system sepolicy from oc-dev to its prebuilt dir
corresponding to its version (26.0) so that we can uprev policy and
start maintaining compatibility files, as well as use it for CTS
tests targeting future platforms.

Bug: 37896931
Test: none, this just copies the old policy.
Change-Id: Ib069d505e42595c467e5d1164fb16fcb0286ab93
2017-06-06 10:27:37 -07:00
TreeHugger Robot
1c9f5d8a86 Merge "Move sysfs cpu hotplug labeling to genfs_contexts" 2017-06-06 16:18:56 +00:00
Jeff Vander Stoep
e5fe6a330c Move sysfs cpu hotplug labeling to genfs_contexts
On Marlin ~120 ms of time is spent relabeling /sys/devices/system/cpu
every time we come out of suspend. Moving from file_contexts to
genfs_contexts as the labeling mechanism knocks this down to ~3 ms.

Bug: 32938130
Test: build and boot Marlin. Verify that files in
    /sys/devices/system/cpu have the proper label before and after
    suspend.

Change-Id: Ie71ea7e3dd5df250cabe4ba9600afbf67e69f720
2017-06-06 07:28:55 -07:00
Josh Gao
a9f067f704 crash_dump_fallback: allow dumpstate:pipe_file write. am: 715955b78a -s ours
am: e3aad5edb3  -s ours

Change-Id: I00c4e09c718b06df5a47b3af7093d0dc01d292b6
2017-06-06 07:52:15 +00:00
Josh Gao
e3aad5edb3 crash_dump_fallback: allow dumpstate:pipe_file write.
am: 715955b78a  -s ours

Change-Id: Idaf2e285bc60707aaa1141d9c141146e37c2526f
2017-06-06 04:58:09 +00:00
Jeff Vander Stoep
b6140ab0b0 Run Treble sepolicy tests at build time am: 1fc0682ec6
am: c85b859648  -s ours

Change-Id: I32f3b92444637ac4f62b53bc7b66daa64c6bd7dd
2017-06-06 04:14:10 +00:00
Sandeep Patil
99f1e6d98b Fix coredomain violation for modprobe am: e41af20397
am: 0a53f1d4fa

Change-Id: I15df35ef6ab490530d20bfca4cab168607b72668
2017-06-06 04:14:05 +00:00
Jeff Vander Stoep
9cb398229b Verify correct application of labels and attributes am: bdfc0301a1
am: 8ae0bd62e7  -s ours

Change-Id: I53305cfdaa523542b6795bd1c31c7eaa6e3b91af
2017-06-06 04:13:58 +00:00
Jeff Vander Stoep
c85b859648 Run Treble sepolicy tests at build time
am: 1fc0682ec6

Change-Id: I5f6adf8043686e1dbc5327b6845d710e6f673256
2017-06-06 03:54:42 +00:00
Sandeep Patil
0a53f1d4fa Fix coredomain violation for modprobe
am: e41af20397

Change-Id: I586cf07d87339f83d66919871d1531e9b8d79c4e
2017-06-06 03:54:39 +00:00
Jeff Vander Stoep
8ae0bd62e7 Verify correct application of labels and attributes
am: bdfc0301a1

Change-Id: Ifafca851d39158cff053f4205583dd22f89070c8
2017-06-06 03:54:37 +00:00
Josh Gao
748e257939 crash_dump_fallback: allow dumpstate:pipe_file write. am: 7aa085233a am: 7b19b08130 am: 9ff58c84a4
am: dde38d9b33

Change-Id: I8ad39a6ba69fa936f6522e29820127adc80798d5
2017-06-06 00:57:37 +00:00
Josh Gao
dde38d9b33 crash_dump_fallback: allow dumpstate:pipe_file write. am: 7aa085233a am: 7b19b08130
am: 9ff58c84a4

Change-Id: If0bc8e741af7cade57c76020db89516c1da69728
2017-06-06 00:43:51 +00:00
Josh Gao
9ff58c84a4 crash_dump_fallback: allow dumpstate:pipe_file write. am: 7aa085233a
am: 7b19b08130

Change-Id: I49de01eac93ff0f4c7a334cb899aa7ba75e275fa
2017-06-06 00:38:50 +00:00
Josh Gao
7b19b08130 crash_dump_fallback: allow dumpstate:pipe_file write.
am: 7aa085233a

Change-Id: I9fcf646602327f1c54d28c3fabf19741a6b72ef4
2017-06-06 00:33:20 +00:00
Josh Gao
715955b78a crash_dump_fallback: allow dumpstate:pipe_file write.
It appears that selinux requires the write permission to receive
a writable pipe from dumpstate, for unclear reasons. Add the permission
for now.

Bug: http://b/62297059
Test: dumpstate
Merged-In: I0f25682177115aacd5c2203ddc0008228b0380ad
Change-Id: I0f25682177115aacd5c2203ddc0008228b0380ad
(cherry picked from commit 7aa085233a)
2017-06-05 17:26:29 -07:00
Josh Gao
7aa085233a crash_dump_fallback: allow dumpstate:pipe_file write.
It appears that selinux requires the write permission to receive
a writable pipe from dumpstate, for unclear reasons. Add the permission
for now.

Bug: http://b/62297059
Test: dumpstate
Change-Id: I0f25682177115aacd5c2203ddc0008228b0380ad
2017-06-05 14:50:31 -07:00
Jeff Vander Stoep
1fc0682ec6 Run Treble sepolicy tests at build time
Bug: 37008075
Test: build policy on Marlin
Change-Id: I53748f94c5df66fa17a53e7d0bed1be6b8603544
(cherry picked from commit e1ddc6df75)
2017-06-05 08:09:32 -07:00
Sandeep Patil
e41af20397 Fix coredomain violation for modprobe
modprobe domain was allowed to launch vendor toolbox even if its a
coredomain. That violates the treble separation. Fix that by creating a
separate 'vendor_modprobe' domain that init is allowed to transition to
through vendor_toolbox.

Bug: 37008075
Test: Build and boot sailfish

Change-Id: Ic3331797691bb5d1fdc05a674aa4aa313e1f86b2
Signed-off-by: Sandeep Patil <sspatil@google.com>
(cherry picked from commit 9e366a0e49)
2017-06-05 08:09:18 -07:00
Jeff Vander Stoep
bdfc0301a1 Verify correct application of labels and attributes
With project Treble, we're relying heavily on attributes for
permission inheritance and enforcement of separation between
platform and vendor components.

We neead tests that verify those attributes are correctly applied.
This change adds the framework for those tests including a wrapper
around libsepol for loading and querying policy, and a python module
for running tests on policy and file_contexts.

Included with the testing framework is a test asserting that the
coredomain attribute is only applied to core processes. This
verification is done using the following rules:
1. Domain's entrypoint is on /system - coredomain
2. Domain's entrypoint is on /vendor - not coredomain
3. Domain belongs to a whitelist of known coredomains - coredomain

In a subsequent commit these tests will be applied at build time.
However, I first need to fix existing Treble violations exposed by
this test. These tests will also be applied during CTS.

Test: LD_PRELOAD=$ANDROID_HOST_OUT/lib64/libsepolwrap.so python \
    treble.py -p $OUT/vendor/etc/selinux/precompiled_sepolicy \
    -f $OUT/vendor/etc/selinux/nonplat_file_contexts \
    -f $OUT/system/etc/selinux/plat_file_contexts
Bug: 37008075
Change-Id: I7825f5c2909a5801deaccf2bef2bfd227adb0ae9
(cherry picked from commit 0366afdf14)
2017-06-05 08:09:05 -07:00
Jeff Vander Stoep
ffd57494c1 tests/policy.py code cleanup
Consolidate ctypes boilerplate code, and other cleanup.

Change-Id: I06c1d6acc9511f2f6d491c8ca2d4b630fd4120fd
Test: build policy
2017-06-03 20:53:07 -07:00
Chih-Hung Hsieh
0c3f64909f Merge "Add OWNERS in system/sepolicy" am: e77d9eea6b am: 05121724d1 am: 7a31444a35
am: 1b70d89610

Change-Id: I9aaf78ffb28b8319e2011400f45f34ef93322cb3
2017-06-03 01:15:41 +00:00
TreeHugger Robot
abb8793b90 Merge changes from topic 'coredomain_compile_test'
* changes:
  Run Treble sepolicy tests at build time
  Fix coredomain violation for modprobe
2017-06-03 01:14:18 +00:00
Chih-Hung Hsieh
1b70d89610 Merge "Add OWNERS in system/sepolicy" am: e77d9eea6b am: 05121724d1
am: 7a31444a35

Change-Id: I71e33a0923e9f17c35b91172c81612d420a10c0b
2017-06-03 01:11:57 +00:00
Chih-Hung Hsieh
7a31444a35 Merge "Add OWNERS in system/sepolicy" am: e77d9eea6b
am: 05121724d1

Change-Id: I6c8f336aed4833d6c9f9765a8768bba4b496a40e
2017-06-03 01:08:23 +00:00
Chih-Hung Hsieh
05121724d1 Merge "Add OWNERS in system/sepolicy"
am: e77d9eea6b

Change-Id: I3e4c83d962b1a4c9fbfba83ffd0df5fc8d59c8fc
2017-06-03 01:04:22 +00:00
Treehugger Robot
e77d9eea6b Merge "Add OWNERS in system/sepolicy" 2017-06-03 00:59:46 +00:00
Chih-Hung Hsieh
bd83bdf81a Add OWNERS in system/sepolicy
Owners are selected from top CL approvals or owners.
They will be suggested to review/approve future CLs.

Test: build/make/tools/checkowners.py -c -v OWNERS
Change-Id: I3d7f4c06209c22dea0d824429d68997f7179985f
2017-06-03 00:38:18 +00:00
Josh Gao
08a04202d6 crash_dump_fallback: allow dumpstate:fd use. am: 17885f148d am: a3a8a3a039 am: 8714f9e0e8
am: bef02a9e8d

Change-Id: Ibf9d8b3ec662bebc625cefe9380ef33c345b95fb
2017-06-03 00:19:32 +00:00
Josh Gao
bef02a9e8d crash_dump_fallback: allow dumpstate:fd use. am: 17885f148d am: a3a8a3a039
am: 8714f9e0e8

Change-Id: I669acdf32d54f9456268d3bfe43e1a114f3b96fd
2017-06-03 00:12:09 +00:00
Josh Gao
a1cb00cccc Merge "crash_dump_fallback: allow dumpstate:fd use." into oc-dev am: f378708c5c
am: dbf8d02804

Change-Id: Ic7504601de554becfefe1639b5f891079d24ff65
2017-06-03 00:11:08 +00:00
Josh Gao
dbf8d02804 Merge "crash_dump_fallback: allow dumpstate:fd use." into oc-dev
am: f378708c5c

Change-Id: Ia51ea7ccf0974ed1bacfea950571c6e10ed2b1bf
2017-06-03 00:07:22 +00:00
Josh Gao
8714f9e0e8 crash_dump_fallback: allow dumpstate:fd use. am: 17885f148d
am: a3a8a3a039

Change-Id: I63084a04ffe9d88aa6aadf5fbb9b7baa98ff3e35
2017-06-03 00:03:48 +00:00
Josh Gao
f378708c5c Merge "crash_dump_fallback: allow dumpstate:fd use." into oc-dev 2017-06-03 00:01:38 +00:00
Josh Gao
a3a8a3a039 crash_dump_fallback: allow dumpstate:fd use.
am: 17885f148d

Change-Id: I46546950720c4d3fa907f32a2af9ab42caa448ba
2017-06-02 23:56:18 +00:00
Jeff Vander Stoep
e1ddc6df75 Run Treble sepolicy tests at build time
Bug: 37008075
Test: build policy on Marlin
Change-Id: I53748f94c5df66fa17a53e7d0bed1be6b8603544
2017-06-02 16:11:52 -07:00
Sandeep Patil
9e366a0e49 Fix coredomain violation for modprobe
modprobe domain was allowed to launch vendor toolbox even if its a
coredomain. That violates the treble separation. Fix that by creating a
separate 'vendor_modprobe' domain that init is allowed to transition to
through vendor_toolbox.

Bug: 37008075
Test: Build and boot sailfish

Change-Id: Ic3331797691bb5d1fdc05a674aa4aa313e1f86b2
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-06-02 16:11:52 -07:00
Josh Gao
2a00056a95 crash_dump_fallback: allow dumpstate:fd use.
Bug: http://b/62297059
Test: mma
Merged-In: Ibcd93e5554a9c2dd75fbfb42294fbc9b96ebc8cc
Change-Id: Ibcd93e5554a9c2dd75fbfb42294fbc9b96ebc8cc
(cherry picked from commit 17885f148d)
2017-06-02 15:04:29 -07:00
Josh Gao
17885f148d crash_dump_fallback: allow dumpstate:fd use.
Bug: http://b/62297059
Test: mma
Change-Id: Ibcd93e5554a9c2dd75fbfb42294fbc9b96ebc8cc
2017-06-02 14:43:27 -07:00
Andrew Scull
f387ecf3ee Merge "Add missing sepolicies for OemLock HAL." into oc-dev am: 60e4fd9dfa
am: 39a81fd517

Change-Id: I0e7a02ff77ef0e6490a481229e042145c9dfb89a
2017-06-01 22:28:59 +00:00
Andrew Scull
69367b3742 Merge "Add missing sepolicies for the Weaver HAL." into oc-dev am: cd26745098
am: e8d4bec783

Change-Id: I14ea238856a8401427b02747ebb2c5750cc5e85f
2017-06-01 22:28:44 +00:00
Andrew Scull
39a81fd517 Merge "Add missing sepolicies for OemLock HAL." into oc-dev
am: 60e4fd9dfa

Change-Id: I1628907aeb743c3cb0938e7993237206523fdeb5
2017-06-01 22:22:03 +00:00
Andrew Scull
e8d4bec783 Merge "Add missing sepolicies for the Weaver HAL." into oc-dev
am: cd26745098

Change-Id: I20479829d542df345275c0c2b4512788a30fba4c
2017-06-01 22:21:48 +00:00
TreeHugger Robot
60e4fd9dfa Merge "Add missing sepolicies for OemLock HAL." into oc-dev 2017-06-01 22:05:18 +00:00
TreeHugger Robot
cd26745098 Merge "Add missing sepolicies for the Weaver HAL." into oc-dev 2017-06-01 22:05:15 +00:00
Neil Fuller
8cb67753d9 resolve merge conflicts of e664e80a to oc-dev-plus-aosp
am: 911e236ae4  -s ours

Change-Id: I0a1cf351e40f81c1ee26bc5b722f99ae4e242b7e
2017-06-01 20:36:09 +00:00
Neil Fuller
911e236ae4 resolve merge conflicts of e664e80a to oc-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Icadf7c72ad173c134d3e95bb5b93c2b54b1b703e
2017-06-01 20:46:48 +01:00
Steve Muckle
f64e4df3ec Merge "allow modprobe to load signed kernel modules" into oc-dev am: fc1d8d991e
am: 06a4b61b7a

Change-Id: I50d8c90eaba6161e839ceb9fc87a41540e15eead
2017-06-01 19:29:01 +00:00
Steve Muckle
06a4b61b7a Merge "allow modprobe to load signed kernel modules" into oc-dev
am: fc1d8d991e

Change-Id: Id41f7097fd0a48739293d4f8f06f296d0f189684
2017-06-01 19:24:47 +00:00
TreeHugger Robot
fc1d8d991e Merge "allow modprobe to load signed kernel modules" into oc-dev 2017-06-01 19:16:34 +00:00