Commit graph

1271 commits

Author SHA1 Message Date
Inseob Kim
dc1e5019d6 Rename system_radio_prop
For whatever reason sys.usb.config* has been labeled as
system_radio_prop, which doesn't make sense. Changing context name as
usb_prop. For the same reason exported_system_radio_prop is also
renamed to usb-related names.

Bug: 71814576
Bug: 154885206
Test: m selinux_policy
Change-Id: If30bc620dbeac926a8b9bcde908357fda739a6c1
Merged-In: If30bc620dbeac926a8b9bcde908357fda739a6c1
(cherry picked from commit 44fbcdb677)
2020-05-15 15:06:10 +09:00
Collin Fijalkovich
77efb419f3 Allow ActivityManagerService to start cacheDump service.
Configures SELinux to allow ActivityManagerService to start a cacheinfo
service that is responsible for dumping per-process cache state.

Bug: 153661880
Test: adb shell dumpsys cacheinfo
Test: adb bugreport
Change-Id: Id6a4bdf2a9cb6d7f076b08706e0f91d377f38603
2020-05-13 11:20:10 -07:00
Inseob Kim
1337e15717 Add new context dalvik_runtime_prop
persist.sys.dalvik.vm.lib.2 is moved to a new context
dalvik_runtime_prop from bad context name.

Bug: 154885206
Test: boot device and see logcat
Change-Id: I9dea95105c266088d5f071bf2d890048f0999b0b
2020-05-13 23:33:03 +09:00
Inseob Kim
6da0ab70d3 Merge "Move media.* properties to media_config_prop" 2020-05-13 03:24:35 +00:00
Treehugger Robot
993baf3954 Merge "Relabel ro.build. properties" 2020-05-13 02:36:54 +00:00
Inseob Kim
bfb10a9bc0 Move media.* properties to media_config_prop
Bug: 154885206
Bug: 155844385
Test: m selinux_policy
Change-Id: Idfbafd29c51f7ce4512ea0d88fc7534e28eb1738
2020-05-13 09:38:08 +09:00
Inseob Kim
8c23925351 Relabel ro.build. properties
- exported_fingerprint_prop is deleted
- other ro.build. properties become build_prop

Bug: 155844385
Test: sepolicy_tests
Change-Id: Ic1194e8e7c23394e5a7c6176f9f9598109bb5fb7
Merged-In: Ic1194e8e7c23394e5a7c6176f9f9598109bb5fb7
(cherry picked from commit 1d63d5d075)
2020-05-13 09:01:47 +09:00
Inseob Kim
df0008802e Add hdmi_config_prop for hdmi properties
To remove bad context names.

Bug: 154885206
Bug: 155844385
Test: m selinux_policy
Change-Id: I5712bf836e07b3b26a51c3433234b986843076ea
2020-05-12 23:04:51 +09:00
Treehugger Robot
dc33d3f15e Merge "Rename context names of zram properties" 2020-05-12 13:12:57 +00:00
Treehugger Robot
a00b1ea2db Merge "Move aac_drc props to aac_drc_prop" 2020-05-12 04:49:56 +00:00
Inseob Kim
8880f7700a Merge "Rename contexts of ffs props" 2020-05-12 03:52:18 +00:00
Inseob Kim
36aeb16b86 Rename context names of zram properties
Moving from old bad name "exported*_prop".

Bug: 154885206
Bug: 155844385
Test: m selinux_policy
Change-Id: I21af42980e5e6e2c3cabea6c36825fa2836a55bc
2020-05-12 10:02:31 +09:00
Treehugger Robot
98316f23ab Merge "Move camera config props to camera_config_prop" 2020-05-12 00:16:48 +00:00
Inseob Kim
bdcbcf0742 Move aac_drc props to aac_drc_prop
Bug: 155844385
Test: sepolicy_tests
Change-Id: I1755672b5cef876955f93020c519aaaabf814bbf
2020-05-12 08:21:42 +09:00
Inseob Kim
a28428e7bf Move camera config props to camera_config_prop
Bug: 155844385
Test: sepolicy_tests
Change-Id: Iebe81d9af48e68e6499272bd5815e959f5945567
2020-05-11 21:55:26 +09:00
Inseob Kim
9add20f31e Move libc.debug. props to libc_debug_prop
Bug: 155844385
Test: sepolicy_tests
Change-Id: I15421ada0c58c3c8d07d824e83cf44f6c4590ca8
2020-05-11 21:29:26 +09:00
Inseob Kim
bfb3708234 Rename contexts of ffs props
Bug: 71814576
Bug: 154885206
Test: m sepolicy_test
Change-Id: Idacc3635851b14b833bccca177d784f4bb92c763
2020-05-11 21:23:37 +09:00
Inseob Kim
ace36abec5 Add 30.0 mapping files
Steps taken to produce the mapping files:

1. Add prebuilts/api/30.0/plat_pub_versioned.cil from the
/vendor/etc/selinux/plat_pub_versioned.cil file built on rvc-dev with
lunch target aosp_arm64-eng. Add prebuilts/api/30.0/vendor_sepolicy.cil
as an empty file.

2. Add new file private/compat/30.0/30.0.cil by doing the following:
- copy /system/etc/selinux/mapping/30.0.cil from rvc-dev aosp_arm64-eng
device to private/compat/30.0/30.0.cil
- remove all attribute declaration statement (typeattribute ...) and
sort lines alphabetically
- some selinux types were added/renamed/deleted w.r.t 30 sepolicy.
Find all such types using treble_sepolicy_tests_30.0 test.
- for all these types figure out where to map them by looking at
29.0.[ignore.]cil files and add approprite entries to 30.0.[ignore.]cil.

This change also enables treble_sepolicy_tests_30.0 and installs
30.0.cil mapping file onto the device.

Bug: 153661471
Test: m treble_sepolicy_tests_30.0
Test: m 30.0_compat_test
Test: m selinux_policy
Change-Id: I6dfae41fbd5f245119ede540d2c321688d6e7929
2020-05-11 04:32:00 +00:00
Inseob Kim
5131ff6544 DO NOT MERGE Add fake 30.0 prebuilts
This prebuilt is based on the AOSP policy, but slightly manipulated so
that the set of types and attributes are identical with R policy.

Following types are removed.

boot_status_prop
dalvik_config_prop
gnss_device
surfaceflinger_color_prop
surfaceflinger_prop
systemsound_config_prop
vold_config_prop
vold_status_prop

Following type is renamed.

wificond_service -> wifinl80211_service

Bug: 153661471
Test: N/A
Change-Id: I018d5e43f53c2bf721db1d13f5f4be42b9782b29
2020-05-11 13:18:52 +09:00
Inseob Kim
520176a884 Merge "Move audio config props to audio_config_prop" 2020-05-11 02:42:16 +00:00
Suren Baghdasaryan
9436677538 Add lmkd. property policies
lmkd.reinit property allows vendors to trigger lmkd reinitialization. Add
lmkd_prop to support lmkd.* properties inlcuding lmkd.reinit.

Bug: 155149944
Test: setprop lmkd.reinit 1
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Merged-In: I6ba598bad7ebb40fd6f23de473f25f32e53c996d
Change-Id: I6ba598bad7ebb40fd6f23de473f25f32e53c996d
2020-05-08 15:35:16 +00:00
Inseob Kim
c4b731d712 Merge "Move ro.lmk. properties to lmkd_config_prop" 2020-05-08 10:44:18 +00:00
Inseob Kim
cc4d888f52 Move ro.lmk. properties to lmkd_config_prop
Bug: 155844385
Test: sepolicy_tests
Change-Id: I6a4412b3e7d3c46eae699bd8e7d2941f56b31773
2020-05-08 12:19:54 +09:00
Roshan Pius
d42c7571aa sepolicy: Remove offload HAL sepolicy rules
This is unused currently & there are no concrete plans to use it
in the future.

Bug: 130080335
Test: Device boots up & connects to networks.
Test: Will send for regression tests
Change-Id: I785389bc2c934c8792c8f631362d6aa0298007af
Merged-In: I785389bc2c934c8792c8f631362d6aa0298007af
(cherry picked from commit 56dfc06397)
2020-05-08 11:17:12 +09:00
Suren Baghdasaryan
b221e66301 Add lmkd. property policies
lmkd.reinit property allows vendors to trigger lmkd reinitialization. Add
lmkd_prop to support lmkd.* properties inlcuding lmkd.reinit.

Bug: 155149944
Test: setprop lmkd.reinit 1
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I6ba598bad7ebb40fd6f23de473f25f32e53c996d
2020-05-07 15:42:36 +00:00
Inseob Kim
4ce4e87de1 Move audio config props to audio_config_prop
Bug: 155844385
Test: sepolicy_tests
Change-Id: Ic199925b5e3e1c80f1e692c8c5fc2cbb73eda0f5
2020-05-06 22:58:29 +09:00
Songchun Fan
5974c8b538 [rvc] Define vendor-specific property ro.incremental.enable
[already merged in master and AOSP]

Make ro.incremental.enable a vendor-specific property. Allow
system_server and vold to read this property.

