Commit Graph

62755 Commits

Author SHA1 Message Date
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 a258293a97 libsnapshot: Off-line tool for converting OTA payloads to COWs.
The A/B version of this tool takes in a payload.bin file (from an OTA
package), and converts it into COWs in the new format. It uses the
CowWriter API to do this. This tool can be used to precisely see the
size of a COW relative to an OTA. Since there is one COW per partition,
it also takes an output folder:

    make_cow_from_ab_ota payload.bin ./ota-cows/

If the payload is incremental, a source target-files package is needed.
It must be the exact package used to build the OTA, otherwise, the
conversion is likely to fail. Example:

    make_cow_from_ab_ota -source_tf target-files-XYZ.zip \
                         payload.bin ./ota-cows/

Bug: 162274240
Test: manual tests
Change-Id: I22c86546f4166ee9df99165399646b7daa3519d5
2020-08-19 13:58:09 -07: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
Martijn Coenen 4da604ba4e Allow shell to write to /sdcard/Android/data and /sdcard/Android/obb.
On devices without sdcardfs, these are only writable by the owning UID,
and/or the ext_data_rw/ext_obb_rw groups respectively.

Bug: 161134565
Bug: 162810387
Test: try to write to /sdcard/Android/data/ from shell uid
Change-Id: Idb4e07f967c8e888d95afa6c4a71595e0910ba0e
2020-08-19 09:04:52 +02: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
Tamas Zsoldos f30a46f100 libunwindstack: don't save pseudoregisters while evaluating Dwarf
Currently, while evaluating a Dwarf section, even pseudoregisters are
saved in regs_info. Since pseudoregisters are stored separately from
ordinary registers, trying to read them the usual way will result in
an out-of-bounds read. There's no memory corruption as regs_info is
big enough to store all existing pseudoregisters.

With this patch, pseudoregisters are simply not saved in regs_info.

Added new unit tests to cover the pseudo register cases.

Test: libunwindstack_test

Change-Id: If21b2a79f2fcca85644eec430f3d22e354b001ec
2020-08-18 18:08:28 -07:00
Treehugger Robot cb54d93584 Merge "Revert "Fix non-existent module error"" am: d7cb6e1fd0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1398410

Change-Id: I4903d5491e8e1106d486b0fdcc561f669dfe76e6
2020-08-18 08:02:29 +00:00
Treehugger Robot d7cb6e1fd0 Merge "Revert "Fix non-existent module error"" 2020-08-18 07:41:01 +00:00
Elliott Hughes f2587f3698 Merge "Deprecate <utils/Debug.h>." am: 5d0eb66590
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1402847

Change-Id: I38d2a1f664c6ef126a83b273d4d044a9664a3ea8
2020-08-17 20:48:09 +00:00
Elliott Hughes 80a8682fff Merge "Don't #include <utils/Debug.h> from <utils/Flattenable.h>." am: af99e1e88a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1402848

Change-Id: I5d76e2a875d9f638b7413466d13eb92eea511925
2020-08-17 20:48:00 +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 4fd4d4b948 Merge "Set ro.crypto.type even on failure" am: 5350746a2b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1400948

Change-Id: If30c80f97fbbaf1ba532d45c60d68322acb1fe33
2020-08-17 20:17:21 +00:00
Paul Crowley 5350746a2b Merge "Set ro.crypto.type even on failure" 2020-08-17 20:14:25 +00:00
Tom Cherry f5ce644a79 Merge "Remove android_lookupEventTagNum() and related code" am: 5b02193f5c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1400707

Change-Id: Ifb36e8979f5489fba1fd36e38e5278c7fe105c91
2020-08-17 20:11:52 +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 ce5e603936 Merge "Revert "[adb] fix signature check"" am: 920393ddb7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1401071

Change-Id: I86fd80046d0099eb462d83595f5e5be8b3c39bfa
2020-08-15 11:09:30 +00:00
Treehugger Robot 920393ddb7 Merge "Revert "[adb] fix signature check"" 2020-08-15 10:59:15 +00:00
Jaegeuk Kim 4929adbd70 Merge "fs_mgr: try tune2fs for casefolding on /data only" am: 8a6e8be2b8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1401147

Change-Id: I612ffacba843388e27e8145eaf7b98f43c8b8a16
2020-08-15 03:56:02 +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 7d1c5b5e1d Merge "[adb] fix signature check" am: d500072443
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1400967

Change-Id: I44225ec7aa22bad5f23a6bc92c68c9626311a32d
2020-08-14 21:56:18 +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 5db8da5eaf Merge "libcutils: use 0 for netlink socket port id" am: e473c89c52
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1400307

Change-Id: I3a61ad53abad599ff7567d4373973be86f550efa
2020-08-14 18:12:26 +00: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 e694f34b3c Merge "Set warning for dex pc not in map." am: 278f11b574
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1396068

Change-Id: I6fa6270c8cafce8b8e03e1b8f8de6e9e61999bca
2020-08-13 23:45:38 +00:00
Christopher Ferris 278f11b574 Merge "Set warning for dex pc not in map." 2020-08-13 23:25:26 +00:00
Stephane Lee bab6877710 Assume UNSUPPORTED if the battery capacity level sysfs node does
not exist.

Bug: 163382088
Test: Ensure that, if the ./capacity_level does not exist,
  that the device will shut down at 0 % SOC in an Health 2.1
  implementation
Change-Id: I00822b4bfba5d823c1a30163ea6824e59d3aae32
2020-08-13 14:31:02 -07: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 a45c7e8a3d Merge "Reland: "liblog: use a blocking socket for sending messages to logd""" am: 0398117a9a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1397710

Change-Id: I949aa35c504bc91e51c5393b4c65d70fd6e5ad23
2020-08-13 15:27:39 +00: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 5dfb05fd3d Merge changes I40fe9b79,I4b6f8331 am: 7ef8bca1f9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1397551

Change-Id: Ic532b745de48852259aa8dda4ee0829bd1c2ecbf
2020-08-12 23:03:05 +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
Treehugger Robot 47d5a1f03f Merge "Fix non-existent module error" am: 1173476551
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1398408

Change-Id: I5f7e98723834ca9c2bdb4175d894a4a6a8177c5b
2020-08-12 19:58:10 +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 d4c3f86952 Merge "charger: Avoid a couple string constructions" am: b9edfee8a2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1397708

Change-Id: I3c510bcf3da0d196aede80c5a16865fed39c0d85
2020-08-12 19:48:17 +00:00
Treehugger Robot b9edfee8a2 Merge "charger: Avoid a couple string constructions" 2020-08-12 19:29:49 +00:00