Commit graph

3344 commits

Author SHA1 Message Date
Jeff Vander Stoep
ff91d5d605 vendor_init: enforce similar restrictions as init
Test: build aosp_taimen-userdebug
Change-Id: Ie35ffcb8d2e3b83b6592f863caca946270aa4032
2018-06-28 23:06:40 +00:00
Jian Yu
fa61f45047 Fix issue that ro.telephony.default_network can't be read per slot
am: bbb439e76a

Change-Id: I5e7036e4ad9c19229835d9b7b36cc77bb476ef9c
2018-06-26 17:10:52 -07:00
Jian Yu
bbb439e76a Fix issue that ro.telephony.default_network can't be read per slot
"ro.telephony.default_network" can define as comma-separated Sting per
slot for multi SIM device. However, it cannot be read correctly due to
it defined as Int in property_contexts file.

Bug: 110626665
Test: manual - Checked the ro.telephony.default_network can be read per
slot for multi SIM device.
Change-Id: I900620e46c819c14bf339751f00a1db1473fd45f
2018-06-26 21:26:37 +00:00
Samuel Ha
eda0f3f372 Revert "Revert "Reduce the number of processes that can start adbd""
am: 22f98197b2

Change-Id: Ie2678a964788b3a064ec12b06cb7b129ccc9b4b5
2018-06-26 13:06:04 -07:00
Samuel Ha
22f98197b2 Revert "Revert "Reduce the number of processes that can start adbd""
This reverts commit b5dc6137ad.

Reason for revert: Reverted incorrect change

Change-Id: Ieafa3338e28ffeed40bcceb73486cffbfbd08b9d
2018-06-26 19:52:21 +00:00
Samuel Ha
d2bc137aed Revert "Reduce the number of processes that can start adbd"
am: b5dc6137ad

Change-Id: I27e69743664613630765598869203b71437182b2
2018-06-26 12:49:35 -07:00
Samuel Ha
b5dc6137ad Revert "Reduce the number of processes that can start adbd"
This reverts commit faebeacaa0.

Reason for revert: broke the build

Change-Id: I3d61ce011ad42c6ff0e9f122de3daa37e846407a
2018-06-26 19:36:38 +00:00
Luis Hector Chavez
72bebcec37 Reduce the number of processes that can start adbd
am: faebeacaa0