Test: manual
BUG: 155212902
Merged-In: I8ff8837af635fa8e7b5bb02e5f6de5ac15b5023b
Change-Id: Id432390023de232deb4cc4d0ff3fb73904093b60
2020-05-04 12:04:18 -07:00
Songchun Fan
05ae77459b Merge "Revert "Define vendor-specific property ro.incremental.enable"" into rvc-dev 2020-05-04 18:05:42 +00:00
Songchun Fan
79ec7da4e0 Revert "Define vendor-specific property ro.incremental.enable"
This reverts commit 916163cf1b.

Reason for revert: breaks build
BUG: 155655234
Change-Id: Idd4b682876786f80d892cf6b4e1cc8d748e34274
2020-05-04 18:05:16 +00:00
Songchun Fan
f2485aabf6 Merge "Define vendor-specific property ro.incremental.enable" into rvc-dev 2020-05-04 16:47:37 +00:00
Inseob Kim
4f780e10ce Merge "Rename surfaceflinger properties' contexts" 2020-05-04 05:22:01 +00:00
Songchun Fan
9fdcbcd29b Define vendor-specific property ro.incremental.enable
[cherry-picking]

Make ro.incremental.enable a vendor-specific property. Allow
system_server and vold to read this property.

Test: manual
BUG: 155212902
Change-Id: I8ff8837af635fa8e7b5bb02e5f6de5ac15b5023b
Merged-In: I8ff8837af635fa8e7b5bb02e5f6de5ac15b5023b
2020-05-01 10:27:51 -07:00
Songchun Fan
916163cf1b Define vendor-specific property ro.incremental.enable
[Will cherry-pick to AOSP]

Make ro.incremental.enable a vendor-specific property. Allow
system_server and vold to read this property.

Test: manual
BUG: 155212902
Change-Id: I8ff8837af635fa8e7b5bb02e5f6de5ac15b5023b
Merged-In: I8ff8837af635fa8e7b5bb02e5f6de5ac15b5023b
2020-04-30 01:05:55 +00:00
Inseob Kim
721d921aa5 Rename surfaceflinger properties' contexts
Cleaning up exported*_system_prop and moving surfaceflinger properties
to new property contexts.

Bug: 152468529
Bug: 154885206
Test: boot cf_x86 and crosshatch
Change-Id: I7f8a684e9cbabce2f55a5292d7b2283ac0716cd9
2020-04-29 10:43:06 +09:00
Inseob Kim
4ed4737aaf Add boot_status_prop for boot completed props
Assigning a new context boot_status_prop for following two properties:
- sys.boot_completed
- dev.bootcomplete

Bug: 154885206
Test: boot cf_x86 and crosshatch, see no denials
Change-Id: Ieadabf90a9a1b54b52a1283bd648c11c95d558dd
Merged-In: Ieadabf90a9a1b54b52a1283bd648c11c95d558dd
(cherry picked from commit 2973c96055)
2020-04-27 15:34:53 +09:00
Collin Fijalkovich
a24d7ccd8f Merge "Use prefixes for binder cache SELinux properties." into rvc-dev 2020-04-24 20:54:04 +00:00
Automerger Merge Worker
4dd363d511 Use prefixes for binder cache SELinux properties.
Adds a context for telephony related cache properties and changes
the bluetooth and system_server properties to match off of prefix
instead of exact string matches.

Bug: 151953109
Test: Flashed phone with PowerManager caches enabled and verified
that the phone boots.

Merged-In: I9110192a12bb6222e49a8fb6b266d6067ef2ea92
Change-Id: I3128596a2f893954a54499cf295e5c88a94d4965
(cherry picked from commit bae0bd2016)
2020-04-23 18:02:31 +00:00
Rambo Wang
d52c69f2e6 Add policy to allow EmergencyAffordanceService to dump state
Bug: 130187110
Test: adb shell dumpsys emergency_affordance
Merged-In: I4dcc227ba949a02a0393999c8065f8bd8b981959
Change-Id: I4dcc227ba949a02a0393999c8065f8bd8b981959
(cherry picked from commit 25e527634a)
2020-04-20 19:48:22 +00:00
Inseob Kim
d8c39d9e56 Rename exported_dalvik_prop to dalvik_config_prop
This is to clean up bad name "exported_dalvik_prop"

Bug: 154465224
Test: sepolicy_tests
Test: treble_sepolicy_tests 26.0 ~ 29.0
Change-Id: Ie5e738b5985c1db1bca7a857971d8490a7980b5b
2020-04-20 19:37:34 +09:00
Rambo Wang
018214dd8e Merge "Add policy to allow EmergencyAffordanceService to dump state" 2020-04-17 15:19:54 +00:00
Martijn Coenen
51b1d918ca Add external_storage properties.
Since these need to be set from a vendor context.

Bug: 152170470
Bug: 153525566
Test: N/A
Change-Id: I2e90ad08fa0a5bd2b4759d92f95d35cec2b316df
Merged-In: I2e90ad08fa0a5bd2b4759d92f95d35cec2b316df
2020-04-16 10:14:44 +02:00
Martijn Coenen
01234d371e Add external_storage properties.
Since these need to be set from a vendor context.

Bug: 152170470
Bug: 153525566
Test: N/A
Change-Id: I2e90ad08fa0a5bd2b4759d92f95d35cec2b316df
2020-04-15 17:30:41 +02:00
Rambo Wang
25e527634a Add policy to allow EmergencyAffordanceService to dump state
Bug: 152506122
Test: adb shell dumpsys emergency_affordance
Change-Id: I4dcc227ba949a02a0393999c8065f8bd8b981959
2020-04-14 14:54:52 -07:00
Inseob Kim
3f5a7d247a Rename exported and exported2 vold prop
This is a subtask to clean up bad context names "exported*_prop".

Bug: 152469526
Test: m
Change-Id: Ie2d4046732e9d6562294fa664dcd7f019aa7c229
2020-04-07 12:56:23 +09:00
Inseob Kim
94bae860a9 Create surfaceflinger_prop and migrate props
This is a subtask of removing exported*_prop.

Bug: 152468529
Test: m && boot crosshatch
Change-Id: I9d6ec7ade96a3a53288f23d155cc829c2107bb6f
2020-04-02 11:21:14 +00:00
Inseob Kim
fd2d6ec3bc Rename exported2_config_prop to systemsound_config_prop
Fixing bad names (exported*_prop) on property contexts.

Bug: 152468650
Test: m sepolicy_tests
Change-Id: Ie98212ee0fa89966e70faa83322b65b613f3b3f5
2020-04-01 18:23:39 +09:00
Alistair Delva
d5a222d75a Merge "Add gnss_device dev_type" 2020-03-23 18:58:59 +00:00
Songchun Fan
19a5cc2bab [sepolicy] remove vendor_incremental_module from global sepolicy rules
(Cherry-picking)

Moving to coral-sepolicy

BUG: 150882666
Test: atest PackageManagerShellCommandIncrementalTest
Merged-Id: I55f5d53ee32d0557e06c070961526631e1bb1fc5
Change-Id: Ia9c4d8240787b0d2b349764cac9d61b9d8731fa2
2020-03-19 16:31:44 -07:00
Pawin Vongmasa
4bec1e37a2 Allow XML file paths to be customized with sysprop
Three properties are declared as vendor-init-settable:
ro.media.xml_variant.codecs
ro.media.xml_variant.codecs_performance
ro.media.xml_variant.profiles

media_codecs.xml can now be named
media_codecs${ro.media.xml_variant.codecs}.xml

media_codecs_performance.xml can now be named
media_codecs_performance${ro.media.xml_variant.codecs_performance}.xml

media_profiles_V1_0 can now be named
media_profiles${ro.media.xml_variant.profiles}.xml

Test: Rename "media_codecs.xml" to "media_codecs_test.xml",
set ro.media.xml_variant.codecs to "_test", then
call "stagefright -i".

Test: Rename "media_codecs_performance.xml" to
"media_codecs_performance_test.xml",
set ro.media.xml_variant.codecs_performance to "_test", then
run android.media.cts.VideoDecoderPerfTest.

Test: Rename "media_profiles_V1_0.xml" to "media_profiles_test.xml",
set ro.media.xml_variant.profiles to "_test", then
run vts_mediaProfiles_validate_test.

Bug: 142102953
Change-Id: I407a0a327fcc8e799bb4079b11048a497565be48
Merged-In: I407a0a327fcc8e799bb4079b11048a497565be48
2020-03-18 22:55:36 +00:00
Alistair Delva
398aa5e5ce Merge "Add sepolicy for the securityfs mount type." into rvc-dev 2020-03-18 21:49:03 +00:00
Pawin Vongmasa
76d7cf961e Allow XML file paths to be customized with sysprop
Three properties are declared as vendor-init-settable:
ro.media.xml_variant.codecs
ro.media.xml_variant.codecs_performance
ro.media.xml_variant.profiles

media_codecs.xml can now be named
media_codecs${ro.media.xml_variant.codecs}.xml

media_codecs_performance.xml can now be named
media_codecs_performance${ro.media.xml_variant.codecs_performance}.xml

