Commit Graph

20619 Commits

Author SHA1 Message Date
Daniel Rosenberg
eb1cf76b70 sepolicy: Adjust policy for migrate_legacy_obb_data.sh
Required to check if migration is necessary and migrate obb contents

Bug: 136199978
Test: make
Change-Id: I23890e4eeea1da7791e25ce5c9584b1abe94f440
(cherry picked from commit 793dc8f8da)
2019-07-16 02:55:25 +00:00
android-build-team Robot
097deb63ac Snap for 5704971 from 9bfaa1c4dd to qt-release
Change-Id: Ic8ac05fbe017795e71aa40b0552b5100f1db6692
2019-07-03 03:17:28 +00:00
android-build-team Robot
4da2491945 Snap for 5698743 from 9067699d9d to qt-release
Change-Id: Id95b0fccc4252fbac9e72dabca96410b92edcc37
2019-06-29 23:14:28 +00:00
Sidath Senanayake
9bfaa1c4dd Allow perfetto to access gpu_frequency tracepoint in user
This will allow Perfetto to capture GPU frequency changes
on the target, which is useful to graphics developers
using Perfetto to profile graphics HW usage.

This change also updates the private prebuilt at version
29.0 to match the update.

Bug: 136062452
Merged-In: Idb7870b2f674f1359ef3b4487dbeff190b394248
Change-Id: Ib98ba10d96caa199d7030be3a17148045576a80c
2019-06-28 20:13:05 +01:00
Todd Kennedy
9067699d9d Allow rule to let settings access apex files
In order to show licensing information, we need to read it from
an asset stored in the .apex file.

Bug: 135183006
Test: Manual; settings can access apex files stored on /data
Change-Id: I71fbde6e295d9c890c9b9b0449e5150834a6680e
Merged-In: I71fbde6e295d9c890c9b9b0449e5150834a6680e
2019-06-27 11:32:49 -07:00
android-build-team Robot
4f434a42da Snap for 5681426 from 72a75ffe19 to qt-release
Change-Id: Ib137a973f3fdcda6adff9a27622ee6901e255e88
2019-06-22 23:18:16 +00:00
Oliver Nguyen
72a75ffe19 Merge "In native coverage builds, allow all domains to access /data/misc/trace" into qt-dev 2019-06-20 19:07:41 +00:00
android-build-team Robot
242c5e1da3 Snap for 5674462 from 6d976f4d5d to qt-release
Change-Id: I1f58f49654397975f3d2765304a33269115feaeb
2019-06-20 03:03:57 +00:00
Pirama Arumuga Nainar
b65824642b In native coverage builds, allow all domains to access /data/misc/trace
Bug: http://b/135139675

Coverage files are written to /data/misc/trace (governed by the
method_trace_data_file selinux type).  Allow all domains to access
(create directories, access files) this directory when native coverage
is enabled (by setting NATIVE_COVERAGE to true) in an userdebug or eng
build.

Also relax neverallow constraints to allow access to
method_trace_data_file for native coverage builds.

Test: Build 32-bit cuttlefish with coverage:
          m NATIVE_COVERAGE=true COVERAGE_PATHS="*"
      and verify that there are no selinux denials in kernel log and
      logcat.

Change-Id: I3fe7c77612854b9de7de7a0ddd5cbf44a2f5c21e
(cherry picked from commit ce9c0c5a5f)
2019-06-19 16:27:17 -07:00
Kevin Chyn
6d976f4d5d Add rules to dump hal traces
Test: manual
Bug: 126802513

Change-Id: If037483f305e161a158e30f6322d5e25b7770952
2019-06-19 19:55:14 +00:00
android-build-team Robot
126fcc290a Snap for 5671254 from 890dba4999 to qt-release
Change-Id: I72ee7a6e132f0f59f73b4c1ffdbb31a4087bff82
2019-06-19 03:12:54 +00:00
Tao Bao
890dba4999 Merge "Add persist.sys.theme." into qt-dev 2019-06-19 00:36:03 +00:00
Hridya Valsaraju
9bb71537ac Add permission required by libdm_test
This CL fixes the following denials during libdm_test
that is part of VTS.

