Commit graph

58698 commits

Author SHA1 Message Date
Elliott Hughes
ad0614b855 Merge "Fix logd's implicit dependency on libsysutils." 2020-08-21 20:31:07 +00:00
Elliott Hughes
73bfaa2745 Merge "libcrypto_utils: switch to C++." 2020-08-21 19:23:15 +00:00
Marco Ballesio
8b0b53a913 Merge changes from topic "cgroup v2 freezer"
* changes:
  init.rc: remove initializations to cg2_bpf path
  libprocessgroup: json prototype for cgroups v2
  libprocessgroup: switch freezer to cgroup v2
  freezer: allow dynamic changes to freezer.state
2020-08-21 18:41:11 +00:00
Elliott Hughes
91784040db libcrypto_utils: switch to C++.
brillo is long gone, so no one should care about being C any more, and
this will let future janitorial work take advantage of RAII.

Test: treehugger
Change-Id: I06acd01e8b30247bed6e971ab3e8660d3e599cce
2020-08-21 10:34:56 -07:00
Marco Ballesio
fdc03350f4 init.rc: remove initializations to cg2_bpf path
https://r.android.com/c/1324649/5 moves the cgroup folder to its sysfs
path. Directory access rights are defined by kernel code and sepolicy,
so remove the initialization lines from init.rc.

Test: manually booted the device and verified access rights for
/sys/fs/cgroup
Bug: 154548692

Change-Id: I67284dc651ed529cae69e413b66c6e1292a2d970
2020-08-21 09:18:58 -07:00
Treehugger Robot
cdfef7fe9e Merge "libcrypto_utils: Use accessors to manipulate RSA keys." 2020-08-21 15:49:09 +00:00
Treehugger Robot
59ca901218 Merge "Add systrace tag for system property" 2020-08-21 09:33:53 +00:00
Yo Chiang
5ca85a05e3 Merge "Improve ImageManager error message" 2020-08-21 08:01:21 +00:00
Marco Ballesio
43050baa7f libprocessgroup: json prototype for cgroups v2
cgroups v2 support introduces new fields in the json format. Adapt the
proto file accordingly

Bug: 154548692
Test: atest libprocessgroup_proto_test --
Change-Id: I40f8757a8f4e6a0b839caa7faa976dfebf3aac98
2020-08-20 15:53:48 -07:00
Elliott Hughes
0fe3b67024 Fix logd's implicit dependency on libsysutils.
We're trying to remove the implicit dependency on libsysutils that *all*
code has via the symlink in system/core/include/, but netd and logd have
code that #includes the headers without declaring the dependency (which
works out in the end because their executables declare the dependency).

Bug: http://b/165825252
Test: treehugger
Change-Id: I8c582e427d9dbe7d9f8172c445f38ae2737a9049
2020-08-20 15:40:57 -07:00
Marco Ballesio
1c755e22c8 libprocessgroup: switch freezer to cgroup v2
remove cgroup v1 freezer entries from init.rc, add a new cgroup v2
controller and modify plists to properly interact with it.

Bug: 154548692
Test: manually verified the the cgroup v1 freezer controller isn't
created and a new controller for cgroup v2 is created under the correct
sysfs directory.

Change-Id: I1b811300ade486f88fdbd157255a7f37750cc54d
2020-08-20 15:11:41 -07:00
Yo Chiang
36a21704e0 Merge "TranformFstabForDsu adds missing partition entries to fstab" 2020-08-20 06:38:44 +00:00
David Anderson
34dda54411 Merge "Initial prototype of COW format and API." 2020-08-19 23:13:38 +00:00
David Benjamin
40ea8bc1eb libcrypto_utils: Use accessors to manipulate RSA keys.
This removes a blocker to BoringSSL marking the RSA struct opaque.
Sadly, OpenSSL's RSA_set0_key setter is a little tedious to use
correctly with error-handling, but it works.

Along the way, replace the byte reversing code with BoringSSL's native
little-endian BIGNUM conversion functions.

Test: libcrypto_utils_test passes
Change-Id: I298a6360d76fc7793462cd55bd57bc673c4975b3
2020-08-19 17:41:44 -04:00
David Anderson
0324725548 Initial prototype of COW format and API.
This is an initial prototype of the new COW format. It does not have
support for merge sequencing or merge state tracking.

The reader and writer APIs have pure virtual interfaces to support
mocking. The writer implementation performs compression, but the reader
interface does not (yet), it only supports iterating over metadata and
performing basic validation.

Bug: 162274240
Test: manual tests
      cow_api_test gtest
Change-Id: Ib9fddc1f210700688e6786917b023dfabd5fb3d9
2020-08-19 13:56:57 -07:00
Marco Ballesio
76eca5b4c1 freezer: allow dynamic changes to freezer.state
create new profiles to allowing thawing and freezing back the freezer
cgroup

Bug: 151225245
Test: Manually verified that using the SetTaskProfiles method on the
profiles thaws and freezes back the freezer cgroup.