media_profiles_V1_0 can now be named
media_profiles${ro.media.xml_variant.profiles}.xml

Test: Rename "media_codecs.xml" to "media_codecs_test.xml",
set ro.media.xml_variant.codecs to "_test", then
call "stagefright -i".

Test: Rename "media_codecs_performance.xml" to
"media_codecs_performance_test.xml",
set ro.media.xml_variant.codecs_performance to "_test", then
run android.media.cts.VideoDecoderPerfTest.

Test: Rename "media_profiles_V1_0.xml" to "media_profiles_test.xml",
set ro.media.xml_variant.profiles to "_test", then
run vts_mediaProfiles_validate_test.

Bug: 142102953
Change-Id: I407a0a327fcc8e799bb4079b11048a497565be48
2020-03-18 06:02:55 -07:00
Alistair Delva
1a3ee382ec Add gnss_device dev_type
This grants default access to the new GNSS subsystem for Linux to the
GNSS HAL default implementation. The GNSS subsystem creates character
devices similar to ttys but without much unneeded complexity. The GNSS
device class is specific to location use cases.

Bug: 151670529
Change-Id: I03b27aa5bbfdf600eb830de1c8748aacb9bf4663
2020-03-17 20:25:51 +00:00
Nikita Ioffe
91c3795b2c Add userspace_reboot_test_prop
This property type represents properties used in CTS tests of userspace
reboot. For example, test.userspace_reboot.requested property which is
used to check that userspace reboot was successful and didn't result in
full reboot, e.g.:
* before test setprop test.userspace_reboot.requested 1
* adb reboot userspace
* wait for boot to complete
* verify that value of test.userspace_reboot.requested is still 1

Test: adb shell setprop test.userspace_reboot.requested 1
Bug: 150901232
Change-Id: I45d187f386149cec08318ea8545ab864b5810ca8
Merged-In: I45d187f386149cec08318ea8545ab864b5810ca8
(cherry picked from commit 3bd53a9cee)
2020-03-16 15:13:08 +00:00
Nikita Ioffe
3bd53a9cee Add userspace_reboot_test_prop
This property type represents properties used in CTS tests of userspace
reboot. For example, test.userspace_reboot.requested property which is
used to check that userspace reboot was successful and didn't result in
full reboot, e.g.:
* before test setprop test.userspace_reboot.requested 1
* adb reboot userspace
* wait for boot to complete
* verify that value of test.userspace_reboot.requested is still 1

Test: adb shell setprop test.userspace_reboot.requested 1
Bug: 150901232
Change-Id: I45d187f386149cec08318ea8545ab864b5810ca8
2020-03-16 11:17:12 +00:00
A. Cody Schuffelen
158e176c5a Add sepolicy for the securityfs mount type.
See discussion in aosp/1233645. There was a concern about this
filesystem automounting when enabled, so this change adds sepolicy to
preemptively lock it down.

I'm not confident it actually automounts. If it does, it'll land in
/sys/kernel/security, which is also protected with the sysfs policy.

Test: Builds
Bug: 148102533
Change-Id: I78a246a5c18953f2471f84367ab383afb2742908
Merged-In: I78a246a5c18953f2471f84367ab383afb2742908
2020-03-13 15:55:05 +00:00
Hongyi Zhang
7f400c6841 Whitelist prop persist.device_config.configuration.
For system prop flags from DeviceConfig namespace "Configuration".

Test: Build and run on local device
Bug: 149420506

Change-Id: If4196b4bf231e7c52f98b92cc0031a08dad06120
Merged-In: If4196b4bf231e7c52f98b92cc0031a08dad06120
2020-03-12 01:17:36 +00:00
A. Cody Schuffelen
71b0b85a94 Add sepolicy for the securityfs mount type.
See discussion in aosp/1233645. There was a concern about this
filesystem automounting when enabled, so this change adds sepolicy to
preemptively lock it down.

I'm not confident it actually automounts. If it does, it'll land in
/sys/kernel/security, which is also protected with the sysfs policy.

Test: Builds
Bug: 148102533
Change-Id: I78a246a5c18953f2471f84367ab383afb2742908
2020-03-11 12:24:24 -07:00
Steven Moreland
6968e374c1 Merge "Allow vndservicemanager to self-register." into rvc-dev 2020-03-09 18:34:19 +00:00
Steven Moreland
bfceeabe3c Allow vndservicemanager to self-register.
This is useful for tools like dumpsys, so that they work on all services
equally as well. Also, so that there is no difference with the regular
service manager.

Bug: 150579832
Test: 'adb shell /vendor/bin/dumpsys -l' shows 'manager'
Test: denial is no longer present:
03-05 12:23:47.346   221   221 E SELinux : avc:  denied  { add } for pid=221 uid=1000 name=manager scontext=u:r:vndservicemanager:s0 tcontext=u:object_r:service_manager_vndservice:s0 tclass=service_manager permissive=0

Change-Id: Id6126e8277462a2c4d5f6022ab67a4bacaa3241e
(cherry picked from commit 52a96cc7dd)
2020-03-06 16:35:52 -08:00
Songchun Fan
5d7887850b [sepolicy] remove vendor_incremental_module from global sepolicy rules
Moving to pixel-sepolicy

BUG: 150882666
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: I55f5d53ee32d0557e06c070961526631e1bb1fc5
2020-03-05 15:36:23 -08:00
Steven Moreland
52a96cc7dd Allow vndservicemanager to self-register.
This is useful for tools like dumpsys, so that they work on all services
equally as well. Also, so that there is no difference with the regular
service manager.

Bug: 150579832
Test: 'adb shell /vendor/bin/dumpsys -l' shows 'manager'
Test: denial is no longer present:
03-05 12:23:47.346   221   221 E SELinux : avc:  denied  { add } for pid=221 uid=1000 name=manager scontext=u:r:vndservicemanager:s0 tcontext=u:object_r:service_manager_vndservice:s0 tclass=service_manager permissive=0

Change-Id: Id6126e8277462a2c4d5f6022ab67a4bacaa3241e
2020-03-05 17:43:35 +00:00
Changyeon Jo
82862fc46d Merge "Update automotive display service rules" into rvc-dev 2020-03-05 00:43:16 +00:00
TreeHugger Robot
fd948c2afd Merge "Adding sepolicy of tuner resource manager service" into rvc-dev 2020-03-04 17:21:59 +00:00
Changyeon Jo
3198f09709 Update automotive display service rules
This change updates sepolicies for automotive display service to make it
available to the vendor processes.

Bug: 149017572
Test: m -j selinux_policy
Change-Id: I48708fe25e260f9302e02749c3777c0ca0d84e4b
Signed-off-by: Changyeon Jo <changyeon@google.com>
(cherry picked from commit 17b38d526d)
2020-02-29 11:01:26 -08:00
Ryan Savitski
cfd767180d traced_perf sepolicy tweaks
* allow shell to enable/disable the daemon via a sysprop
* don't audit signals, as some denials are expected
* exclude zygote from the profileable set of targets on debug builds.
  I've not caught any crashes in practice, but believe there's a
  possibility that the zygote forks while holding a non-whitelisted fd
  due to the signal handler.

Bug: 144281346
Merged-In: Ib237d4edfb40b200a3bd52e6341f13c4777de3f1
Change-Id: Ib237d4edfb40b200a3bd52e6341f13c4777de3f1
(cherry picked from commit 008465e5ec)
2020-02-28 15:04:43 +00:00
Hongyi Zhang
1d9daf1c6e Whitelist prop persist.device_config.configuration.
For system prop flags from DeviceConfig namespace "Configuration".

Test: Build and run on local device
Bug: 149420506

Change-Id: If4196b4bf231e7c52f98b92cc0031a08dad06120
2020-02-27 14:06:58 -08:00
Changyeon Jo
d36a0750e4 Merge "Update automotive display service rules" 2020-02-25 15:38:00 +00:00
Treehugger Robot
f173b14363 Merge "traced_perf sepolicy tweaks" 2020-02-25 04:18:25 +00:00
Changyeon Jo
17b38d526d Update automotive display service rules
This change updates sepolicies for automotive display service to make it
available to the vendor processes.

Bug: 149017572
Test: m -j selinux_policy
Change-Id: I48708fe25e260f9302e02749c3777c0ca0d84e4b
Signed-off-by: Changyeon Jo <changyeon@google.com>
2020-02-25 02:02:54 +00:00
Collin Fijalkovich
749e119053 Merge "Use prefixes for binder cache SELinux properties." 2020-02-25 00:24:46 +00:00
Amy
7f4526612d Adding sepolicy of tuner resource manager service
This is to allow adding the Tuner Resource Manager as a system service

Test: cuttlefish
Bug: 147380513
Change-Id: I3f61f2542c7fd934bb69dde08079f830196e2344
(cherry picked from commit 3791549dc4)
2020-02-24 13:59:46 -08:00
Ryan Savitski
008465e5ec traced_perf sepolicy tweaks
* allow shell to enable/disable the daemon via a sysprop
* don't audit signals, as some denials are expected
* exclude zygote from the profileable set of targets on debug builds.
  I've not caught any crashes in practice, but believe there's a
  possibility that the zygote forks while holding a non-whitelisted fd
  due to the signal handler.