avc: denied { read } for comm="loop1" path=2F6D656D66643A66696C655F32202864656C6574656429
dev="tmpfs" ino=97742 scontext=u:r:kernel:s0 tcontext=u:object_r:appdomain_tmpfs:s0
tclass=file permissive=0
W loop1   : type=1400 audit(0.0:371): avc: denied { read } for
path=2F6D656D66643A66696C655F32202864656C6574656429 dev="tmpfs" ino=97742 scontext=u:r:kernel:s0
tcontext=u:object_r:appdomain_tmpfs:s0 tclass=file permissive=0

Bug: 135004816
Test: adb shell libdm_test
Change-Id: Ifb6d58ee6f032cdf3952a05667aa8696d6e2a2fa
2019-06-17 22:46:03 +00:00
Tao Bao
75182a1ea6 Add persist.sys.theme.
This property will be set by system_server (to indicate the currently
selected theme for device), and can be accessed by vendor init.rc.

avc:  denied  { read } for property=persist.sys.theme pid=0 uid=0 gid=0 scontext=u:r:vendor_init:s0 tcontext=u:object_r:theme_prop:s0 tclass=file

Bug: 113028175
Test: Set a vendor init trigger that waits on `persist.sys.theme`. Check
      that the trigger fires without denial.
Change-Id: Ibb4e392d5059b76059f36f7d11ba82cd65cbe970
2019-06-17 10:48:21 -07:00
android-build-team Robot
53d5b4ee0b Snap for 5664486 from 6dc831d2fb to qt-release
Change-Id: I78f21b36c99cc0cd00506793f23ce6e2cddf9b93
2019-06-16 23:05:06 +00:00
TreeHugger Robot
6dc831d2fb Merge "system_server_startup: allow SIGCHLD to zygote" into qt-dev 2019-06-16 00:29:00 +00:00
android-build-team Robot
3845ff7d15 Snap for 5663820 from 72f247f5ff to qt-release
Change-Id: I6ffe12e29c5b22c1e992804020e4e3407b2ff7c7
2019-06-15 23:12:05 +00:00
Jeff Vander Stoep
e0d9e50c96 system_server_startup: allow SIGCHLD to zygote
avc: denied { sigchld } for comm="main"
scontext=u:r:system_server_startup:s0 tcontext=u:r:zygote:s0
tclass=process permissive=0

Test: build
Bug: 134496658
Change-Id: I98c106b17ba1740f953c3108bd0fc927c150096f
(cherry picked from commit 67dc274f87)
2019-06-14 16:56:05 -07:00
Ryan Savitski
72f247f5ff userdebug: support perfetto traces as a section in incident reports
This set of patches adds a way for the perfetto command line client to
save a trace to a hardcoded location,
/data/misc/perfetto-traces/incident-trace, and call into incidentd to
start a report, which will include said trace in a new section.

This is not a long-term solution, and is structured to minimize changes
to perfetto and incidentd. The latter is currently architected in a way
where it can only pull pre-defined information out of the system, so
we're resorting to persisting the intermediate results in a hardcoded
location.

This will introduce at most two more linked files at the same time.

Bug: 130543265
Bug: 134706389
Tested: manually on crosshatch-userdebug
Merged-In: I2aa27e25f0209b3a5cdf5d550d0312693932b808
Change-Id: I2aa27e25f0209b3a5cdf5d550d0312693932b808
(cherry picked from commit ce3a33ff18)
2019-06-07 16:59:49 +01:00
android-build-team Robot
5b32214743 Snap for 5616629 from 51fae66027 to qt-release
Change-Id: Ie7393775693b8aab50623fc77bdd9b4344d244f3
2019-05-30 03:09:16 +00:00
David Anderson
51fae66027 Allow init to mkdir inside /data/gsi.
Bug: 133435561
Test: adb shell gsi_tool install
Change-Id: Iaa610c72d8098e157bb89e321624369f86f4ea19
Merged-In: Iaa610c72d8098e157bb89e321624369f86f4ea19
2019-05-28 13:42:42 -07:00
android-build-team Robot
b88acd9c66 Snap for 5605988 from 4cd2db897d to qt-release
Change-Id: I126f5ddf0f42db1712eaa4a1c2ff2c6e8dd884c2
2019-05-25 23:20:23 +00:00
Alistair Strachan
4cd2db897d Merge "Fix selinux denials when applying updates in recovery." into qt-dev 2019-05-24 17:50:56 +00:00
Anton Hansson
097f48c810 Merge "sepolicy: Add policy for migrate_legacy_obb_data.sh" into qt-dev 2019-05-24 11:06:50 +00:00
TreeHugger Robot
cf48bfd082 Merge "Properly define hal_codec2 and related policies" into qt-dev 2019-05-24 07:21:23 +00:00
Max Dashouk
d0482ba4ba Allows StatsCompanionService to pipe data to statsd.
Bug: 132444397
Test: manually tested with ag/7555609

