Commit graph

16231 commits

Author SHA1 Message Date
Nick Kralevich
315f2fb260 Protect apps from ptrace by other system components
am: 84a42eadb2

Change-Id: Ib4e55bd3a56639c993314d3732b5dc406fbed0bd
2018-07-27 08:47:19 -07:00
Nick Kralevich
84a42eadb2 Protect apps from ptrace by other system components
The Android security model guarantees the confidentiality and integrity
of application data and execution state. Ptrace bypasses those
confidentiality guarantees. Disallow ptrace access from system components
to apps. Crash_dump is excluded, as it needs ptrace access to
produce stack traces.

Bug: 111317528
Test: code compiles
Change-Id: I883df49d3e9bca62952c3b33d1c691786dd7df4d
2018-07-25 23:49:30 -07:00
Jeff Vander Stoep
b1f4302819 Merge "OWNERS: add nnk and smoreland"
am: 719fa6db00

Change-Id: Iecca10575cadd8cd8e155f18eadbca4f93f37a2e
2018-07-25 13:12:12 -07:00
Treehugger Robot
719fa6db00 Merge "OWNERS: add nnk and smoreland" 2018-07-25 19:57:23 +00:00
Jeff Vander Stoep
904416562c OWNERS: add nnk and smoreland
Test: none
Change-Id: I5023f3f3f9362d456f30c81ec67580509101e81e
2018-07-25 10:10:40 -07:00
Bowgo Tsai
7b67a617dd Allowing vold to search /mnt/vendor/*
vold will trim rw mount points about daily, but it is denied by SELinux:

root   603   603 W Binder:603_2: type=1400 audit(0.0:11): avc: denied {
search } for name="vendor" dev="tmpfs" ino=23935 scontext=u:r:vold:s0
tcontext=u:object_r:mnt_vendor_file:s0 tclass=dir permissive=0

Allowing vold to search /mnt/vendor/* to fix the denials.

Note that device-specific sepolicy needs to be extended to allow vold
to send FITRIM ioctl. e.g., for /mnt/vendor/persist, it needs:

    allow vold persist_file:dir { ioctl open read };

Bug: 111409607
Test: boot a device, checks the above denial is gone
Change-Id: Ia9f22d973e5a2e295678781de49a0f61fccd9dad
2018-07-25 10:18:42 +08:00
Yi Kong
59b5de0b43 Modernize codebase by replacing NULL with nullptr
am: 16544eb94f

Change-Id: I0790ed88b45665c9087562144a73cd0294cb4c31
2018-07-24 16:54:14 -07:00
Yi Kong
16544eb94f Modernize codebase by replacing NULL with nullptr
Fixes -Wzero-as-null-pointer-constant warning.

Test: m
Bug: 68236239
Change-Id: Ib3f0a25a5129c34d94ebebff818feb5e6fd349dd
2018-07-24 14:54:56 -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
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
95b223b46f Merge "Re-order rules to match AOSP." into stage-aosp-master 2018-07-20 14:37:53 +00: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
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
Tri Vo
13e60ed1fa Merge "Add mapping files for 28.0.[ignore.]cil" 2018-07-20 00:56:27 +00: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
TreeHugger Robot
39f114d79d Merge changes from topic "selinux_cherry_picks" into stage-aosp-master
* changes:
  remove thermalcallback_hwservice
  reorder api 27 compat entries for removed types to match AOSP
2018-07-19 00:21:31 +00:00
Jeff Vander Stoep
7f6087c972 app: exempt su from auditallow statement
am: f95bf194c1

Change-Id: Idcdcb03b7764a6f0f3a7dd2d3110ed5f7166b772
2018-07-18 16:21:00 -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
Jeff Vander Stoep
f95bf194c1 app: exempt su from auditallow statement
Cut down on logspam during kernel_net_tests

Test: /data/nativetest64/kernel_net_tests/kernel_net_tests
Change-Id: Id19f50caebc09711f80b7d5f9d87be103898dd9a
2018-07-18 21:21:46 +00:00
Tri Vo
690de22d48 resolve merge conflicts of d07ab2fe93 to stage-aosp-master
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I58fff9dc7826eb60520b087d08ecd931cba63bf0
2018-07-18 13:08:55 -07:00
Tri Vo
d07ab2fe93 Merge "Add 28.0 prebuilts" 2018-07-18 18:31:23 +00: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
Tri Vo
afdfeeb506 Add 28.0 prebuilts
Bug: n/a
Test: n/a
Change-Id: I11e6baaa45bcb01603fc06e8a16002727f4e5a00
2018-07-17 15:31:47 -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
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
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
Yifan Hong
c74c0fbb34 Merge changes from topic "coredomain_batteryinfo"
am: 6397d7e0cb

Change-Id: I88c793acd19ce05e275d6f2883f90540f37d52b6
2018-07-13 12:42:47 -07:00
Treehugger Robot
6397d7e0cb Merge changes from topic "coredomain_batteryinfo"
* changes:
  vold: not allowed to read sysfs_batteryinfo
  full_treble: coredomain must not have access to sysfs_batteryinfo
2018-07-13 18:42:32 +00:00
Yifan Hong
711908e60b vold: not allowed to read sysfs_batteryinfo
It doesn't need to read batteryinfo to function properly.
Bug: 110891415
Test: builds and boots

Change-Id: I7f388180a25101bfd0c088291ef03a9bf8ba2b2c
2018-07-12 11:45:28 -07:00
Yifan Hong
b5f7f28c26 full_treble: coredomain must not have access to sysfs_batteryinfo
... but should do it via health HAL and healthd.

Bug: 110891415
Test: builds
Change-Id: Ib124f82d31f1dfbe99a56475dba04a37f81bdca3
2018-07-12 11:45:28 -07:00
Aalique Grahame
5626ee67a9 Merge "sepolicy: create rules for system properties"
am: 280c6afab2

Change-Id: I879d46d8e004a4ea63c1b131cdb5348e90adca0d
2018-07-10 21:40:58 -07:00
Treehugger Robot
280c6afab2 Merge "sepolicy: create rules for system properties" 2018-07-11 04:36:36 +00: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
Treehugger Robot
7d7328b807 Merge "Allow to read events/header_page with debugfs_tracing" 2018-07-11 04:28:23 +00:00
Aalique Grahame
2fc89a71f7 sepolicy: create rules for system properties
Add new sepolicy rules to support audio system properties

Bug: 110564278
Change-Id: If774a40b50e56f9e83bcb4ab8a84581dc03058ad
2018-07-03 08:54:04 -07:00
Anton Hansson
72a3251989 Merge "Split selinux_policy module into two."
am: 43a0a8e10c

Change-Id: Iba96f0b88256b7549eb1278bdf87e65bca041594
2018-07-03 06:27:44 -07:00
Anton Hansson
43a0a8e10c Merge "Split selinux_policy module into two." 2018-07-03 13:19:35 +00:00
Anton Hansson
8cfe1e6128 Split selinux_policy module into two.
Create one _system and one _nonsystem target, which together contains
the same artifacts as before, just split by whether they go on the
system partition or not.

The product build hierarchy is being refactored to be split by
partition, so these targets facilitate inclusion of just the
system parts where necessary. Also keep the selinux_policy target
around for products that don't need the split.

Bug: 80410283
Test: for t in eng userdebug user; do lunch mainline_arm64-${t}; m nothing; done
Test: verified walleye /system and /vendor identical before and after, via:
Test: /google/data/rw/users/cc/ccross/bin/compare-target-files.sh P6259983 walleye-userdebug "SYSTEM/*" "VENDOR/*"
Test: only diffs are in build.prop files (timestamps and the like)

Change-Id: I0f5d8a1558a164ce5cfb7d521f34b431855ac260
2018-07-03 14:04:20 +01: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