Change-Id: Ib237d4edfb40b200a3bd52e6341f13c4777de3f1
2020-02-24 12:23:13 +00:00
Amy Zhang
1ddfce5fc6 Merge "Adding sepolicy of tuner resource manager service" 2020-02-23 03:49:51 +00:00
Roshan Pius
7f3120d5e1 sepolicy(wifi): Allow wifi service access to wifi apex directories
Bug: 148660313
Test: Compiles
Change-Id: I4a973c4516fda5f96f17f82cd3a424b0ca89004b
Merged-In: I4a973c4516fda5f96f17f82cd3a424b0ca89004b
2020-02-22 09:33:07 -08:00
Roshan Pius
0f6852b342 Merge "sepolicy(wifi): Allow wifi service access to wifi apex directories" 2020-02-22 03:56:55 +00:00
Amy
3791549dc4 Adding sepolicy of tuner resource manager service
This is to allow adding the Tuner Resource Manager as a system service

Test: cuttlefish
Bug: 147380513
Change-Id: I3f61f2542c7fd934bb69dde08079f830196e2344
2020-02-21 23:33:46 +00:00
Collin Fijalkovich
b1b15013e9 Use prefixes for binder cache SELinux properties.
Adds a context for telephony related cache properties and changes
the bluetooth and system_server properties to match off of prefix
instead of exact string matches.

Test: Flashed phone with PowerManager caches enabled and verified
that the phone boots.

Change-Id: I9110192a12bb6222e49a8fb6b266d6067ef2ea92
2020-02-21 15:25:46 -08:00
Roshan Pius
8f84cc32a8 sepolicy(wifi): Allow wifi service access to wifi apex directories
Bug: 148660313
Test: Compiles
Change-Id: I4a973c4516fda5f96f17f82cd3a424b0ca89004b
2020-02-21 10:40:32 -08:00
Automerger Merge Worker
d8d49bc1f0 sepolicy: policies for iorap.inode2filename am: e39f8d23ed am: ba56249da9 am: 36e0549683
Change-Id: I22ba3e8a1136ba63958532c0c1dc07caac13dd36
2020-02-21 17:01:59 +00:00
Automerger Merge Worker
4ab5332b95 Merge "Add adbd_prop, system_adbd_prop property types." am: b8c108e15f am: 76cd6f8ff8 am: dc07a9d2c0
Change-Id: Iaaf6ab98e748a20f79907e1515a203eba84526c0
2020-02-21 01:11:25 +00:00
Igor Murashkin
e39f8d23ed sepolicy: policies for iorap.inode2filename
binary transitions are as follows:

iorapd (fork/exec) -> iorap.cmd.compiler (fork/exec) -> iorap.inode2filename

Bug: 117840092
Test: adb shell cmd jobscheduler run -f android 28367305
Change-Id: I4249fcd37d2c8cbdd0ae1a0505983cce9c7fa7c6
2020-02-20 16:38:17 -08:00
Joshua Duong
b8c108e15f Merge "Add adbd_prop, system_adbd_prop property types." 2020-02-21 00:28:48 +00:00
Joshua Duong
18988fcce3 Add adbd_prop, system_adbd_prop property types.
service.adb.tls.port contains the adbd tcp port running the TLS server.
persist.sys.adb.wifi tells adbd when to enable the TLS server.

Bug: 149348431
Bug: 111434128

Test: Enable wireless debugging, check if TLS port information is
displayed in the Developer options > Wireless debuggging.
Change-Id: I5b5c5a3d064bc003f41386ede9051609fefec53e
2020-02-20 07:52:34 -08:00
Automerger Merge Worker
4d7f45f968 Merge "Define sepolicy for redirect-socket-calls feature" am: 622e4f761b am: 4f799574bd am: 9c7e277700
Change-Id: I364408ff8119300cf87cf85fa07b8b179697396c
2020-02-20 05:59:04 +00:00
Ken Chen
622e4f761b Merge "Define sepolicy for redirect-socket-calls feature" 2020-02-20 05:18:55 +00:00
Automerger Merge Worker
7934472245 Merge "Add SELinux policy for credstore and update for IC HAL port from HIDL to AIDL." am: 1948c11d13 am: 19516eb39f am: 5d5da562ba
Change-Id: Id5d55d29f52b7ed56c16de946c4c0e5fdf054f35
2020-02-19 23:18:16 +00:00
David Zeuthen
1948c11d13 Merge "Add SELinux policy for credstore and update for IC HAL port from HIDL to AIDL." 2020-02-19 21:14:40 +00:00
David Zeuthen
02bf814aa2 Add SELinux policy for credstore and update for IC HAL port from HIDL to AIDL.
The credstore service is a system service which backs the
android.security.identity.* Framework APIs. It essentially calls into
the Identity Credential HAL while providing persistent storage for
credentials.

Bug: 111446262
Test: atest android.security.identity.cts
Test: VtsHalIdentityTargetTest
Test: android.hardware.identity-support-lib-test
Change-Id: I5cd9a6ae810e764326355c0842e88c490f214c60
2020-02-19 13:46:45 -05:00
Kiyoung Kim
dc34050e17 Remove sys.linker property
sys.linker property was defined to enable / disable generate linker
configuration, but the property has been removed. Remove sys.linker
property definition as it is no longer in use

Bug: 149335054
Test: m -j passed && cuttlefish worked without sepolicy error
Change-Id: Iacb2d561317d0920f93104717ce4f4bb424cc095
Merged-In: Iacb2d561317d0920f93104717ce4f4bb424cc095
2020-02-19 10:16:06 +09:00
Kiyoung Kim
77a48d64ba Remove sys.linker property
sys.linker property was defined to enable / disable generate linker
configuration, but the property has been removed. Remove sys.linker
property definition as it is no longer in use

Bug: 149335054
Test: m -j passed && cuttlefish worked without sepolicy error
Change-Id: Iacb2d561317d0920f93104717ce4f4bb424cc095
2020-02-18 10:13:55 +09:00
Mark Salyzyn
3b576b46f1 bootstat: enhance last reboot reason property with file backing am: 79f9ca6789 am: d5c3a11681 am: c3eb896930
Change-Id: Id032de31811ce737868f8c3da5dc49ef2e11e824
2020-02-17 10:12:25 +00:00
Songchun Fan
a2e1abde38 Merge changes Ie973be6b,Ie090e085 am: ff40f150e8 am: a403503c57 am: 23cb5adc6e
Change-Id: I26fae9ed6a962bf55077b17e3dbdcd692f525eaf
2020-02-17 10:11:43 +00:00
David Stevens
f746f9c25f Merge commit 'f3187f394915eac633f6803ac0ed34a4455d3a17' into manual_merge_f3187f394915eac633f6803ac0ed34a4455d3a17
Bug: None
Test: blueline boots and property is build time configurable

Change-Id: Ie7a0f25f7e40a8aaa446033702c5fc0f32f438e0
2020-02-17 04:28:59 +00:00
Mark Salyzyn
79f9ca6789 bootstat: enhance last reboot reason property with file backing
Helps with support of recovery and rollback boot reason history, by
also using /metadata/bootstat/persist.sys.boot.reason to file the
reboot reason.  For now, label this file metadata_bootstat_file.

Test: manual
Bug: 129007837
Change-Id: Id1d21c404067414847bef14a0c43f70cafe1a3e2
2020-02-14 13:30:21 -08:00
Songchun Fan
ff40f150e8 Merge changes Ie973be6b,Ie090e085
* changes:
  permissions for incremental control file
  new label for incremental control files
2020-02-14 18:00:02 +00:00
stevensd
e3e16a313b Merge "selinux policy for buffer queue config" 2020-02-14 02:54:20 +00:00
Etan Cohen
8bd638eae4 Merge "[WIFICOND] Rename service to nl80211" 2020-02-13 22:34:09 +00:00
Songchun Fan
051549cc83 remove incfs genfscon label am: d9b78b4c84 am: b55fd10e0b am: 6262f99b5a
Change-Id: If020e8520a27c473551bd1d92529d9e4cee44830
2020-02-13 21:16:04 +00:00
Songchun Fan
b1512f3ab7 new label for incremental control files
Test: manual with incremental installation
Test: coral:/data/incremental/MT_data_incremental_tmp_1658593565/mount # ls -lZ .pending_reads
Test: -rw-rw-rw- 1 root root u:object_r:incremental_control_file:s0  0 1969-12-31 19:00 .pending_reads
BUG: 133435829
Change-Id: Ie090e085d94c5121bf61237974effecef2dcb180
2020-02-13 12:52:51 -08:00
Songchun Fan
d9b78b4c84 remove incfs genfscon label
Test: manual with incremental installation
BUG: 133435829
Change-Id: I8b38db18851a5b3baf925be621de3eb0e83efbb4
2020-02-13 08:44:48 -08:00
David Stevens
3942fe1682 selinux policy for buffer queue config
Test: boot and check for no policy violations