Change-Id: I9e5f0a9d501a6728af3f27241300b3bb5c5c2123
Merged-In: I9e5f0a9d501a6728af3f27241300b3bb5c5c2123
(cherry picked from commit febfa8f22d)
2019-05-23 20:35:34 +00:00
David Anderson
115aafa7ab Fix selinux denials when applying updates in recovery.
These lines are copied from update_engine.te, and are needed to update
dynamic partitions in recovery.

Bug: 132943965
Test: sideload OTA on cuttlefish
Change-Id: Id03a658aac69b8d20fa7bb758530a4469c75cf9c
Merged-In: Id03a658aac69b8d20fa7bb758530a4469c75cf9c
2019-05-23 13:20:03 -07:00
Narayan Kamath
0574e4cdab sepolicy: Add policy for migrate_legacy_obb_data.sh
.. and let installd execute it. Required to migrate legacy obb contents

Bug: 129167772
Test: make

Change-Id: I35d35016680379e3a9363408704ee890a78a9748
2019-05-23 17:26:08 +01:00
Pawin Vongmasa
609c243dd0 Properly define hal_codec2 and related policies
Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 131677974
Change-Id: I59c3d225499a8c53c2ed9f3bd677ff3d7423990b
2019-05-23 03:53:47 -07:00
android-build-team Robot
97a3d3a1b8 Snap for 5595753 from ab2e89a695 to qt-release
Change-Id: I8028b1300c5c7431638aa6cab0b57b7e8e07550a
2019-05-23 03:16:21 +00:00
Tri Vo
ab2e89a695 Merge "sepolicy: allow hal_omx to access audio devices" into qt-dev 2019-05-22 21:49:49 +00:00
TreeHugger Robot
63ab8cd63c Merge "Add support_kernel_idle_timer to sepolicy" into qt-dev 2019-05-22 18:47:52 +00:00
Tao Bao
0ad88f096a Merge changes from topic "darkboot-sepolicy" into qt-dev
* changes:
  Add vendor_misc_writer change to API 29 prebuilts.
  Add vendor_misc_writer.
  Add persist.sys.device_provisioned change to API 29 prebuilts.
  Set persist.sys.device_provisioned vendor-init-readable.
2019-05-22 18:35:19 +00:00
Vignesh Kulothungan
ce9fc89865 sepolicy: allow hal_omx to access audio devices
hal_omx needs to access audio devices to use OMX HW decoders and
encoders. Allow hal_omx to access audio devices.

authored-by: Banajit Goswami <bgoswami@codeaurora.org>

Bug: 133224154
Change-Id: I742c29c4105e5647ca1a7e017e311559a0567b52
(cherry picked from commit 155ca12879)
2019-05-22 10:35:16 -07:00
TreeHugger Robot
41372ad8b8 Merge "atrace: debug: allow notifying camera HAL of a change in sysprops" into qt-dev 2019-05-22 16:48:22 +00:00
android-build-team Robot
bf7e7aa000 Snap for 5591509 from dc42fed227 to qt-release
Change-Id: I76d5d054b5e36ab7238403dc1d2c25695862d4c4
2019-05-22 03:15:29 +00:00
TreeHugger Robot
dc42fed227 Merge "Allow init to set context for super_block_device" into qt-dev 2019-05-21 20:10:56 +00:00
Hridya Valsaraju
6d66c0214f Allow init to set context for super_block_device
Fixes the following denial during boot:

[    1.358156] selinux: SELinux: Could not set context for
/dev/block/platform/soc/1d84000.ufshc/by-name/super:  Permission denied\x0a
[    1.358275] audit: type=1400 audit(951562.676:7):
avc:  denied  { relabelto } for  pid=1 comm="init" name="super"
dev="tmpfs" ino=17657 scontext=u:r:init:s0 tcontext=u:object_r:super_block_device:s0
tclass=lnk_file permissive=0

Bug: 124410201
Test: make
Change-Id: Ib6752b8a6ae4211ba8c0a7417295b8144a2fed67
Merged-In: Ib6752b8a6ae4211ba8c0a7417295b8144a2fed67
2019-05-21 16:53:39 +00:00
Tao Bao
e618874192 Add vendor_misc_writer change to API 29 prebuilts.
This is a matching change for commit 8f39cce73a ("Add
vendor_misc_writer."), which updates the prebuilts for API 29.

Bug: 132906936
Test: Build crosshatch that includes misc_writer module. Invoke
      /vendor/bin/misc_writer to write data to /misc.
Change-Id: Id12a1ed45c8cef6e4039a9dda6a1fb41f9e014de
2019-05-21 07:11:36 -07:00
Tao Bao
8f39cce73a Add vendor_misc_writer.
The space between 2K and 16K in /misc is currently reserved for vendor's
use (as claimed in bootloader_message.h), but we don't allow vendor
module to access misc_block_device other than vendor_init.

The change in the topic adds a `misc_writer` tool as a vendor module,
which allows writing data to the vendor space to bridge the gap in the
short term. This CL adds matching labels to grant access.

Long term goal is to move /misc as vendor owned, then to provide HAL
access from core domain (b/132906936).

Bug: 132906936
Test: Build crosshatch that includes misc_writer module. Invoke
      /vendor/bin/misc_writer to write data to /misc.
Change-Id: I4c18d78171a839ae5497b3a61800193ef9e51b3b
Merged-In: I4c18d78171a839ae5497b3a61800193ef9e51b3b
(cherry picked from commit 42c05cfcc1)
2019-05-21 07:06:31 -07:00
Tao Bao
ab8db0999c Add persist.sys.device_provisioned change to API 29 prebuilts.
This is a matching change for commit 97d4561941 ("Set
persist.sys.device_provisioned vendor-init-readable."), which updates
the prebuilts for API 29.

Bug: 131702833
Bug: 132906936
Test: Set an init trigger that waits on `persist.sys.device_provisioned`.
      Check that there's no longer a denial.
Change-Id: I2cea3d000b7faa471fa524dcd7a3d4843ae5960f
2019-05-21 07:04:37 -07:00
Tao Bao
97d4561941 Set persist.sys.device_provisioned vendor-init-readable.
`persist.sys.device_provisioned` is set (more precisely, "will be set",
via internal change in ag/7567585) by system_server based on device
privisioning state. This CL grants vendor_init to set up action triggers
based on the property value.

avc:  denied  { read } for property=persist.sys.device_provisioned pid=0 uid=0 gid=0 scontext=u:r:vendor_init:s0 tcontext=u:object_r:system_prop:s0 tclass=file permissive=0

Bug: 131702833
Bug: 132906936
Test: Set an init trigger that waits on `persist.sys.device_provisioned`.
      Check that there's no longer a denial.
Change-Id: I64e50bd31c90db4b3bdd3bd014a90d7bef708b57
Merged-In: I64e50bd31c90db4b3bdd3bd014a90d7bef708b57
(cherry picked from commit 264a929edb)
2019-05-21 07:01:37 -07:00
Nikita Ioffe
f7c3d19d29 selinux: Allow dumpstate send signals to vold
Test: adb bugreport
Test: verified vold stacktrace is present in bugreport
Bug: 132344997
Change-Id: I0ebf7f171d854b9aaf894ccb8c7a5f68f18e692b
2019-05-21 13:03:55 +01:00
Alec Mouri
2e4dd2b6f2 Add support_kernel_idle_timer to sepolicy
Bug: 130684082
Test: boots
Change-Id: I7ee84a5ff1024162037634d6f5efe7b09557e18a
2019-05-20 10:34:40 -07:00
Ryan Savitski
37f0662413 atrace: debug: allow notifying camera HAL of a change in sysprops
Similar to aosp/961857, but enables the logging of atrace events from
the camera HAL (primarily HIDL interactions, but also a couple of ION
events).

Keeping it confined to userdebug_or_eng. Longer-term planning belongs on
b/78136428.

Not adding fwk_camera_hwservice, as it is a HIDL interface to
cameraserver (which is already covered above).

Plus slight reorganization of existing atrace.te contents, and donaudits
to reduce logspam from denials (including pre-existing ones that were
hitting the rate limiter).

Specific denials addressed (listing HALs, finding camera HAL, notifying it):
05-15 18:07:19.684   618   618 E SELinux : avc:  denied  { list } for  scontext=u:r:atrace:s0 tcontext=u:r:hwservicemanager:s0 tclass=hwservice_manager permissive=1
05-15 18:07:19.701   618   618 E SELinux : avc:  denied  { find } for interface=android.hardware.camera.provider::ICameraProvider sid=u:r:atrace:s0 pid=10137 scontext=u:r:atrace:s0 tcontext=u:object_r:hal_camera_hwservice:s0 tclass=hwservice_manager permissive=1
05-15 18:07:19.698 10137 10137 I atrace  : type=1400 audit(0.0:273): avc: denied { call } for scontext=u:r:atrace:s0 tcontext=u:r:hal_camera_default:s0 tclass=binder permissive=1

Bug: 130543265
Tested: flashed blueline-userdebug, took a trace with perfetto, confirmed HIDL atrace slices present in camera hal trace.
Merged-In: I0f8ce989355603e41d6c05c3de07e7dd615555eb
Change-Id: I0f8ce989355603e41d6c05c3de07e7dd615555eb
(cherry picked from commit 19459a3802)
2019-05-19 16:50:59 +01:00
android-build-team Robot
f843817dd5 Snap for 5582428 from 676d9590f4 to qt-release
Change-Id: I6931b325f0ef9b8801aee4976666876ad9292787
2019-05-18 23:14:43 +00:00
Ady Abraham
676d9590f4 Merge "Add ro.surface_flinger.set_touch_timer_ms to sepolicy" into qt-dev 2019-05-17 17:20:12 +00:00
Ady Abraham
a6ba39bde1 Add ro.surface_flinger.set_touch_timer_ms to sepolicy
Test: set ro.surface_flinger.set_touch_timer_ms from init
Bug: 131906818
Change-Id: If489ae4ac993984305f764fb172014f42c41df67
2019-05-16 14:07:32 -07:00
Ryan Savitski
fb897428f6 atrace.te: allow notifying cameraserver of a change in sysprops
This allows the atrace cmd to notify cameraserver (the host of
media.camera service) that the set of tracing-related system properties
have changed. This allows the cameraserver to notice that it might need
to enable its trace events.

The atrace cmd has the necessary permission when running as shell, but
not when it is running as the "atrace" domain (notably when exec'd by
perfetto's traced_probes).

We're adding cameraserver to the whitelist as it contains important
events for investigating the camera stack.

Example denial:
05-14 22:29:43.501  8648  8648 W atrace  : type=1400 audit(0.0:389): avc: denied { call } for scontext=u:r:atrace:s0 tcontext=u:r:cameraserver:s0 tclass=binder permissive=0

Tested: flashed blueline-userdebug, captured a perfetto trace with "camera" atrace category, confirmed that userspace atrace events are included in the trace.
Bug: 130543265
Merged-In: Ifd3fd5fd3a737c7618960343b9f89d3bf7141c94
Change-Id: Ifd3fd5fd3a737c7618960343b9f89d3bf7141c94
(cherry picked from commit 232295e8db)
2019-05-16 14:45:55 +01:00
android-build-team Robot
35a2785328 Snap for 5571215 from 94b7372534 to qt-release
Change-Id: I0c91c9d484023a905f8e8693d4cdb5d0c4b9d4ca
2019-05-16 03:03:09 +00:00