Change-Id: I7f3e193ebe79b49c1f6ac52b6138ff4ec26fc570
2020-08-19 13:18:28 -07:00
Yo Chiang
93c78c243d Improve ImageManager error message
Print more helpful error messages to logcat.

Bug: 165471299
Test: Observe logcat
Change-Id: I3dca834a7cd3f653b038fc3a4020e96f500e1d1f
2020-08-19 19:31:15 +08:00
Yo Chiang
e48dbc2004 TranformFstabForDsu adds missing partition entries to fstab
Fix odd bug that TranformFstabForDsu doesn't emplace entry to fstab.

.avb_keys should be set to "/avb", the directory that stores all DSU
avbpubkeys, instead of appending.

Bug: 165471299
Test: Boot a multipartition DSU package
Change-Id: I62ee2f8bf7113f6d2af8cc34ef19c9743029ea0a
2020-08-19 14:17:37 +08:00
Bowgo Tsai
f4bf7f3a94 Add systrace tag for system property
Introduce a new systrace tag, TRACE_TAG_SYSPROP, for use with
system property.

Bug: 147275573
Test: build
Change-Id: I6f85f3f52f6580bab4ff43fc1dc0e87c689b054e
Merged-In: I6f85f3f52f6580bab4ff43fc1dc0e87c689b054e
(cherry picked from commit 573fc58bad)
2020-08-19 12:48:07 +08:00
Treehugger Robot
d7cb6e1fd0 Merge "Revert "Fix non-existent module error"" 2020-08-18 07:41:01 +00:00
Elliott Hughes
5d0eb66590 Merge "Deprecate <utils/Debug.h>." 2020-08-17 20:36:10 +00:00
Elliott Hughes
af99e1e88a Merge "Don't #include <utils/Debug.h> from <utils/Flattenable.h>." 2020-08-17 20:35:59 +00:00
Paul Crowley
5350746a2b Merge "Set ro.crypto.type even on failure" 2020-08-17 20:14:25 +00:00
Tom Cherry
5b02193f5c Merge "Remove android_lookupEventTagNum() and related code" 2020-08-17 19:58:22 +00:00
Tom Cherry
d11f2371e1 Remove android_lookupEventTagNum() and related code
This was introduced years ago but never gained any users.

Test: build
Merged-In: Id2deb6de1839f995970c6350a1970a872f0b51cf
Change-Id: Id2deb6de1839f995970c6350a1970a872f0b51cf
2020-08-17 18:04:00 +00:00
Elliott Hughes
884cedc770 Don't #include <utils/Debug.h> from <utils/Flattenable.h>.
It's not used, and shouldn't be used.

Also switch to `#pragma once`.

Test: treehugger
Change-Id: I464d3de1b0e1d536cea06362e6c73fddaad967d1
2020-08-17 10:14:16 -07:00
Elliott Hughes
832815151f Deprecate <utils/Debug.h>.
I stumbled across this because of the `#ifdef __cplusplus` inside an
unguarded `namespace`, but this whole file should be deprecated and
removed in favor of static_assert.

Test: treehugger
Change-Id: I2b65db67e694115e915f0cc9d762b0fd41a7d2af
2020-08-17 10:07:29 -07:00
Treehugger Robot
920393ddb7 Merge "Revert "[adb] fix signature check"" 2020-08-15 10:59:15 +00:00
Jaegeuk Kim
8a6e8be2b8 Merge "fs_mgr: try tune2fs for casefolding on /data only" 2020-08-15 03:42:05 +00:00
Alex Buynytskyy
2698b8ddeb Revert "[adb] fix signature check"
This reverts commit c935d0c450.

Reason for revert: invalid test, let's change it instead of breaking incremental installations

Change-Id: Ie5fb318c26d3a74cd2dbb16e09bda018efece211
2020-08-14 23:45:00 +00:00
Songchun Fan
d500072443 Merge "[adb] fix signature check" 2020-08-14 21:32:39 +00:00
Jaegeuk Kim
5ba5b90cd6 fs_mgr: try tune2fs for casefolding on /data only
Bug: 163420666
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Id646bd25d6fed0f547fb0647150acdc4845a5eec
2020-08-14 12:57:25 -07:00
Songchun Fan
c935d0c450 [adb] fix signature check
BUG: 163543633
Test: atest CtsIncrementalInstallHostTestCases
Change-Id: Ie65d4639d5fb5b2dc100f1d17e3dd1c843510325
2020-08-14 11:49:58 -07:00
Paul Crowley
9acab5a4d6 Set ro.crypto.type even on failure
Move responsibility for setting ro.crypto.type into fs_mgr_mount_all,
so that even if setting up the filesystem fails, the type is set
correctly and so errors are appropriately handled.