Change-Id: I1ea2a79b9a45b503dcb061c196c5af1d0ddab653
2020-02-13 20:11:47 +09:00
Etan Cohen
fde1dadc71 [WIFICOND] Rename service to nl80211
Per API council feedback.

Bug: 149105833
Bug: 148680192
Test: atest android.net.wifi
Test: atest com.android.server.wifi
Test: manual - flash/boot - verify Wi-Fi scan/associate
Change-Id: Idaf7603d4ab79ddde5c223097ed9fe8734299eea
2020-02-12 11:26:59 -08:00
Ken Chen
64f0be204b Define sepolicy for redirect-socket-calls feature
Define two property_context.

1. vendor_socket_hook_prop - for ro.vendor.redirect_socket_calls. The
property set once in vendor_init context. It's evaluated at process
start time and is cannot change at runtime on a given device. The set
permission is restricted to vendor_init. The read permission is
unrestricted.

2. socket_hook_prop - for net.redirect_socket_calls.hooked. The
property can be changed by System Server at runtime. It's evaluated when
shimmed socket functions is called. The set permission is restricted to
System Server. The read permission is unrestricted.

Bug: Bug: 141611769
Test: System Server can set net.redirect_socket_calls.hooked
      libnetd_client can read both properties
      libnetd_client can't set both properties

Change-Id: Ic42269539923e6930cc0ee3df8ba032797212395
2020-02-11 20:55:02 +08:00
Automerger Merge Worker
0b18794a23 Merge "sepolicy: new prereboot_data_file type" am: e8b7cecad3 am: b98676bc7a am: 4cfad4bd0c
Change-Id: I730e1d0c934f5588c9dc3e6f6de98ee6eaae7aab
2020-02-11 03:27:40 +00:00
Jerry Chang
e8b7cecad3 Merge "sepolicy: new prereboot_data_file type" 2020-02-11 02:49:29 +00:00
Automerger Merge Worker
8980ab9b51 Merge "Add userspace_reboot_log_prop" am: 4119b07d1b am: 250f731efd am: f0531762ca
Change-Id: I83b726332f54feaae999e3e7d597f5792a45faad
2020-02-10 17:58:39 +00:00
Nikita Ioffe
4119b07d1b Merge "Add userspace_reboot_log_prop" 2020-02-10 17:22:03 +00:00
Automerger Merge Worker
d951bab082 Merge "selinux rules for loading incremental module" am: 3cf7d1b5ee am: 8c020eec71 am: 0c789cc584
Change-Id: Ifdd7e864f7d9fee65aac576272a1fedb8ee88e71
2020-02-07 20:14:44 +00:00
Songchun Fan
99d9374760 selinux rules for loading incremental module
Defining incremental file system driver module, allowing vold to load
and read it.

=== Denial messages ===
02-04 16:48:29.193   595   595 I Binder:595_4: type=1400 audit(0.0:507): avc: denied { read } for name="incrementalfs.ko" dev="dm-2" ino=1684 scontext=u:r:vold:s0 tcontext=u:object_r:vendor_incremental_module:s0 tclass=file permissive=1
02-04 16:48:29.193   595   595 I Binder:595_4: type=1400 audit(0.0:508): avc: denied { open } for path="/vendor/lib/modules/incrementalfs.ko" dev="dm-2" ino=1684 scontext=u:r:vold:s0 tcontext=u:object_r:vendor_incremental_module:s0 tclass=file permissive=1
02-04 16:48:29.193   595   595 I Binder:595_4: type=1400 audit(0.0:509): avc: denied { sys_module } for capability=16 scontext=u:r:vold:s0 tcontext=u:r:vold:s0 tclass=capability permissive=1
02-04 16:48:29.193   595   595 I Binder:595_4: type=1400 audit(0.0:510): avc: denied { module_load } for path="/vendor/lib/modules/incrementalfs.ko" dev="dm-2" ino=1684 scontext=u:r:vold:s0 tcontext=u:object_r:vendor_incremental_module:s0 tclass=system permissive=1

Test: manual
BUG: 147371381
Change-Id: I5bf4e28c28736b4332e7a81c344ce97ac7278ffb
2020-02-07 09:52:34 -08:00
Jerry Chang
5594f307c8 sepolicy: new prereboot_data_file type
This adds the type and permissions for dumping and appending prereboot
information.

Bug: 145203410
Test: Didn't see denials while dumping and appending prereboot info.
Change-Id: Ic08408b9bebc3648a7668ed8475f96a5302635fa
2020-02-07 10:22:47 +08:00
Nikita Ioffe
44f5ffca15 Add userspace_reboot_log_prop
This properties are used to compute UserspaceRebootAtom and are going to
be written by system_server. Also removed now unused
userspace_reboot_prop.

Test: builds
Bug: 148767783
Change-Id: Iee44b4ca9f5d3913ac71b2ac6959c232f060f0ed
2020-02-07 01:57:55 +00:00
Automerger Merge Worker
db98e40689 Merge "snapshotctl better logging" am: 28d5e87d39 am: 1c26630767 am: 3a51d8330c
Change-Id: Ibed854e6236336395f562f06e67c6f20d00d412a
2020-02-04 22:46:54 +00:00
Yifan Hong
28d5e87d39 Merge "snapshotctl better logging" 2020-02-04 22:18:33 +00:00
Yifan Hong
589bb6f369 snapshotctl better logging
Test: snapshotctl merge --log-to-file
Bug: 148818798
Change-Id: I0e9c8ebb6632a56670a566f7a541e52e0bd24b08
2020-02-04 10:09:24 -08:00
Automerger Merge Worker
7720b7cb7f Merge "[selinux] properly labeling dirs under /data/incremental" am: 37b87fc793 am: 01d09f9d1d am: 797924fab7
Change-Id: Ic3ebd731276afbdbbdfd20e9f76be3375fc93a6c
2020-02-04 17:53:45 +00:00
Songchun Fan
f09db16c56 [selinux] properly labeling dirs under /data/incremental
Setting files and dirs under /data/incremental as apk_data_file, so that
they will have the same permissions as the ones under /data/app.

Current layout of the dirs:
1. /data/incremental/[random]/mount -> holds data files (such as base.apk) and
control files (such as .cmd). Its subdirectory is first bind-mounted to
/data/incremental/tmp/[random], eventually bind-mounted to
/data/app/~~[randomA]/[packageName]-[randomB].

2. /data/incremental/[random]/backing_mount -> hold incfs backing image.

3. /data/incremental/tmp/[random] -> holds temporary mountpoints (bind-mount targets)
during app installation.

Test: manual
Change-Id: Ia5016db2fa2c7bad1e6611d59625731795eb9efc
2020-02-03 14:28:37 -08:00
Automerger Merge Worker
11f655b8c1 Merge "Grant vold, installd, zygote and apps access to /mnt/pass_through" am: 5119becf5d am: 89f83d100c am: 86a194b6e7
Change-Id: I1833f8057b632355788e74a676b0b7860fa0610b
2020-01-28 23:07:34 +00:00
Zimuzo Ezeozue
5119becf5d Merge "Grant vold, installd, zygote and apps access to /mnt/pass_through" 2020-01-28 22:26:58 +00:00
Zim
fcf599c89c Grant vold, installd, zygote and apps access to /mnt/pass_through
/mnt/pass_through was introduced to allow the FUSE daemon unrestricted
 access to the lower filesystem (or sdcardfs).

At zygote fork time, the FUSE daemon will have /mnt/pass_through/0
bind mounted to /storage instead of /mnt/user/0. To keep /sdcard
(symlink to /storage/self/primary) paths working, we create a
'self' directory  with an additional 'primary' symlink to
/mnt/pass_through/0/emulated/0 which is a FUSE mount point.

The following components need varying sepolicy privileges:

Vold: Creates the self/primary symlink and mounts the lower filesystem
on /mnt/pass_through/0/emulated. So needs create_dir and mount access
+ create_file access for the symlink

zygote: In case zygote starts an app before vold sets up the paths.
This is unlikely but can happen if the FUSE daemon (a zygote forked app)
is started before system_server completes vold mounts.
Same sepolicy requirements as vold

installd: Needs to clear/destroy app data using lower filesystem
mounted on /mnt/pass_through so needs read_dir access to walk
/mnt/pass_through

priv_app (FUSE daemon): Needs to server content from the lower
filesystem mounted on /mnt/pass_through so needs read_dir access to
walk /mnt/pass_through

Bug: 135341433
Test: adb shell ls /mnt/pass_through/0/self/primary
Change-Id: I16e35b9007c2143282600c56adbc9468a1b7f240
2020-01-28 20:56:36 +00:00
Automerger Merge Worker
db9794f0ed Merge "rebootescrow: allow use of block file" am: ebbc1b43cc am: d0cb7bf39a am: 9f707e3c15
Change-Id: I93247f43f6b6ecd448d606a8bba2c620b41ba91b
2020-01-28 17:46:23 +00:00
Kenny Root
960f73b75b rebootescrow: allow use of block file
pmem uses a block file while access_ramoops uses a char file. Allow both for
now until we can unify on pmem.