Change-Id: I263f10cc06e23a01f1928d3c8dae3ab4e6357788
2018-06-26 07:17:06 -07:00
Luis Hector Chavez
faebeacaa0 Reduce the number of processes that can start adbd
This change makes it such that only init can start adbd directly. It
also introduces new rules for ctl.{start,stop,restart} properties such
that only usbd and recovery (and su, since it's permissive) can directly
ask init to start adbd.

Bug: 64720460
Test: adbd still runs
Test: /data/nativetest64/adbd_test/adbd_test
Test: python system/core/adb/test_adb.py
Test: "USB debugging" in System Settings still start/stop adbd
Test: Recovery menu still make the device show as "recovery" in adb
      devices
Test: "Apply update from ADB" in recovery menu still works
Change-Id: Iafcda8aa44e85129afcc958036b472d856fa1192
2018-06-26 14:10:26 +00:00
Eino-Ville Talvala
67bd625c19 Make system property audio.camerasound.force a vendor-writable property,
am: 3ac71f8d82

Change-Id: Ia0db4d6a305d7f815f38a119475ebb346e873249
2018-06-25 22:00:50 -07:00
Eino-Ville Talvala
3ac71f8d82 Make system property audio.camerasound.force a vendor-writable property,
This property is read by the audio service in system server to toggle
camera shutter sound enforcement on a device-specific basis.

Test: Camera shutter sound enforcement works when audio.camerasound.force is set
Bug: 110126976
Change-Id: I2720d3c699c4712d1a328f59dde0b16bbf1016f3
2018-06-25 22:50:14 +00:00
Neil Fuller
43d2c3d0b5 Add label for time (zone) system properties
am: b794ad0f8d

Change-Id: I46c7aa4b511da69d7f852023cff23871b6c8468e
2018-06-25 13:31:29 -07:00
Neil Fuller
b794ad0f8d Add label for time (zone) system properties
This adds a label for system properties that will affect system-wide
time / time detection logic.

The first example will be something like:
persist.time.detection_impl_version

Bug: 78217059
Test: build
Change-Id: I46044f1e28170760001da9acf2496a1e3037e48a
2018-06-25 17:59:56 +01:00
Jeff Vander Stoep
ed3f2dba34 Merge "Update socket ioctl restrictions"
am: 4b9a3128fd

Change-Id: I91b225a67ba9a63ac325882bdbb8ac78e487b323
2018-06-22 11:03:21 -07:00
Jeff Vander Stoep
0597ade15c Update socket ioctl restrictions
Grant access to icmp_socket to netdomain. This was previously
labeled as rawip_socket which apps are allowed to use. Neverallow
all other new socket types for apps.

Kernels versions > 4.9 redefine ICMP sockets from rawip_socket
to icmp_socket. To pass neverallow tests, we need to define
which IOCTLs are allowed (and disallowed).

Note that this does not change behavior on devices with
kernel versions <=4.9. However, it is necessary (although not
sufficient) to pass CTS on kernel version 4.14.

Bug: 110520616
Test: Grant icmp_socket in net.te and build.
Change-Id: I5c7cb6867d1a4cd1554a8da0d55daa8e06daf803
2018-06-22 05:35:07 +00:00
Inseob Kim
cbc9362685 Merge "Suppress denial for ueventd to getattr"
am: 2c4896852f

Change-Id: Id1617e2d98be5bc10784337e7c2758843dfeb960
2018-06-20 22:17:32 -07:00
Treehugger Robot
2c4896852f Merge "Suppress denial for ueventd to getattr" 2018-06-21 05:05:17 +00:00
Inseob Kim
d8612deee8 Suppress denial for ueventd to getattr
From now on, linker will resolve dir.${section} paths of ld.config.txt.
This is added to suppress SELinux denial during resolving /postinstall.

Bug: http://b/80422611
Test: on taimen m -j, logcat | grep denied, atest on bionic/linker/tests
Change-Id: I12c2bb76d71ae84055b5026933dcaa6ef2808590
2018-06-21 10:31:25 +09:00
Neil Fuller
52494addd2 sepolicy entries for time zone detector service
am: 1662495aec

Change-Id: Id2fbe9d5107acf7bb5c78b5349778bc26fdb7f50
2018-06-20 09:19:20 -07:00
Neil Fuller
1662495aec sepolicy entries for time zone detector service
Add sepolicy entries for the new time zone detector service.

The timezonedetector_service will be called from the
telephony process.

Bug: 78217059
Test: make / booted device
Change-Id: Ib719a4bb444b2af7dd71910fb0bd12992df9d88c
2018-06-19 21:13:57 +01:00
Neil Fuller
1b9c2f9631 Merge "Allow telephony to call system service"
am: b4425a2742

Change-Id: Id0910d5deffbd05a11a3c6a5dd701bb2c7deddfb
2018-06-19 10:10:34 -07:00
Treehugger Robot
b4425a2742 Merge "Allow telephony to call system service" 2018-06-19 17:02:33 +00:00
Mark Salyzyn
8bc025a5f7 Merge "access to /proc/slabinfo"
am: e0637cfc8e

Change-Id: Ie5f10c93d27607879db52177cd498eec0d61f782
2018-06-15 08:04:18 -07:00
Treehugger Robot
e0637cfc8e Merge "access to /proc/slabinfo" 2018-06-15 14:54:46 +00:00
John Stultz
2795f7b976 domain.te: Add map permissions to vendor_config_files
am: 3ba03d6110

Change-Id: I5a3fe73d15dc14570a7518c61b49ac60c14b1330
2018-06-15 07:26:57 -07:00
John Stultz
3ba03d6110 domain.te: Add map permissions to vendor_config_files
For 4.14+ kernels, we need map permissions for vendor_config_files,
for things like kernel loaded firmware blobs, etc.

Change-Id: I8144c50b0239aedf4124569003187cc50c963080
Signed-off-by: John Stultz <john.stultz@linaro.org>
2018-06-14 19:44:34 +00:00
Mark Salyzyn
d6eaed854d access to /proc/slabinfo
init, dumpstate and shell

Test: check avc for init is now gone
Bug: 7232205
Bug: 109821005
Change-Id: I299a0ba29bcc97a97047f12a5c48f6056f5e6de5
2018-06-14 10:18:45 -07:00
Andrew Hsieh
6477ed40d8 Merge "Add ueventd to mnt_vendor_file neverallow exemption list"
am: 22259d11d6

Change-Id: I42738b80ca0268c8f98a746ef5a4e43db2b207d4
2018-06-14 08:45:33 -07:00
Andrew Hsieh
22259d11d6 Merge "Add ueventd to mnt_vendor_file neverallow exemption list" 2018-06-14 15:37:36 +00:00
Jiyong Park
b585f6c028 Merge changes from topic "sharedlib_in_recovery"
am: b6639b0f52

Change-Id: Ib8f626662a1e6e9de105bbbf973215e997079aea
2018-06-13 16:44:51 -07:00
Jiyong Park
d147fd8170 adbd is allowed to execute shell in recovery mode
am: bacf36480d

Change-Id: If48e1b57f1ee20f10c5aac5af5ce52b6433a227a
2018-06-13 16:44:28 -07:00
Treehugger Robot
b6639b0f52 Merge changes from topic "sharedlib_in_recovery"
* changes:
  init is a dynamic executable
  adbd is allowed to execute shell in recovery mode
2018-06-13 23:14:29 +00:00
Jiyong Park
90b21ee4b4 init is a dynamic executable
init is now a dynamic executable. So it has to be able to execute the
dynamic linker (/system/bin/linker) and shared libraries (e.g.,
/system/lib/libc.so). Furthermore, when in recovery mode, the files are
all labeled as rootfs - because the recovery ramdisk does not support
xattr, so files of type rootfs is allowed to be executed.

Do the same for kernel and ueventd because they are executing the init
executable.

Bug: 63673171
Test: `adb reboot recovery; adb devices` shows the device ID
Change-Id: Ic6225bb8e129a00771e1455e259ff28241b70396
2018-06-14 01:56:36 +09:00
padarshr
44ae7c2ccb Add ueventd to mnt_vendor_file neverallow exemption list
Legacy hardware and code still depends on the ueventd helpers to
locate the firmware supported files which are on new mount path
labeled with mnt_vendot_file. For ueventd helper to work we need dir search
and read permission on this new label so moving ueventd to exempted list.

Already ueventd has the vendor_file_type read access.

Bug:110083808

Change-Id: Ia15cc39ecef9e29b4f1f684efdddbeb78b427988
2018-06-13 17:20:34 +05:30
Steven Moreland
c31109b8bd Make hal_allocator use hal_attribute_hwservice.
am: 9099638815

Change-Id: I8a7bc7088823a3fe0f5f2f9768d95510cab45293
2018-06-11 20:50:26 -07:00
Steven Moreland
9099638815 Make hal_allocator use hal_attribute_hwservice.
If you can get or serve the hal allocator interface,
you should be a hal_allocator_client or
hal_allocator_server.

Bug: 80319537
Test: boot aosp_walleye and (sanity) take photos
Change-Id: Iea14c67c4aa56df7a74ebdb17e99b78b1d3aa105
2018-06-11 14:44:12 -07:00
Neil Fuller
60d79e487b Allow telephony to call system service
The timedetector_service will be called from the
telephony process

Bug: 78217059
Test: build / local testing with a client
Change-Id: I25dfa4daabaa80e6b5e697ad1b1e2f7f72377702
2018-06-11 21:27:17 +01:00
Jiyong Park
bacf36480d adbd is allowed to execute shell in recovery mode
The shell is now available directly in the recovery ramdisk. We no
longer need to mount system.img to /system as the recovery ramdisk is
self-contained. However, there is a problem that every file in the
ramdisk is labeled as rootfs because the ramdisk does not support xattr.

This CL adds several recovery-only rules that are required to make the
recovery ramdisk self-contained. Most importantly, adbd is allowed to
domain_trans to shell. Also shell is allowe to execute files of type
rootfs. Finally, the recovery is allowed to mount on tmpfs since it now
mounts system.img to /mnt/system.

Bug: 63673171
Test: `adb reboot recovery; adb devices` shows the device ID
Test: `adb root && adb shell` and then
$ lsof -p `pidof adbd` shows that libm.so, libc.so, etc. are loaded from
the /lib directory.

Change-Id: If21b069aee63541344a5ca8939fb9a46ffef4d3e
2018-06-09 02:23:10 +09:00
Neil Fuller
4a77ea5eb3 Merge "Remove references to common_time / commontime" am: 44b86a3e5e
am: 304857d8be

Change-Id: I9d93260c280e8981a051bc4651a4a4942288acfe
2018-06-07 13:18:23 -07:00
Neil Fuller
44b86a3e5e Merge "Remove references to common_time / commontime" 2018-06-07 15:50:06 +00:00
Steven Moreland
150268e531 Merge "Make hal_configstore consistent." am: a74708966a
am: a4748147d1

Change-Id: I9a371e468c27b2493eee268827b601281e4608a1
2018-06-07 08:23:03 -07:00
Steven Moreland
a74708966a Merge "Make hal_configstore consistent." 2018-06-07 15:10:22 +00:00
Treehugger Robot
7d63911ace Merge "add extended_core_property_type" 2018-06-07 06:08:48 +00:00
Tri Vo
972e06de59 Mechanism to exclude neverallows from *TS. am: 77c44fc420
am: 66e7d2b063

Change-Id: Idd27b85bc97a79ff434412cbbeee74082907553d
2018-06-06 20:46:43 -07:00
Tri Vo
77c44fc420 Mechanism to exclude neverallows from *TS.
build_test_only is used to denote rules that should not verified
as part of compliance testing.

Use this macro to exclude neverallow rules which we want to check as
part of build, but not CTS.

Bug: 80499271
Test: SELinuxNeverallowRulesTest on walleye has no more failure of type
"Type or attribute * used in neverallow undefined in policy being checked."
Number of failing test cases is reduced by 142.
Test: policy.conf used to check neverallows at build-time still retains
all neverallow rules.
Change-Id: I5f1b383d9096bb5a7b8c0f1bc008b5dd07419580
2018-06-06 14:51:39 -07:00
Steven Moreland
fdc9f48414 Merge changes from topic "b80319537" am: 0578a39451
am: 337c0969f0

Change-Id: I7d20e245851c049db4217b762acd8b6c71fbfe8c
2018-06-06 13:15:28 -07:00
Jeff Vander Stoep
d1f07835a7 Merge "Deprivilege haiku" am: 59f8e75a5d
am: b204ad930c

Change-Id: I23dd498f88e5d4fbff520defeef5baf7329e9ea4
2018-06-06 13:15:09 -07:00
Steven Moreland
ac88cb6101 Make hal_configstore consistent.
Previously, supposedly, each individual client of configstore
was supposed to add the add_hwservice attribute itself to get
ahold of the specific sub-interface of configstore relevant to
it. However, there is only one configstore interface,
ISurfaceFlingerConfigs.

From this point onward, the configstore hal is to be thought of
as specifically relating to surface flinger. Other properties
may be added as other attributes/packages.

For instance, if we want a configstore entry for 'IFooConfig',
then we would add the configuration to one of the following
packages:
- android.hardware.foo@X.Y (to the interface itself)
- android.hardware.foo.config@X.Y (to a configuration of the interface)
- android.hardware.configstore.foo@X.Y (as a sub-interface of configstore)

and then it could be associated with the sepolicy attributes
(respectively):
- hal_foo
- hal_foo_config (or just hal_foo if they are 1-1)
- hal_configstore_foo

The specific pattern to be followed irrelevant to this CL
and subject to future discussion, the point being that we're going
to have a separate sepolicy attribute (and package, although this
isn't strictly necessary) for each separate domain's configuration.

Fixes: 109806245
Test: boot walleye, check for denials
Change-Id: If661e3fca012017a6c854fe3f02df4b779d514df
2018-06-06 13:01:17 -07:00
Treehugger Robot
0578a39451 Merge changes from topic "b80319537"
* changes:
  hal_attribute_hwservice_client drop '_client'
  hal_attribute_hwservice_client += add_hwservice
2018-06-06 18:25:00 +00:00
Treehugger Robot
59f8e75a5d Merge "Deprivilege haiku" 2018-06-06 17:18:07 +00:00
Steven Moreland
9234e00daf hal_attribute_hwservice_client drop '_client'
Since this attribute just associates a hal_attribute
with a given hwservice in the standard way.

Bug: 80319537
Test: boot + sanity + test for denials
Change-Id: I545de165515387317e6920ce8f5e8c491f9ab24e
2018-06-06 09:30:18 -07:00
Steven Moreland
343e24a1be hal_attribute_hwservice_client += add_hwservice
For sanity, this makes 'hal_attribute_hwservice_client'
be associated with a specific hwservice thus making things
consistent.

After this change, only configstore, hal_allocator, and the
fwk_* services are inconsistent with all other HALs.

Bug: 80319537
Test: boot device, sanity tests, check for denials
Change-Id: Ibffc65c9567a429e07a3dc4dd41117738459dc2a
2018-06-06 09:25:52 -07:00
Neil Fuller
c9fa040d1c Remove references to common_time / commontime
This change removes references to the common time management
service.

Bug: 80462439
Test: build / boot
Merged-In: I2c8fca44fe05e3a35f5580d23e23a4c033075613
Change-Id: I2c8fca44fe05e3a35f5580d23e23a4c033075613
2018-06-06 17:02:44 +01:00
Joel Galenson
f41d85ca64 Merge "Allow ephemeral_app to execute system_file." into pi-dev
am: 398f72e3fd

Change-Id: Ib41908cbbf800bc1f3c2c4f639ab11c4b900d638
2018-06-05 21:07:16 -07:00
Treehugger Robot
e5616f0d24 Merge "neverallow coredomain from writing vendor properties" 2018-06-06 03:54:11 +00:00
TreeHugger Robot
398f72e3fd Merge "Allow ephemeral_app to execute system_file." into pi-dev 2018-06-06 03:31:50 +00:00
Tri Vo
986f9ef5f3 Merge "Revert "Remove neverallow coredomain to set vendor prop."" into pi-dev
am: c75bef086f

Change-Id: If12976c0cd028c2e4cb35323019d953221998f30
2018-06-05 19:48:45 -07:00
Tri Vo
c75bef086f Merge "Revert "Remove neverallow coredomain to set vendor prop."" into pi-dev 2018-06-06 02:07:50 +00:00
Joel Galenson
f2afca7cf0 Allow ephemeral_app to execute system_file.
Bug: 109653662
Test: Build policy.
Change-Id: I6c71a8bc24d7a144b801d16f1bcad31fb8f2aba5
2018-06-05 17:56:30 -07:00
TreeHugger Robot
c0ee12ea82 Merge "ephemeral_app: disallow access to qtaguid files" into pi-dev 2018-06-05 21:14:18 +00:00
Steven Moreland
8169f6b6ae Merge "Add context for ro.boot.product.hardware.sku." 2018-06-05 21:08:41 +00:00
Wale Ogunwale
dcf42c11f4 Merge "Added sepolicy for activity_task service" am: 2b7fbbe917
am: 93c6a36b07

Change-Id: If0038600c1fe4c97f55b3a09038586546ab1647c
2018-06-05 09:17:45 -07:00
Treehugger Robot
2b7fbbe917 Merge "Added sepolicy for activity_task service" 2018-06-05 16:02:51 +00:00
Steven Moreland
68e58a474b Merge "Find hal_foo_hwservice -> you are hal_foo_client." am: 58f4c6f01b
am: 0b783e875a

Change-Id: I6d760e257df73b8bf065563c9a1949cd8edca54a
2018-06-05 08:33:57 -07: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
Jeff Vander Stoep
069f3cff50 ephemeral_app: disallow access to qtaguid files
Apps targeting API version 28+ are not allowed to access:
/proc/xt_qtaguid/*
/dev/xt_qtaguid

Instant apps should also be excluded from access.

Fixes: 92796393
Test: make -j cts_instant
    cts-instant-tradefed run commandAndExit cts-instant-dev \
    -m CtsPermissionTestCases \
    --test android.permission.cts.FileSystemPermissionTest

Change-Id: Ifa27f6a3fad9227d4df1bf50a5120a4c36422ff7
Merged-In: I7e49f796a25cf68bc698c6c9206e24af3ae11457
2018-06-04 21:56:55 -07:00
Neil Fuller
a7d92c64d6 Merge "selinux changes to add time detector service" am: 93953d0be6
am: c45525f7e3

Change-Id: I889eb40edaf765cdd7a7555403070cca4d0e2dd5
2018-06-04 17:07:38 -07:00
Steven Moreland
d47b09f1d9 Add context for ro.boot.product.hardware.sku.
This was defined, but it had no users in the Android tree.
Because of this, ODM manifests required extra sepolicy to be applied
in vendor. Before this, there was no policy split, so that was okay,
but now it is impossible.

Bug: 91735839
Test: add an odm manifest for SE conditional on
    a system property (ro.boot.product.hardware.sku)
    and make sure it is read into the manifest (using
    the vintf tool) and also that a client can get the
$ lshal | grep secure
Y android.hardware.secure_element@1.0::ISecureElement/SIM1                                  0/2        881    2262 567

Change-Id: I94a2928943be6a17416b8bbd78106809c0c21198
Merged-In: I94a2928943be6a17416b8bbd78106809c0c21198
2018-06-04 12:38:52 -07: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
f45db06c2b Deprivilege haiku
Clatd and zygote
are all overprivileged
as is storaged

Test: Verify no "granted" messages from dogfooders. Build flash
aosp_taimen-userdebug. Verify no denials.
Change-Id: I735adcffed553962ad12072716a7200883930dcf
2018-06-04 11:07:08 -07:00
Steven Moreland
1c6d0b2eb1 Merge "Add context for ro.boot.product.hardware.sku." into pi-dev
am: ce944f0294

Change-Id: I0ae38bc922a057ae0a49d4b228cb280961c0b956
2018-06-04 11:04:27 -07:00
TreeHugger Robot
ce944f0294 Merge "Add context for ro.boot.product.hardware.sku." into pi-dev 2018-06-04 17:26:58 +00:00
huans
3265c6efb2 emulator: Whitelist ro.kernel.qemu. parameters
am: 66b55782b8

Change-Id: I1315d4150230ef4e2b513c582f824bca97600d30
2018-06-04 10:14:50 -07:00
Steven Moreland
5516acc6ab Add context for ro.boot.product.hardware.sku.
This was defined, but it had no users in the Android tree.
Because of this, ODM manifests required extra sepolicy to be applied
in vendor. Before this, there was no policy split, so that was okay,
but now it is impossible.

Bug: 91735839
Test: add an odm manifest for SE conditional on
    a system property (ro.boot.product.hardware.sku)
    and make sure it is read into the manifest (using
    the vintf tool) and also that a client can get the
$ lshal | grep secure
Y android.hardware.secure_element@1.0::ISecureElement/SIM1                                  0/2        881    2262 567

Change-Id: I94a2928943be6a17416b8bbd78106809c0c21198
2018-06-01 18:23:55 -07:00
huans
66b55782b8 emulator: Whitelist ro.kernel.qemu. parameters
And ro.kernel.android.bootanim (used to en/disable boot-anim)

Bug: 79941736
Test: Manual
Change-Id: Ib486903dec92df88b4d33bad6262cbcfc2aa1c4c
2018-06-01 10:48:31 -07:00
Tri Vo
ba79e154e5 Revert "Remove neverallow coredomain to set vendor prop."
Bug: 80466516
Bug: 78598545
This reverts commit 6f6fbebcef.

Change-Id: I3c0f374b846241571b5db6f061503f0ea2d6396a
2018-06-01 16:37:38 +00:00
Jiyong Park
d8ae007189 add extended_core_property_type
The attribute is used to capture system properties added from outside of
AOSP (e.g. by OEM), but are not device-specific and thus are used only
inside the system partition.

Access to the the system properties from outside of the system partition
is prevented by the neverallow rule.

Bug: 80382020
Bug: 78598545
Test: m -j selinux_policy
Merged-In: I22c083dc195dab84c9c21a79fbe3ad823a3bbb46
Change-Id: I22c083dc195dab84c9c21a79fbe3ad823a3bbb46
(cherry picked from commit c0f8f2f82a)
2018-06-01 13:27:54 +09:00
Tom Cherry
5897e23ea1 neverallow coredomain from writing vendor properties
System properties can be abused to get around Treble requirements of
having a clean system/vendor split.  This CL seeks to prevent that by
neverallowing coredomain from writing vendor properties.

Bug: 78598545
Test: build 2017 Pixels
Test: build aosp_arm64
Change-Id: I5e06894150ba121624d753228e550ba9b81f7677
(cherry picked from commit cdb1624c27)
2018-06-01 13:26:49 +09:00
Tri Vo
b4fe8e1feb Remove neverallow coredomain to set vendor prop.
am: 6f6fbebcef

Change-Id: Ie793eff4736f8a9b351114c3fd9bd1bdcd22ab49
2018-05-31 17:56:37 -07:00
Jiyong Park
029f415d48 Merge "add extended_core_property_type" into pi-dev
am: d009682c2e

Change-Id: Ie821be484067f0ff5d06aac66a3b020d6e853d1a
2018-05-31 17:08:35 -07:00
Tri Vo
6f6fbebcef Remove neverallow coredomain to set vendor prop.
We are not forbidding system_writes_vendor_properties_violators in P,
i.e. this neverallow rule is not strictly enforced.

Bug: 80466516
Bug: 78598545
Test: build policy
Change-Id: Iaf0ebbd2b27adf8c48082caa874e53f32bf999fc
2018-05-31 23:46:02 +00:00
TreeHugger Robot
d009682c2e Merge "add extended_core_property_type" into pi-dev 2018-05-31 22:45:21 +00:00
Tri Vo
ef6ea22264 Use hal_attribute for all HALs. am: 1156d59389
am: c652c767de

Change-Id: I871412d49d3367a837a0203e7cab98aa05b96072
2018-05-30 18:32:43 -07: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
d0c4d4e7db mediacodec->mediacodec+hal_omx{,_server,_client} am: 7baf725ea6
am: 6ad7e65447

Change-Id: I9b60e71be957d43f66605958915d3cfb45d42573
2018-05-30 13:51:23 -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
Jeff Vander Stoep
85f508b83b Merge "Improve tests protecting private app data" am: db459a1b71
am: c4b2a88b9b

Change-Id: I6a0a5b778c209401cae33af605e66ab12db03aef
2018-05-30 09:34:40 -07:00
Treehugger Robot
db459a1b71 Merge "Improve tests protecting private app data" 2018-05-30 16:20:31 +00:00
Jiyong Park
c0f8f2f82a add extended_core_property_type
The attribute is used to capture system properties added from outside of
AOSP (e.g. by OEM), but are not device-specific and thus are used only
inside the system partition.

Access to the the system properties from outside of the system partition
is prevented by the neverallow rule.

Bug: 80382020
Bug: 78598545
Test: m -j selinux_policy
Change-Id: I22c083dc195dab84c9c21a79fbe3ad823a3bbb46
2018-05-30 17:38:09 +09: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
Jeff Vander Stoep
b16d0e1272 Merge "Use non-expanded types in prop neverallows" into pi-dev
am: b5e493d821

Change-Id: Ib877668feb90ab58b21e5d62735f1bb03fc5eb9a
2018-05-24 16:57:07 -07:00
TreeHugger Robot
b5e493d821 Merge "Use non-expanded types in prop neverallows" into pi-dev 2018-05-23 19:08:01 +00:00
Jeff Vander Stoep
7745770bca Use non-expanded types in prop neverallows
Using hal_foo attributes in neverallow rules does not work because
they are auto-expanded to types. Use hal_foo_server types instead.

Fixes the following error:
unit.framework.AssertionFailedError: The following errors were
encountered when validating the SELinuxneverallow rule: neverallow
{ domain -coredomain -bluetooth -hal_bluetooth } { bluetooth_prop }:
property_service set; Warning! Type or attribute hal_bluetooth used
in neverallow undefined in policy being checked.

Test: CtsSecurityHostTestCases
Bug: 80153368
Change-Id: I2baf9f66d2ff110a4f181423790a1160a6e138da
2018-05-23 10:03:15 -07: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
Tom Cherry
e21e9e6373 Merge "Finer grained permissions for ctl. properties" into pi-dev
am: 0e403c8242

Change-Id: I778a16ae2bcc5713ba3ca1c81fd90c97b0a5d64d
2018-05-22 13:26:42 -07:00
Tom Cherry
2208f96e9e 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

Change-Id: Ibe0cc0d6028fb0ed7d6bcba626721e0d84cc20fa
2018-05-22 09:13:16 -07:00
Tom Cherry
bab2435a06 Merge "neverallow coredomain from writing vendor properties" into pi-dev
am: e5cc744d18

Change-Id: I66f2965200090a4ded857c6eb9ac6b79ee5b596c
2018-05-21 22:10:10 -07:00
TreeHugger Robot
e5cc744d18 Merge "neverallow coredomain from writing vendor properties" into pi-dev 2018-05-22 05:04:40 +00:00
Logan Chien
60227ea7c0 Merge "Add ro.vndk.lite to property_contexts" 2018-05-22 04:04:07 +00:00
TreeHugger Robot
fd00fd123d Merge "ueventd: allow reading kernel cmdline" into pi-dev 2018-05-21 23:14:38 +00:00
Paul Crowley
c9e9b326d0 Merge "Move more metadata policy from device to here" into pi-dev
am: 5252ad93e2

Change-Id: I591f253f82a91b1e953f46ff2c29e48e4929665b
2018-05-21 10:46:45 -07:00
TreeHugger Robot
5252ad93e2 Merge "Move more metadata policy from device to here" into pi-dev 2018-05-21 17:36:12 +00:00
Bowgo Tsai
282fc3e48e 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
(cherry picked from commit 98ef2abb12)
2018-05-21 09:55:41 +08:00
Frank Salim
956b93623a Merge "Add ro.hardware.keystore_desede" into pi-dev
am: a0f9509908

Change-Id: I8fed87b5514516d2dcb8d1796ee42ca081ee490d
2018-05-18 16:04:36 -07:00
Frank Salim
a0f9509908 Merge "Add ro.hardware.keystore_desede" into pi-dev 2018-05-18 22:49:00 +00:00
Paul Crowley
bb3ba3e5d9 Move more metadata policy from device to here
Test: booted metadata-encrypted device
Bug: 79781913
Change-Id: Ib4cb4a04145e5619994083da055f06fe7ae0137a
2018-05-18 14:12:40 -07:00
Frank Salim
6fe4ef7e8c Add ro.hardware.keystore_desede
This allows Android Keystore to statically register support for 3DES
during zygote initialization based on the device's support for hardware
backed 3DES keys.

Bug: b/79986680
Test: keystore CTS
Change-Id: Ic9a6653cdd623a3ab10e0efbcdb37c437e6c59b9
2018-05-18 18:25:44 +00:00
Tom Cherry
cdb1624c27 neverallow coredomain from writing vendor properties
System properties can be abused to get around Treble requirements of
having a clean system/vendor split.  This CL seeks to prevent that by
neverallowing coredomain from writing vendor properties.

Bug: 78598545
Test: build 2017/2018 Pixels
Test: build aosp_arm64
Change-Id: I5e06894150ba121624d753228e550ba9b81f7677
2018-05-18 20:15:19 +09:00
Bowgo Tsai
4951aa3037 Merge "ueventd: allow reading kernel cmdline" am: 1606d5601a
am: 46bffaba08

Change-Id: I7780fbd7eada856aebcb3a1270a112f266a326d0
2018-05-17 23:08:08 -07:00
Treehugger Robot
1606d5601a Merge "ueventd: allow reading kernel cmdline" 2018-05-18 05:55:00 +00:00
Jaegeuk Kim
5580a18255 Merge "dumpstate: allow /metadata for df" into pi-dev
am: e2f70ebc07

Change-Id: Ic56b485f0297178d45061c0b6b7fb44fbb0b0fa5
2018-05-17 18:14:01 -07:00
TreeHugger Robot
e2f70ebc07 Merge "dumpstate: allow /metadata for df" into pi-dev 2018-05-18 00:38:09 +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
Treehugger Robot
5deb7f4e20 Merge "Allow dumpstate to kill dumpstate vendor HAL in timeout case" 2018-05-17 16:41:11 +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
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
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
TreeHugger Robot
4c2e89baf8 Merge "domain.te & kernel.te: allow kernel to write nativetest_data_file" into pi-dev 2018-05-16 16:36:26 +00:00
Yongqin Liu
8c3a74ad64 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.

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

Change-Id: I3f46ff874d3dbcc556cfbeb27be21878574877d1
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
(cherry picked from commit 64ff9e9523)
Merged-In: I3f46ff874d3dbcc556cfbeb27be21878574877d1
2018-05-16 07:46:17 -07:00
Logan Chien
921a881bf8 Merge "Add ro.vndk.lite to property_contexts" into pi-dev
am: 52fd4141b8

Change-Id: Ia4d8ebc74987c18a6390884a71ad0ea9b497b1cf
2018-05-16 02:46:03 -07:00
Logan Chien
52fd4141b8 Merge "Add ro.vndk.lite to property_contexts" into pi-dev 2018-05-16 09:38:57 +00:00
Yongqin Liu
791cdb6ee8 Merge "domain.te & kernel.te: allow kernel to write nativetest_data_file" am: 117d69fd2a
am: e3b2d105c7

Change-Id: Ie35e37e79cecd9176a353aa86e733725c5ba930e
2018-05-15 20:47:20 -07: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
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
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
Pavel Maltsev
236085406b Merge "Allow to use sockets from hal server for auto" into pi-dev
am: 175f23eca4

Change-Id: Icf339629d09ddf5a316e21e39a05e42cb63c9b85
2018-05-14 18:29:06 -07:00
TreeHugger Robot
175f23eca4 Merge "Allow to use sockets from hal server for auto" into pi-dev 2018-05-15 01:18:18 +00:00
Joel Galenson
f8e1cf4354 Merge "Allow vendor_init to getattr vold_metadata_file." into pi-dev
am: e2c2a85e60

Change-Id: Ie09ba0e54a005eef0aacf159fd5795acfddf54cc
2018-05-14 16:55:39 -07:00
Pavel Maltsev
4cafae77a4 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

Change-Id: I27976443dad4fc5b7425c089512cac65bb54d6d9
2018-05-14 14:36:19 -07:00
Joel Galenson
597be44e96 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
2018-05-14 13:08:46 -07:00
Logan Chien
9f55f3455f Add ro.vndk.lite to property_contexts
Bug: 78605339
Test: aosp_walleye-userdebug builds
Change-Id: I37c84e20f2284d50cbe29bfa1b7597dd2c01fb4b
2018-05-14 14:46:47 +08:00
Jaegeuk Kim
18096f9c64 dumpstate: allow /metadata for df
[  196.680228] type=1400 audit(1526230655.786:26): avc: denied { getattr } for
 pid=7159 comm="df" path="/metadata" dev="sda20" ino=2 scontext=u:r:dumpstate:s0
 tcontext=u:object_r:metadata_file:s0 tclass=dir permissive=0

Bug: 66967195
Bug: 79552162
Test: adb bugreport
Change-Id: Ib2abbc35e04a69992fa09a596694f428d3adc7c1
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-05-13 10:13:59 -07:00
TreeHugger Robot
d9c7a6068c Merge "Whitelist dalvik.vm.profilebootimage" into pi-dev 2018-05-12 04:08:03 +00:00
Calin Juravle
54fc209a48 Whitelist dalvik.vm.profilebootimage
The property is set on builds which profile the boot image.

Test: m
Bug: 73313191

(cherry-pick form commit d99f4acf2d)

Merged-In: Ie0cd54f23250df02850c38bb14e92d4b1fa04f16
Change-Id: Ie0cd54f23250df02850c38bb14e92d4b1fa04f16
2018-05-12 01:52:19 +00:00
Mark Salyzyn
2cdcdc6ec0 Merge "FrameworksServicesTests: allow access to test.sys.boot.reason property" into pi-dev 2018-05-10 23:06:17 +00:00
Mark Salyzyn
a60f4103ca llkd: add live-lock daemon am: e4b3e0b684
am: 2ab619226d

Change-Id: I3d441fd18d91680d8a5bf0732472c2f470076e02
2018-05-10 15:20:34 -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
Calin Juravle
91989fcea5 Merge "Allow system server to write profile snapshots in /data/misc/profman" into pi-dev
am: dfaf39154f

Change-Id: I6f12c21a6c1cfda7d4a3b556e7f6066d0c2782c0
2018-05-09 14:49:25 -07: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
Calin Juravle
dfaf39154f Merge "Allow system server to write profile snapshots in /data/misc/profman" into pi-dev 2018-05-09 21:35:08 +00:00
Calin Juravle
687d5e46ce 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
Change-Id: I54690305284b92c0e759538303cb98c93ce92dd5
2018-05-09 11:41:39 -07:00
Mark Salyzyn
1b748766e3 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-09 11:01:39 -07:00
Mark Salyzyn
afb0ca6132 Merge "init: support /dev/input" am: 2a3f55b5e0
am: 263d71b0ce

Change-Id: I54b95186892fcb380412c16e758a061de36eb430
2018-05-09 10:58:19 -07:00
Mark Salyzyn
2a3f55b5e0 Merge "init: support /dev/input" 2018-05-09 16:49:56 +00:00
Dongwon Kang
f261c7f5e7 Merge "Allow sdcardfs:file read access on mediaextractor" 2018-05-09 00:08:17 +00:00
android-build-team Robot
07851d2ff4 Merge "Allow sdcardfs:file read access on mediaextractor" into pi-dev
am: 351b9a3796

Change-Id: I08b9ffb9e7b859deb22e7242edfecc73c2dc7af8
2018-05-08 15:36:44 -07:00
android-build-team Robot
351b9a3796 Merge "Allow sdcardfs:file read access on mediaextractor" into pi-dev 2018-05-08 22:25:41 +00:00
android-build-team Robot
b58e715b44 Merge "Whitelist reading property ro.aac_drc_effect_type" into pi-dev
am: adf00fa82e

Change-Id: I212016bcd828b363c4af041e02a365e636d902a8
2018-05-07 15:15:37 -07:00
Jean-Michel Trivi
41795cdf6d Whitelist reading property ro.aac_drc_effect_type
Bug: 71430241
Test: build/flash, grep for "avc: denied { read }" for mediacodec, should be empty on walleye
Change-Id: I12e1b11a969d3f979ca0cfbe4ca7db2bc5e46165
2018-05-07 12:28:17 -07:00
Mark Salyzyn
5e6b6bc421 init: support /dev/input
Test: compile
Bug: 64114943
Change-Id: I2bbf84a6e472d720f02282e10d56795b75ac62d1
2018-05-07 14:28:24 +00:00
Jeff Vander Stoep
1279a7ae85 resolve merge conflicts of bc34fa26ac to pi-dev-plus-aosp
Bug: None
Test: None
Change-Id: Ie9d2f35efd5bf39d0282ccc41fdd3f974d7c01bf
2018-05-04 19:03:03 -07:00
Josh Gao
d018b5ce2c Merge changes from topic "tombstoned_empty" into pi-dev
* changes:
  Update sepolicy prebuilts for tombstoned.
  tombstoned: allow linking tombstones.
2018-05-04 21:37:22 +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)
64d56f81f8 Merge "FrameworksServicesTests: allow access to test.sys.boot.reason property" am: 8c139df845
am: 8f0e92bbfa

Change-Id: I5fc7d670c79d5415e5fdce3e17c033ea8a437bbd
2018-05-04 14:30:39 -07:00
android-build-prod (mdb)
8c139df845 Merge "FrameworksServicesTests: allow access to test.sys.boot.reason property" 2018-05-04 21:19:46 +00:00
Jeffrey Vander Stoep
54f61fe53c Merge "Never expand proc_type attribute" 2018-05-04 20:10:28 +00:00
Jeffrey Vander Stoep
b8d870c18b Merge "Revert "FrameworksServicesTests: allow access to test.sys.boot.reason property"" am: bba94f80bb
am: cbae15fd69

Change-Id: I5941463f4252da1c6b77e685b5b4bdd13c53dc1b
2018-05-04 07:35:55 -07: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
android-build-prod (mdb)
76f59094b9 Merge "FrameworksServicesTests: allow access to test.sys.boot.reason property" am: 0e055173b1
am: 40f6019c7b

Change-Id: I0792ae4deffa2532315673d824502fc8c03e3651
2018-05-03 16:38:34 -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
Tri Vo
bfe1e42143 Merge "SELinux type for vendor public libs." am: 59e9d2d8c9
am: 9d99ee2316

Change-Id: I50978971a2cf6221024d91edde0cb85b9415f7be
2018-05-03 13:11:21 -07:00
Tri Vo
59e9d2d8c9 Merge "SELinux type for vendor public libs." 2018-05-03 19:52:58 +00:00
Pavel Maltsev
25444a2252 Merge "Allow auto HAL clients to access hw services" into pi-dev
am: 53c6578ff2

Change-Id: Iae7cf1baecc889cbb2c621be279cd9b40ffa852b
2018-05-03 10:13:52 -07:00
Pavel Maltsev
53c6578ff2 Merge "Allow auto HAL clients to access hw services" into pi-dev 2018-05-03 16:58:58 +00: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
android-build-team Robot
4a4411782a Merge "Never expand proc_type attribute" into pi-dev
am: d8d7a3f7cc

Change-Id: Ibd8dc38bf69f85a9ef05ee1eee668a11c6262657
2018-05-03 07:47:03 -07:00
android-build-team Robot
d8d7a3f7cc Merge "Never expand proc_type attribute" into pi-dev 2018-05-03 14:29:48 +00:00
Jeff Vander Stoep
db6218417c Never expand proc_type attribute
It's used in build-time tests and in CTS.

Bug: 78898770
Test: build user-build
Change-Id: I254bf4d7ed0c0cb029b55110ceec982b84e4a91b
(cherry picked from commit beeb122405070a5b4cee326a0cdae92a1a791fbc)
2018-05-02 15:00:55 -07:00
android-build-prod (mdb)
fd0ac5d6ac Merge "tombstoned: allow linking tombstones." am: c4ec97ab1f
am: aadd0e99a6

Change-Id: Ic2318d08722a078eb78692a3f3d404b1b460cd99
2018-05-02 14:56:46 -07:00
Tri Vo
29497b623e SELinux type for vendor public libs.
Vendor public libs are exposed to apps (not system), and their ABI
stability is guaranteed by vendor. Introducing new selinux type so that
we don't conflate concepts of same-process HAL and vendor public lib.
The former is exposed to all domains, while the latter should only be
acessible by apps.

Bug: 76413554
Test: build-only change, policy builds
Change-Id: I89dad351374f46c7fe2726991eb4c05064c37ed5
2018-05-02 14:51:05 -07:00
Josh Gao
5159b1c9d6 tombstoned: allow linking tombstones.
Bug: http://b/77729983
Test: debuggerd_test
Test: adb shell 'for x in `seq 0 50`; do crasher; done'
Change-Id: I1d86d04047240a85b2e987116efd9be59607b766
(cherry picked from commit a7bf5810da)
2018-05-02 14:44:18 -07:00
android-build-prod (mdb)
c4ec97ab1f Merge "tombstoned: allow linking tombstones." 2018-05-02 21:43:03 +00:00
Andrew Sapperstein
2ed7ba3d44 Merge "Add ro.oem.key1 to SELinux policy." into pi-dev
am: b12ca61e9c

Change-Id: Ib7b77f1e82e5d653a9cf54d7f52a284f6491be72
2018-05-02 14:24:53 -07:00
Andrew Sapperstein
b12ca61e9c Merge "Add ro.oem.key1 to SELinux policy." into pi-dev 2018-05-02 21:10:41 +00:00
android-build-team Robot
9d4573c448 Merge changes Ic3f85992,I33f47db7 into pi-dev
* changes:
  Sepolicy: Modify postinstall_dexopt
  Sepolicy: Modify postinstall_dexopt
2018-05-02 18:52:02 +00:00
Andrew Sapperstein
99bfd8efdf Add ro.oem.key1 to SELinux policy.
vendor-init-settable|public-readable

Change-Id: I8262cc03150931080c0982350cd990ee8f5422bc
Fixes: 78636965
Test: adb shell getprop ro.oem.key1
2018-05-02 11:48:30 -07:00
Tri Vo
7db0bddbd1 Merge "init: restrict setattr perms to /proc." am: 4bb33bc38f
am: 12a0f7b922

Change-Id: Ifea0a56a82106e88159b319ec2317566a9d088e5
2018-05-02 11:31:29 -07:00
Tri Vo
4bb33bc38f Merge "init: restrict setattr perms to /proc." 2018-05-02 18:18:49 +00:00
Pavel Maltsev
368ae61fc7 Allow auto HAL clients to access hw services
Bug: 70637118
Test: m && emulator ; also verified on bat_land
Change-Id: I39dd17d20acc8d380f36e207679b8b1eba63a72e
2018-05-02 09:54:40 -07:00
android-build-prod (mdb)
5afce15046 Merge "Audit generic debugfs access for removal" am: 65352c904a
am: 810ad5f27b

Change-Id: I8e5cf7eaf9eb290090adfb5c2821a7efdd9e1acf
2018-05-01 23:11:36 -07:00
android-build-prod (mdb)
65352c904a Merge "Audit generic debugfs access for removal" 2018-05-02 06:00:04 +00:00
android-build-prod (mdb)
73d7cabfb9 Merge "Only installd and init may relabel app_data_file." am: 577b7a5d7b
am: 8f867acb4a

Change-Id: I3071aeb263d81cd27d8a8ba8897d6ca1e4193887
2018-05-01 16:45:14 -07:00
android-build-prod (mdb)
577b7a5d7b Merge "Only installd and init may relabel app_data_file." 2018-05-01 23:35:16 +00:00
Jaekyun Seok
d097ff9516 Allow vendor-init-settable for properties used in Android TV
The following properties will be whitelisted.
- ro.hdmi.device_type, ro.hdmi.wake_on_hotplug and
persist.sys.hdmi.keep_awake for hdmi
- ro.sf.disable_triple_buffer for SurfaceFlinger
- media.stagefright.cache-params and persist.sys.media.avsync for
nuplayer

Bug: 78205669
Bug: 78430613
Test: succeeded building
Change-Id: I5ee1a1de72c265bca87aa041c6acd9554f5f8c07
Merged-In: I5ee1a1de72c265bca87aa041c6acd9554f5f8c07
(cherry picked from commit 18aaaad937)
2018-05-02 07:41:52 +09:00
android-build-prod (mdb)
3aba4744ed Merge "Allow vendor-init-settable for properties used in Android TV" am: b87d8c0551
am: 3fd5794d2b

Change-Id: Ifbebeca1a833aa7ebb57169337fb7d64849b0599
2018-05-01 15:29:33 -07:00
android-build-prod (mdb)
b87d8c0551 Merge "Allow vendor-init-settable for properties used in Android TV" 2018-05-01 22:17:49 +00:00