Bug: 162289984
Test: simulate a failure and check that it's set.
Change-Id: Ib061a454e7e21d7206c3c1fa8e88e16618099581
2020-08-14 11:36:39 -07:00
Treehugger Robot
e473c89c52 Merge "libcutils: use 0 for netlink socket port id" 2020-08-14 17:52:37 +00:00
Gyeongtaek Lee
2f11cb4c4c libcutils: use 0 for netlink socket port id
AudioHAL and SoundtriggerHAL is separeted HAL but running in thread with
same process id.
So, if both HAL try to open netlink socket using uevent_open_socket(),
secondly opening socket receives already-in-use error.
To prevent situation, set 0 to socket port id.
By the LINUX man page, "The kernel assigns the process ID to the first
netlink socket the process opens and assigns a unique nl_pid to every
netlink socket that the process subsequently creates."

Bug:163008274
Test: tested by opening netlink socket in AudioHAL and
SoundtriggerHAL both.

Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
Change-Id: I5f9859e8dac749bf5d0998e825043c9988c202ba
2020-08-14 21:29:17 +09:00
Christopher Ferris
278f11b574 Merge "Set warning for dex pc not in map." 2020-08-13 23:25:26 +00:00
Florian Mayer
96e966eb3d Set warning for dex pc not in map.
This way, the profilers will know they have to reparse maps.

Bug: 163130539

Test: Verified updated unit tests pass.
Change-Id: I88a801ffdda12811eab5e4833dcf472f2d75c09a
2020-08-13 13:07:21 -07:00
Tom Cherry
0398117a9a Merge "Reland: "liblog: use a blocking socket for sending messages to logd""" 2020-08-13 15:15:57 +00:00
Yo Chiang
4adce5fec3 Revert "Fix non-existent module error"
This reverts commit 78ee4c1005.

Reason for revert: revert bad fix

Change-Id: I45c2bc2414679d525677b0bc103167316e16b0c4
2020-08-13 04:54:18 +00:00
Tom Cherry
7ef8bca1f9 Merge changes I40fe9b79,I4b6f8331
* changes:
  logd: SerializedLogBuffer: never wait for a reader during prune/clear
  logd: always wake 'wrapped' readers on prune
2020-08-12 22:44:42 +00:00
Tom Cherry
3932a9c074 logd: SerializedLogBuffer: never wait for a reader during prune/clear
Previously, chatty had logic that would skip a certain number of log
entries to satify pruning, but otherwise keep the reader connected.
This was a best-effort attempt at helping pruning and had additional
logic that handled further disruptions, if logd's memory was 2x the
allotted memory.

The new logic has two components:
1) memcpy() each individual log message in FlushTo() such that there
are no references to the underlying log data without a lock held.
Note, that this memcpy is completely negligible for performance.
2) In Prune(), immediately delete all log chunks required to reduce
memory to the allotted amount, which is now safe given 1).  If readers
will lose logs, continue to print a warning.

This additionally makes the Clear() logic deterministic.  It was
previously best effort in chatty, but will immediately and always
clear all logs for SerializedLogBuffer.

Bug: 163617910
Test: logging unit tests
Test: Prune() immediately frees buffers during high log pressure
Test: Clear() immediately frees buffers during high log pressure
Change-Id: I40fe9b791312af3dc256b166e5c34425f4ca51ac
2020-08-12 12:49:56 -07:00
Treehugger Robot
1173476551 Merge "Fix non-existent module error" 2020-08-12 19:49:18 +00:00
Treehugger Robot
b9edfee8a2 Merge "charger: Avoid a couple string constructions" 2020-08-12 19:29:49 +00:00
Tom Cherry
c5282c2121 Reland: "liblog: use a blocking socket for sending messages to logd""
This reverts commit b1eb731197.

Test: post-submit failure now passes
Change-Id: Iabbd18ad8403dd30aa07dd73e42fcc5b233b0222
2020-08-12 10:51:27 -07:00
Tom Cherry
d0e8451d59 logd: always wake 'wrapped' readers on prune
See the comment in the code for more details.  'wrapped' readers are
uncommon and error prone, and this change makes them more reliable.
Its side effect is that wrapped readers will wake more often, but
they'll still be batched to a large degree.

Bug: 163617910
Test: logging unit tests
Test: logcat --wrap does the right thing
Change-Id: I4b6f8331ff7854787c97f821b2a5bf8d7da321c6
2020-08-12 10:42:44 -07:00
Tom Cherry
0df0fcbb9d Merge "logd: add a test that logd ignores SIGPIPE" 2020-08-12 17:18:57 +00:00
Yo Chiang
78ee4c1005 Fix non-existent module error
TARGET module init_vendor requires non-existent TARGET module: init_first_stage

Module `init_first_stage` is skipped (not defined) on ASAN builds.

Bug: 163802658
Test: TH
Change-Id: I5aa030dfaa59a21511a7112ff89f8a5d8b8dc735
2020-08-12 16:27:08 +00:00
Greg Kaiser
8763fd26fb charger: Avoid a couple string constructions
With a couple recent changes to APIs taking a const std::string&,
instead of a const char *, we switch to directly passing in a
reference to our string.

Test: TreeHugger
Change-Id: Id9f832dd5e3def28cfeaa0d3cda7da323332b16c
2020-08-12 07:03:50 -07:00
Treehugger Robot
546cf270ab Merge "Add failure logs in __ashmem_open_locked()" 2020-08-11 23:04:28 +00:00