Additionally allow the reading of vendor properties so it can read the
path to the character or block device to open.

Test: atest VtsHalRebootEscrowTargetTest
Bug: 146400078
Change-Id: Ief61534e0946480a01c635ce1672579959ec8db5
2020-01-27 12:28:44 -08:00
Automerger Merge Worker
b1804f17e4 Merge "Whitelisting window_manager_native_boot system property" am: b9b2acff99 am: 622e779b7a am: b848357c5f
Change-Id: I213f33b122e7453988496615d7773445085763c5
2020-01-24 21:32:06 +00:00
Treehugger Robot
b9b2acff99 Merge "Whitelisting window_manager_native_boot system property" 2020-01-24 19:52:07 +00:00
Automerger Merge Worker
506fab058f Merge "Support for more binder caches" am: edd4726300 am: a0a4772d9f am: 73c9243d74
Change-Id: I6fc7b0b3a23eb046cf642cf7584e5117cc2be285
2020-01-23 16:15:31 +00:00
Automerger Merge Worker
cb1b85b022 Merge changes I8630c20e,I4aa482cf am: a67cd2333e am: 73391bf5ce am: a4bafa6f1d
Change-Id: Id6a842c83beaab632e55ce99fef48301555aeb32
2020-01-23 15:51:17 +00:00
Lee Shombert
edd4726300 Merge "Support for more binder caches" 2020-01-23 15:44:39 +00:00
Automerger Merge Worker
366f2e9619 Merge "Add rules for Lights AIDL HAL" am: 0545b44e40 am: 7ad4e6350f am: eb9e2be0c5
Change-Id: I64c70d288f47c8339543e2f0902eff5bce47c740
2020-01-22 22:07:27 +00:00
Ryan Savitski
67a82481f8 initial policy for traced_perf daemon (perf profiler)
The steps involved in setting up profiling and stack unwinding are
described in detail at go/perfetto-perf-android.

To summarize the interesting case: the daemon uses cpu-wide
perf_event_open, with userspace stack and register sampling on. For each
sample, it identifies whether the process is profileable, and obtains
the FDs for /proc/[pid]/{maps,mem} using a dedicated RT signal (with the
bionic signal handler handing over the FDs over a dedicated socket). It
then uses libunwindstack to unwind & symbolize the stacks, sending the
results to the central tracing daemon (traced).

This patch covers the app profiling use-cases. Splitting out the
"profile most things on debug builds" into a separate patch for easier
review.

Most of the exceptions in domain.te & coredomain.te come from the
"vendor_file_type" allow-rule. We want a subset of that (effectively all
libraries/executables), but I believe that in practice it's hard to use
just the specific subtypes, and we're better off allowing access to all
vendor_file_type files.

Bug: 137092007
Change-Id: I4aa482cfb3f9fb2fabf02e1dff92e2b5ce121a47
2020-01-22 22:04:01 +00:00
Ivailo Karamanolev
0545b44e40 Merge "Add rules for Lights AIDL HAL" 2020-01-22 21:34:34 +00:00
Ivailo Karamanolev
254d757289 Add rules for Lights AIDL HAL
Test: manual; yukawa and cuttlefish; adb logcat | grep -i avc
Bug: 142230898
Change-Id: I9f576511d1fc77c5f0ad3cf1b96b038b301773d7
2020-01-22 20:33:42 +01:00
Lee Shombert
097f9794f4 Support for more binder caches
Bug: 140788621

This adds keys for several planned binder caches in the system server
and in the bluetooth server.  The actual cache code is not in this
tree.

Test: created a test build that contains the actual cache code and ran
some system tests.  Verified that no protection issues were seen.

Change-Id: Ibaccb0c0ff8b127d14cf769ea4156f7d8b024bc1
2020-01-22 08:21:08 -08:00
Automerger Merge Worker
b196561251 Merge "reland: untrusted_app_29: add new targetSdk domain" am: db60355f94 am: 1a0201f032 am: 3bfc8f3858
Change-Id: I736145f84fc7860512156c7401f4f67bee1b1202
2020-01-22 15:25:42 +00:00
Jeffrey Vander Stoep
db60355f94 Merge "reland: untrusted_app_29: add new targetSdk domain" 2020-01-22 14:43:36 +00:00
Jeff Vander Stoep
1f7ae8ee3f reland: untrusted_app_29: add new targetSdk domain
Enforce new requirements on app with targetSdkVersion=30 including:
- No RTM_GETLINK on netlink route sockets.

Remove some of the repetitive descriptions in each untrusted_app_N.te
file, and instead refer to the description in
public/untrusted_app.te.

Bug: 141455849
Test: CtsSelinuxTargetSdkCurrentTestCases
Test: libcore.java.net.NetworkInterfaceTest#testGetNetworkInterfaces
Change-Id: I89553e48db3bc71f229c71fafeee9005703e5c0b
2020-01-22 09:47:53 +00:00
Valerie Hau
7b2a2dff0c Whitelisting window_manager_native_boot system property
Bug: 147096935
Test: build, boot

Change-Id: Iadeefa3cfc9bb17eb19b60dbd18de047fa01b673
2020-01-21 22:54:49 +00:00
Automerger Merge Worker
11c6f60e2f Merge "Add sysprop for init's perf_event_open LSM hook check" am: c9cc4001e4 am: 0aa85a1806 am: d33a22ff31
Change-Id: I67fa733b4c0ffa504cfb3af7a63e23995b2cd792
2020-01-21 21:04:17 +00:00
Automerger Merge Worker
ebf15a6584 Sepolicy update for Automotive Display Service am: 741b9cd5ac am: 8f52ce8bea am: 2f75747305
Change-Id: If1d84379a1205c6dddf97fcf2eb8d2ca19f2732a
2020-01-21 21:04:03 +00:00
Ryan Savitski
c9cc4001e4 Merge "Add sysprop for init's perf_event_open LSM hook check" 2020-01-21 20:40:50 +00:00
Ryan Savitski
52b3d315a2 Add sysprop for init's perf_event_open LSM hook check
Written exclusively by init. Made it readable by shell for CTS, and for
easier platform debugging.

Bug: 137092007
Change-Id: Ia5b056117502c272bc7169661069d0c8020695e2
2020-01-21 19:03:33 +00:00
Haoxiang Li
741b9cd5ac Sepolicy update for Automotive Display Service
Bug: 140395359
Test: make sepolicy -j
Change-Id: Ib6ddf55210d8a8ee4868359c88e3d177edce9610
Signed-off-by: Changyeon Jo <changyeon@google.com>
2020-01-21 18:43:27 +00:00
Automerger Merge Worker
0dcb0cd7da Revert "untrusted_app_29: add new targetSdk domain" am: 1d241db7e5 am: c5cc25ec03 am: 7900c7f08b
Change-Id: I7c74fbbb7b2546eccd0d30b34d6db52432048c34
2020-01-21 12:59:40 +00:00
Santiago Seifert
1d241db7e5 Revert "untrusted_app_29: add new targetSdk domain"
This reverts commit a1aa2210a9.

Reason for revert: Potential culprit for Bug b/148049462 - verifying through Forrest before revert submission

Change-Id: Ibe4fa1dee84defde324deca87d9de24a1cc2911a
2020-01-21 11:35:24 +00:00
Automerger Merge Worker
0f4d8b13f3 untrusted_app_29: add new targetSdk domain am: a1aa2210a9 am: cc7cc7b562 am: 49303f5f68
Change-Id: I58c2959d4598ea418fa63ad1cf9dba9886100d1f
2020-01-20 19:22:53 +00:00
Jeff Vander Stoep
a1aa2210a9 untrusted_app_29: add new targetSdk domain
Enforce new requirements on app with targetSdkVersion=30 including:
- No bind() on netlink route sockets.
- No RTM_GETLINK on netlink route sockets.

Remove some of the repetitive descriptions in each untrusted_app_N.te
file, and instead refer to the description in
public/untrusted_app.te.

Bug: 141455849
Test: CtsSelinuxTargetSdkCurrentTestCases
Change-Id: Iad4d142c0c13615b4710d378bc1feca4d125b6cc
2020-01-20 15:31:52 +01:00
Automerger Merge Worker
0a4efab2c8 Merge "Add policies for permission APEX data directory." am: 4f0bf97b41 am: 587e49e0be am: 2f9d693267
Change-Id: I9371d5e90bae97ce272d4619655864f232c5c5a3
2020-01-18 00:15:31 +00:00
Treehugger Robot
4f0bf97b41 Merge "Add policies for permission APEX data directory." 2020-01-17 23:45:54 +00:00
Automerger Merge Worker
4ba36837ee Merge "Add rules for an unix domain socket for system_server" am: d1b9526ea0 am: 0542be7d19 am: ba4e8fd064
Change-Id: If8f56000150447ef7930161f8c5d24c03525f483
2020-01-17 22:30:22 +00:00
Jing Ji
d1b9526ea0 Merge "Add rules for an unix domain socket for system_server" 2020-01-17 18:53:19 +00:00
Automerger Merge Worker
71f99e2eae Use vndk_prop for old vndk properties am: 291d6b379d am: ab605560e5 am: 03722182c2
Change-Id: If429c741d07734dde446beed088bcbf5912af03d
2020-01-17 03:47:47 +00:00
Automerger Merge Worker
41acac375f Merge "Add selinux contexts for system_config_service" am: 13722174b7 am: 4d6ca6c90f am: f3d9a24c68
Change-Id: Idee54847e68ab5dd61802f55e9b769ca216c6e62
2020-01-17 03:46:11 +00:00
Justin Yun
291d6b379d Use vndk_prop for old vndk properties
For vndk related properties, use vndk_prop context.
vndk_prop can be defined by 'init' and 'vendor_init', but free to
read by any processes.

