Commit graph

18997 commits

Author SHA1 Message Date
Tom Cherry
2a67e947c6 Use a property instead of file to communicate cold boot done
Ueventd can't set properties currently, but this is an artificial
limitation, since ueventd communicates to init that it has finished
cold boot via a file, and init polls this file instead of returning to
the epoll loop, where properties are handled.

A related change replaces that file with a property and thus frees
ueventd to be able to set properties.  This change creates the
cold_boot_done property type for this property and gives only ueventd
permissions to set it.

Bug: 62301678
Test: boot, check that properties are set
Change-Id: I40843b423b192ea841db6a82f648e5bab9738e0e
2019-06-20 08:37:46 -07:00
Kevin Chyn
0bdb4f269f Merge "Add rules to dump hal traces" 2019-06-20 07:14:51 +00:00
Kevin Chyn
a18c5bdd70 Add rules to dump hal traces
Test: manual
Bug: 126802513

Change-Id: If037483f305e161a158e30f6322d5e25b7770952
Merged-In: If037483f305e161a158e30f6322d5e25b7770952
2019-06-20 00:31:03 +00:00
Treehugger Robot
f4362c08c7 Merge "Revert "Allow hal_face to write to /data/vendor/camera_calibration/*."" 2019-06-19 23:44:27 +00:00
Benjamin Schwartz
405549afd6 Add power stats HAL to ANR list
Bug: 135111122
Test: Ran "adb shell am hang" and verified that power.stats HAL
information is in /data/anr/<anr_file>
Change-Id: I60a6191626a20c737124033e8ad453fa91425e39
(cherry picked from commit 8273f1915f)
2019-06-19 14:35:30 -07:00
Matthias Kramm
ebcc08249b Revert "Allow hal_face to write to /data/vendor/camera_calibration/*."
This reverts commit 3a44b17897.

Reason for revert: Moved to downstream repo.

Change-Id: I7d3ad43335f71ed03e7a93bc5c96a8933785afd8
2019-06-19 20:15:50 +00:00
Dan Willemsen
3c3e59b2a2 Use prebuilt m4 instead of system m4
Bug: 117561006
Test: treehugger
Change-Id: Id794aed10fdffef10490561d2cfeb2a92801b331
2019-06-19 10:59:57 -07:00
Tao Bao
a999e39423 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: Ia85b1a8dfc118efdbb9337ca017c8fb7958dc386
Merged-In: Ibb4e392d5059b76059f36f7d11ba82cd65cbe970
(cherry picked from commit 75182a1ea6)
2019-06-18 17:36:21 -07:00
Nicolas Geoffray
3a9a6f51c1 Merge "Allow zygote to create fds and map executable." 2019-06-18 06:51:39 +00:00
Treehugger Robot
c25272db17 Merge "Add permission required by libdm_test" 2019-06-18 03:49:24 +00:00
Hridya Valsaraju
faa29331cd 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
Merged-Id: Ifb6d58ee6f032cdf3952a05667aa8696d6e2a2fa
2019-06-18 03:47:58 +00:00
Matthias Kramm
9faeec71f2 Merge "Allow hal_face to write to /data/vendor/camera_calibration/*." 2019-06-17 19:31:50 +00:00
Nicolas Geoffray
f77e8c1b0c Allow zygote to create fds and map executable.
This is so that zygote can create the JIT cache with memfd_create
(or ashmem when memfd is not available).

Test: boot
Bug: 119800099
Change-Id: I88f1f6b1c930a8d22985b306a238f60b4af59f9c
2019-06-17 20:18:23 +01:00
Harpreet "Eli" Sangha
1b62e7fd9d atrace: allow tracing of vibrator hal
Test: On-Device Systrace
Change-Id: I4172c83cf50106d28eb7b9330c5bb559fabc504b
Signed-off-by: Harpreet "Eli" Sangha <eliptus@google.com>
2019-06-17 12:25:05 +09:00
Valerie Hau
d3499df3cf Add IMapper2.1 same process hal permissions
Bug: 135166668
Test: build, boot, VtsHalGraphicsComposerV2_2TargetTest
Change-Id: Iedc11b73d3e3ba54dcd622b128cb513adec11d69
2019-06-14 12:31:17 -07:00
Treehugger Robot
1eb45b5606 Merge "In native coverage builds, allow all domains to access /data/misc/trace" 2019-06-14 18:35:25 +00:00
Treehugger Robot
f1f2b514fe Merge "Add macro for dumping hal debug info" 2019-06-14 15:38:24 +00:00
Rick Yiu
1a94b30d9a Add macro for dumping hal debug info
Hal debug info could be dumped in user build by using this macro.

Bug: 134545528
Test: build pass
Change-Id: I650d69607c75b73e95efb3647de5dd03b86cb143
2019-06-14 15:37:59 +00:00
Pirama Arumuga Nainar
ce9c0c5a5f 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
2019-06-14 08:31:51 -07:00
Matthias Kramm
3a44b17897 Allow hal_face to write to /data/vendor/camera_calibration/*.
Also, allow hal_camera to read from there.

Bug: 133792720
Change-Id: Iedec8d7325b4424d166f8e4d09182e1f29808ef2
Test: Running presubmit.
2019-06-14 05:53:59 -07:00
Treehugger Robot
7436dba4c4 Merge "Allow apexd to stop itself" 2019-06-14 06:30:05 +00:00
Tri Vo
0d5455a111 Merge "sepolicy: fix 28.0.ignore.cil build" 2019-06-13 20:25:41 +00:00
Neil Fuller
a83de7b4ac Merge "Track removal of tz data files from runtime module" 2019-06-13 14:13:19 +00:00
Jiyong Park
6e823dd597 Allow apexd to stop itself
apexd stops itself when it finds that it is running on a device with
flattened APEXes (i.e. ro.apex.updatable = false).

Bug: 133907211
Test: launch sdk_phone_x86_64
adb logcat -d | grep apexd | wc -l
returns 3

Change-Id: I7fa161b069aa34adb028194b55f367fe740a0cfc
2019-06-13 09:45:05 +09:00
Tri Vo
e381deb759 sepolicy: fix 28.0.ignore.cil build
29.0.ignore.cil/29.0.cil should be expanded into
28.0.ignore.cil/28.0.cil, so that there is no need to duplicate changes
in both places.

Test: adding a type to 29.0.ignore.cil/29.0.cil only doesn't trigger a
build error.
Change-Id: I543c0fc5e3749211e5bede81aabb0b520435a510
2019-06-12 15:56:05 -07:00
David Anderson
4afae94836 Merge "Allow gsid to read dm nodes from sysfs." 2019-06-12 21:09:59 +00:00
Treehugger Robot
63521329b4 Merge "Sync all_plat_keys to keys.conf" 2019-06-10 23:28:53 +00:00
Dan Willemsen
3afe235071 Sync all_plat_keys to keys.conf
Since this rule does read the networkstack key.

Bug: 130111713
Test: treehugger
Test: run this on RBE, which only exposes the source files depended upon
Change-Id: Ib4c7e0680158e7892c062f00fe64c2da4195da2b
2019-06-10 20:09:14 +00:00
Treehugger Robot
7d258073df Merge "Give hal_drm_server appdomain fd access." 2019-06-10 18:20:47 +00:00
Neil Fuller
073271071a Track removal of tz data files from runtime module
Track the removal of time zone data files from the runtime mainline module.

Bug: 132168458
Test: build / boot only
Change-Id: I67e596e4da2b23726c36866ff1648a833d2853c7
2019-06-10 15:39:19 +01:00
Treehugger Robot
48d81b1c9e Merge "Use BOARD_VENDOR_SEPOLICY_DIRS instead of BOARD_SEPOLICY_DIRS" 2019-06-09 16:33:55 +00:00
Treehugger Robot
ab1e359761 Merge "Add core domain attribute to perfprofd for all targets" 2019-06-08 06:06:17 +00:00
Treehugger Robot
06984017b7 Merge "Sepolicy for vendor hals to access IAshmem" 2019-06-08 06:06:17 +00:00
Tri Vo
3b0ce13eef Merge "README: Use BOARD_VENDOR_SEPOLICY_DIRS" 2019-06-07 23:35:18 +00:00
Kalesh Singh
55181e7f9b Sepolicy for vendor hals to access IAshmem
Although this may appear very permissive, it ok since the current allow
rule already gives every domain access to /dev/ashmem.

Change-Id: I1f121a3c6a911819b2c3e0605a0544a039cb5503
Bug: 134161662
Test: Check logcat for Sepolicy denials (logcat -d | grep shmem)
2019-06-07 15:50:44 -07:00
David Anderson
95fbedd1b0 Allow gsid to read dm nodes from sysfs.
This is needed now that libfiemap_writer reads from dm/name to find
device-mapper names.

Bug: 134536978
Test: gsi_tool install
Change-Id: I10e1234f2ea39c92b43ace97fa76878358dfc476
2019-06-07 14:59:00 -07:00
Felix
ec3ac470a9 README: Use BOARD_VENDOR_SEPOLICY_DIRS
BOARD_SEPOLICY_DIRS is deprecated and references should be updated.

Signed-off-by: Felix <google@ix5.org>
Change-Id: I063940a63256a881206740e8a7ecae215f3a5ca8
2019-06-07 09:23:00 +02:00
Tri Vo
fd3c3e2b2d Use BOARD_VENDOR_SEPOLICY_DIRS instead of BOARD_SEPOLICY_DIRS
bug_map is not picked up correctly when BOARD_VENDOR_SEPOLICY_DIRS is
used. And BOARD_SEPOLICY_DIRS is deprecated.

Test: m selinux_policy
Change-Id: I1dcc6ac6f7b6d0f41f29d5894bef81f3fbf841e6
2019-06-06 17:10:15 -07:00
Ryan Savitski
ce3a33ff18 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 blueline-userdebug
Change-Id: I2aa27e25f0209b3a5cdf5d550d0312693932b808
2019-06-07 01:00:53 +01:00
Kalesh Singh
1fc57087b4 Add core domain attribute to perfprofd for all targets
We want "vendor domain" which is referred to as { domain -coredomain
-appdomain }, to behave the same on user vs userdebug builds.

Bug: 134161662
Test: m selinux_policy / Check logcat for denials
Change-Id: If6757c820ed657ba2b70263bb546a456adcc7cff
2019-06-06 20:57:28 +00:00
Joel Galenson
0608ab5f9d Give hal_drm_server appdomain fd access.
Test: Build.
Change-Id: I29f68964f4ae2ad2c3a00c96f57f48448d8b6dfb
2019-06-05 10:12:28 -07:00
Luke Huang
848075e330 Merge "Clean sepolicy of unused netd_socket" 2019-06-03 06:39:15 +00:00
Tri Vo
50aa029f4b Reland "Add 29.0 mapping files"
Steps taken to produce the mapping files:

1. Add prebuilts/api/29.0/[plat_pub_versioned.cil|vendor_sepolicy.cil]
plat_pub_versioned.cil contains all public attributes and types from Q
Leave vendor_sepolicy.cil is empty.

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

This change also enables treble_sepolicy_tests_29.0 and installs
29.0.cil mapping file onto the device.

Bug: 133155528
Bug: 133196056
Test: m treble_sepolicy_tests_29.0
Test: m 29.0_compat_test
Test: m selinux_policy
Change-Id: I9e83e9bf118c8b8f8fcf84d5c0dcb6eb588e0d55
2019-06-01 17:20:34 -07:00
Tri Vo
336d0fed4e Reland "Fake 29.0 sepolicy prebuilts"
I took current AOSP policy as base, then removed sepolicy so that the
set of type and attributes was a subset of types and attributes in Q
sepolicy, with exception of those that have not yet been cleand up in
current AOSP:

mediaswcodec_server
netd_socket
mediaextractor_update_service
thermalserviced
thermalserviced_exec

Bug: 133196056
Test: n/a
Change-Id: I863429d61d3fad0272c1d3f1e429cd997513a74a
Merged-In: I3e091652fa8d1757b1f71f7559186d5b32f000d5
2019-06-01 17:20:18 -07:00
Treehugger Robot
7b54926292 Merge "Set context for files in the com.android.bootanimation apex" 2019-05-30 11:10:09 +00:00
Luke Huang
3a97f5ae8c Clean sepolicy of unused netd_socket
Bug: 65862741
Test: built, flashed, booted
Change-Id: I25578e54f8c222d381c8f8ea0ec143b5b503b6a6
Merged-In: I726aadd54b04df68cff992b70443c0335ca50972
2019-05-30 17:41:16 +08:00
Treehugger Robot
b374835ffb Merge "Sepolicy for IAshmem HIDL interface" 2019-05-30 07:36:41 +00:00
Treehugger Robot
0ae642542a Merge "Test files on intermediates dir, not on /system" 2019-05-30 00:43:52 +00:00
Kalesh Singh
46303aa1f7 Sepolicy for IAshmem HIDL interface
Change-Id: Id78f995661120f136d671ea0084db358e7662122
Bug: 133443879
Test: Manually check logcat for sepolicy denials (logcat | grep IAshmem)
2019-05-29 14:44:47 -07:00
Treehugger Robot
0dea10cff7 Merge "Fix missing rename of all_keys -> all_plat_keys" 2019-05-29 21:34:44 +00:00