Bug: 144534640
Test: check boot to see if the VNDK properties are readable
Change-Id: Ifa2bb0ce6c301ea2071e25ac4f7e569ea3ce5d83
2020-01-17 00:24:20 +00:00
Jing Ji
2b12440ff7 Add rules for an unix domain socket for system_server
System_server will listen on incoming packets from zygotes.

Bug: 136036078
Test: atest CtsAppExitTestCases:ActivityManagerAppExitInfoTest
Change-Id: I42feaa317615b90c5277cd82191e677548888a71
2020-01-16 16:09:48 -08:00
Hai Zhang
f301cd299b Add policies for permission APEX data directory.
Bug: 136503238
Test: presubmit
Change-Id: I636ab95070df4c58cf2c98b395d99cb807a7f243
2020-01-16 16:08:55 -08:00
Automerger Merge Worker
ac2dd1ad0d Merge "stable aidl Power HAL policy" am: fbe4afa7aa am: 4cb024e790 am: 03a1842686
Change-Id: I83dd34152278d0b38ee50525950e06f7d77925d7
2020-01-16 23:09:09 +00:00
Treehugger Robot
13722174b7 Merge "Add selinux contexts for system_config_service" 2020-01-16 22:41:42 +00:00
Wei Wang
32b24c0f0b stable aidl Power HAL policy
Test: boot and dumpsys -l
Change-Id: I58022c9e0c24ba4e2d695acf63375c9f74c51b22
2020-01-15 16:53:40 -08:00
Automerger Merge Worker
5a24828f3e Merge "Add SELinux policy for Identity Credential HAL" am: a5527b4e46 am: 8924b794a7 am: 700b98a507
Change-Id: If6578fc781106395bd8e47b13aba4994d41ba986
2020-01-15 23:43:10 +00:00
Treehugger Robot
a5527b4e46 Merge "Add SELinux policy for Identity Credential HAL" 2020-01-15 23:19:03 +00:00
Automerger Merge Worker
4f8e9f257c Merge "perf_event: rules for system and simpleperf domain" am: f644c547ad am: 4f21e1c26b am: a68dee04ff
Change-Id: I7c4dfad29bd386c8f10f14413ec6e1416a68c56d
2020-01-15 22:33:42 +00:00
Hall Liu
719bf1b8ca Add selinux contexts for system_config_service
Add selinux contexts for the new system config service.

Test: atest -it -w SystemConfigTest
Bug: 143112379
Change-Id: Ibe67acb404b6951e1fda9ce28bd50a0efdd44c5f
2020-01-15 11:15:29 -08:00
Ryan Savitski
ffa0dd93f3 perf_event: rules for system and simpleperf domain
This patch adds the necessary rules to support the existing usage of
perf_event_open by the system partition, which almost exclusively
concerns the simpleperf profiler. A new domain is introduced for some
(but not all) executions of the system image simpleperf. The following
configurations are supported:
* shell -> shell process (no domain transition)
* shell -> debuggable app (through shell -> runas -> runas_app)
* shell -> profileable app (through shell -> simpleperf_app_runner ->
                            untrusted_app -> simpleperf)
* debuggable/profile app -> self (through untrusted_app -> simpleperf)

simpleperf_app_runner still enters the untrusted_app domain immediately
before exec to properly inherit the categories related to MLS. My
understanding is that a direct transition would require modifying
external/selinux and seapp_contexts as with "fromRunAs", which seems
unnecessarily complex for this case.

runas_app can still run side-loaded binaries and use perf_event_open,
but it checks that the target app is exactly "debuggable"
(profileability is insufficient).

system-wide profiling is effectively constrained to "su" on debug
builds.

See go/perf-event-open-security for a more detailed explanation of the
scenarios covered here.

Tested: "atest CtsSimpleperfTestCases" on crosshatch-user/userdebug
Tested: manual simpleperf invocations on crosshatch-userdebug
Bug: 137092007
Change-Id: I2100929bae6d81f336f72eff4235fd5a78b94066
2020-01-15 16:56:41 +00:00
Automerger Merge Worker
03aa611733 Merge "Allow init to configure dm_verity kernel driver." am: 4d33dc28e7 am: 5b2d5642d2 am: a004a7ec1e
Change-Id: I587d8ffa98a38c4dd176b1ef09f824e51e5e5b5d
2020-01-15 14:39:42 +00:00
Treehugger Robot
4d33dc28e7 Merge "Allow init to configure dm_verity kernel driver." 2020-01-15 13:13:01 +00:00
David Zeuthen
b8b5da4305 Add SELinux policy for Identity Credential HAL
Bug: 111446262
Test: VtsHalIdentityCredentialTargetTest
Change-Id: Icb5a0d8b24d463a2f1533f8dd3bfa84bf90acc6f
2020-01-14 20:13:39 -05:00
Automerger Merge Worker
7e632d902a SELinux changes for the hasSystemFeature() binder cache property. am: bafd0c762a am: 97ad022d1d am: dbd487c2e7
Change-Id: Ia80e3a2333b8609aed370602900027fea4d83259
2020-01-13 22:30:37 +00:00
Lee Shombert
bafd0c762a SELinux changes for the hasSystemFeature() binder cache property.
The binder_cache_system_server_prop context allows any user to read the
property but only the system_server to write it.  The only property with
this context is currently binder.cache_key.has_system_feature but users
will be added.

Bug: 140788621

Test: this was tested on an image with a binder cache implementation.  No
permission issues were found.  The implementation is not part of the current
commit.

Change-Id: I4c7c3ddf809ed947944408ffbbfc469d761a6043
2020-01-13 10:21:54 -08:00
Automerger Merge Worker
f6a32a265d Merge "Add userspace_reboot_config_prop property type" am: 0b099c801d am: e1811f9499 am: 414328b512
Change-Id: I4ebe3ec270fffc8d8609c2650393f6963e17b0c5
2020-01-09 10:32:08 +00:00
Nikita Ioffe
0b099c801d Merge "Add userspace_reboot_config_prop property type" 2020-01-09 10:05:18 +00:00
Anton Hansson
7130e677ed Merge "Rename sdkext sepolicy to sdkextensions" 2020-01-09 08:46:08 +00:00
Automerger Merge Worker
ceaaa6b050 Merge "Add aidl_lazy_test_server" am: c8c6c0060e am: e5010bdc89 am: 99ed31997b
Change-Id: Id956e28b010dd1fdcbe10bc0d8d5f5d18d0d62a9
2020-01-08 23:02:57 +00:00
Nikita Ioffe
f596cc859b Add userspace_reboot_config_prop property type
This property type will be used for read-only userspace reboot related
properties that are used to configure userspace reboot behaviour, e.g.:
* timeout for userspace reboot watchdog;
* timeout for services to terminate;
* timeout for services to shutdown;
* etc.

Since all this configuration is device specific, vendor_init should be
able to set these properties.

Test: build/soong/soong_ui.bash \
  --make-mode \
  TARGET_PRODUCT=full \
  TARGET_BUILD_VARIANT=eng \
  droid \
  dist DIST_DIR=/tmp/buildbot/dist_dirs/aosp-master-linux-full-eng/funwithprops \
  checkbuild
Bug: 135984674
Bug: 147374477

Change-Id: I1f69980aea6020e788d5d2acaf24c0231939907c
2020-01-08 22:43:57 +00:00
Jon Spivack
c8c6c0060e Merge "Add aidl_lazy_test_server" 2020-01-08 22:26:31 +00:00
Anton Hansson
b84133555a Rename sdkext sepolicy to sdkextensions
The module is getting renamed, so rename all the policy
relating to it at the same time.

Bug: 137191822
Test: presubmit
Change-Id: Ia9d966ca9884ce068bd96cf5734e4a459158c85b
Merged-In: Ia9d966ca9884ce068bd96cf5734e4a459158c85b
(cherry picked from commit 6505573c36)
2020-01-08 11:41:18 +00:00
Anton Hansson
6505573c36 Rename sdkext sepolicy to sdkextensions
The module is getting renamed, so rename all the policy
relating to it at the same time.

Bug: 137191822
Test: presubmit
Change-Id: Ia9d966ca9884ce068bd96cf5734e4a459158c85b
2020-01-08 10:05:16 +00:00
Automerger Merge Worker
ad6c38fa87 Merge "vendor_init can set config.disable_cameraservice" am: 3e93ffb62f am: a5474245a7 am: 7caaf1084e
Change-Id: Ib72332da73e71507e381e0455248d055998c37ef
2020-01-08 07:45:47 +00:00
Treehugger Robot
3e93ffb62f Merge "vendor_init can set config.disable_cameraservice" 2020-01-08 06:59:48 +00:00
Jon Spivack
ae2df6b5de Add aidl_lazy_test_server
This is a test service for testing dynamic start/stop of AIDL services. In order to test realistic use cases with SELinux enabled, it requires the same permissions as a regular service.

Bug: 147153962
Test: aidl_lazy_test aidl_lazy_test_1 aidl_lazy_test_2
Change-Id: Ifc3b2eaefba9c06c94f9cf24b4474107d4e26563
2020-01-07 15:11:03 -08:00
Robin Lee
cbfe879fe6 vendor_init can set config.disable_cameraservice
This had been settable by vendors up to and including Q release by
making config_prop avendor_init writeable. We don't allow this any
more. This should be a real vendor settable property now.

Bug: 143755062
Test: adb logcat -b all | grep cameraservice
Test: atest CtsCameraTestCases
Change-Id: Id583e899a906da8a8e8d71391ff2159a9510a630
2020-01-07 06:57:42 +00:00
Automerger Merge Worker
20ca3d2315 Merge "Add sepolicy for binderfs" am: 50c5d731e0 am: 14b07efeab am: 25b59b848d
Change-Id: I067f265be8cc50f75a65ef8c87746a833d3ca808
2020-01-06 17:15:03 +00:00
Treehugger Robot
50c5d731e0 Merge "Add sepolicy for binderfs" 2020-01-06 16:09:45 +00:00
Martijn Coenen
d38fa3fdf1 Allow init to configure dm_verity kernel driver.
To disable hash-tree prefetching.

Bug: 136247322
Test: atest google/perf/boottime/boottime-test
Change-Id: Ibdcb88d1014f58918119867c6d701dc58af0c049
2020-01-06 09:40:50 +01:00
Automerger Merge Worker
041cbfd39c Revert "Revert "Define sepolicy for ro.product.vndk.version"" am: ed0a8ebe50 am: 176dc81e69 am: 93a8b34cf2
Change-Id: If56c38e51d4f07fe4a8a1069d0f7d9cc25150446
2020-01-06 08:25:37 +00:00
Justin Yun
ed0a8ebe50 Revert "Revert "Define sepolicy for ro.product.vndk.version""
This reverts commit f536a60407.

Reason for revert: Resubmit the CL with the fix in vendor_init.te

Bug: 144534640
Test: lunch sdk-userdebug; m sepolicy_tests
Change-Id: I47c589c071324d8f031a0f7ebdfa8188869681e9
2020-01-06 15:12:14 +09:00
Automerger Merge Worker
4d6b8cc6d8 Revert "Define sepolicy for ro.product.vndk.version" am: f536a60407 am: f71a38667e am: 5ce7c8cb01
Change-Id: I34649f637a64611cc634e78a472bbf33b0973d50
2020-01-06 06:05:13 +00:00
Justin Yun
f536a60407 Revert "Define sepolicy for ro.product.vndk.version"
This reverts commit 59e3983d1f.

Reason for revert: postsubmit fails in aosp/master

Change-Id: Icb10402ccdb6cff942a91adef341fe8f867f308a
2020-01-06 05:28:37 +00:00
Automerger Merge Worker
de275dfccd Define sepolicy for ro.product.vndk.version am: 59e3983d1f am: 8018944364 am: 1791ec6e5d
Change-Id: I4a756a32bea0a5f97fee24432bc88bd18b4a2007
2020-01-06 05:24:46 +00:00
Justin Yun
59e3983d1f Define sepolicy for ro.product.vndk.version
Define a new property_context vndk_prop for ro.product.vndk.version.
It is set by init process but public to all modules.

Bug: 144534640
Test: check if ro.product.vndk.version is set correctly.
Change-Id: If739d4e25de93d9ed2ee2520408e07a8c87d46fe
2020-01-06 11:08:23 +09:00
Automerger Merge Worker
a874279e20 Revert "Reland: "Add userspace_reboot_config_prop property type"" am: 2848fa4d8b am: 9a3f2533af am: e725262f7f
Change-Id: I75590718a0c0c54ec4e70a8998f1cb0093d63485
2019-12-26 16:25:28 +00:00
Automerger Merge Worker
c9643bd0a1 Reland: "Add userspace_reboot_config_prop property type" am: 7b53803b53 am: 3ede7f3af7 am: 8c506f34cd
Change-Id: If4254d4cefef1b2d64a2fd816784eb063699a680
2019-12-26 16:25:14 +00:00
Nikita Ioffe
2848fa4d8b Revert "Reland: "Add userspace_reboot_config_prop property type""
This reverts commit 7b53803b53.

Reason for revert: breaks build
Exempt-From-Owner-Approval: revert to fix broken build
Change-Id: Ic26ee0a8b0a54b86034970e2b18edf0b5f4ec46f
2019-12-26 16:14:45 +00:00
Nikita Ioffe
7b53803b53 Reland: "Add userspace_reboot_config_prop property type"
Only difference with
https://android-review.googlesource.com/c/platform/system/sepolicy/+/1198254
is userspace_reboot_config_prop is now system_restricted_prop.

Marking it as system_internal_prop breaks build:
neverallow check failed at out/target/product/generic/obj/ETC/built_plat_sepolicy_intermediates/built_plat_sepolicy:11968 from system/sepolicy/public/property.te:230
(neverallow base_typeattr_210 base_typeattr_467 (file (ioctl read write create setattr lock relabelfrom append unlink link rename open watch watch_mount watch_sb watch_with_perm watch_reads)))
<root>
allow at out/target/product/generic/obj/ETC/built_plat_sepolicy_intermediates/built_plat_sepolicy:13021
(allow vendor_init base_typeattr_502 (file (read getattr map open)))

Test: flash && adb shell getprop ro.init.userspace_reboot.is_supported
Test: m checkbuild
Bug: 135984674
Change-Id: I6f54dcff8d9b62224f315452e9c320648422b5db
2019-12-24 12:44:36 +00:00
Automerger Merge Worker
65b476cb8c Revert "Add userspace_reboot_config_prop property type" am: 3bd8767540 am: 5dfce326a1 am: c25e123729
Change-Id: Iad607d7e707f558e8af7fd6535537024dfb9528f
2019-12-23 19:45:48 +00:00
Jayachandran Chinnakkannu
3bd8767540 Revert "Add userspace_reboot_config_prop property type"
This reverts commit 8b570f0c60.

Reason for revert: b/146792618 multiple build breaks

Change-Id: Ieab05ce56826d2fc84d46940935705abd2e1a55f
2019-12-23 19:01:13 +00:00
Automerger Merge Worker
65984efed6 Add userspace_reboot_config_prop property type am: 8b570f0c60 am: 6801474288 am: 6f63d45d61
Change-Id: Ic53493cda3dede8b975071efa4e639d8b36f6531
2019-12-23 17:12:56 +00:00
Nikita Ioffe
8b570f0c60 Add userspace_reboot_config_prop property type
This type will be used for read-only properties used to configure
userspace reboot behaviour (e.g. whenever device supports it, watchdog
timeout, etc.).

Test: adb shell getprop ro.init.userspace_reboot.is_supported
Bug: 135984674
Change-Id: I387b2f2f6e3ca96c66c8fa3e6719d013d71f76c7
2019-12-23 15:10:40 +00:00
Automerger Merge Worker
fbfc64bcb0 Merge "sepolicy: new file_integrity_service" am: 8a40d6e70d am: 95daf42ef3 am: bd78650137
Change-Id: Ic8b3111b2e7c20405ff79260293f221d99bcbae1
2019-12-20 23:01:10 +00:00
Victor Hsieh
48a7b5a580 sepolicy: new file_integrity_service
Test: didn't see denials in dmesg during boot or API calls.
Bug: 142573505
Change-Id: Ifa271956bc51bf47d781cd9c9f95afb99c5f940f
2019-12-19 09:25:35 -08:00
Automerger Merge Worker
543878c0b0 Merge "[incremental] labels for incfs and directory root" am: 753ff93ac9 am: 5447ebdee1 am: 597849a405
Change-Id: I4f22ebdce589d0a4f2092245d6ff53aa01dffcb5
2019-12-19 06:39:21 +00:00
Songchun Fan
743f9eddf6 [incremental] labels for incfs and directory root
Adding two labels: "incfs" for the incremental filesystem and
"incremental_root_file" for file paths /data/incremental/*.

Doc: go/incremental-selinux

Test: manual
Change-Id: I7d45ed1677e3422119b2861dfc7b541945fcb7a2
2019-12-18 16:59:31 -08:00
Automerger Merge Worker
3df97da160 Merge "allow system_server to access files under /sys/kernel/ion/" am: a8ca12d1c0 am: 6a306acedd am: 5c515f5d03
Change-Id: I737d197f8ef6efb236008ccd52e9b83b919f8e44
2019-12-17 23:26:29 +00:00