Commit graph

62841 commits

Author SHA1 Message Date
Treehugger Robot
fbb0314c33 Merge "Turn off -Wnon-virtual-dtor explicitly" 2020-09-25 03:53:02 +00:00
Jiyong Park
ee989fcb4d Turn off -Wnon-virtual-dtor explicitly
adb has been built without -Wnon-virtual-dtor because Soong doesn't turn
the flag for the host targets, and the flag can't coexist with
-Wexit-time-destructors.

However, the new host target linux_bionic_arm64 turns the flag on,
because it inherits most of the cflags from the device config.
That is forcing us to implement the virtual destructor, which isn't
possible due to -Wexit-time-destructors.

Solving the issue by explicitly turning -Wnon-virtual-dtor off so that
it is disabled also for the linux_bionic_arm64 target.

Bug: 159685774
Test: HOST_CROSS_OS=linux_bionic HOST_CROSS_ARCH=arm64 m \
out/soong/host/linux_bionic-arm64/bin/adb
Test: run the adb on an ARM emulator

Change-Id: I655b340e4f199a3a75b7df7cc3fe18832e26a7ae
2020-09-25 11:56:04 +09:00
Christopher Ferris
b05c472421 Add arch member into Unwinder object.
This simplifies some of the logic and removes the need to pass an
Arch value to functions that should already know about the arch
it is operating on.

Includes fixes for debuggerd/libbacktrace.

Added new unit tests to cover new cases.

Test: All unit tests pass.
Test: Faked unwinder failing to verify debuggerd error messages display
Test: properly in backtrace and tombstone.
Change-Id: I439fcae0695befcfb1cb4c0a786cc74949d33425
2020-09-24 18:46:23 -07:00
Mohammad Samiul Islam
0098201dc3 Activate encryption for /data/app-staging folder
Without enabling the encryption on this folder, we will not be able to
rename files from this folder to /data/app folder, since /data/app
folder is encrypted. Trying to rename files between unencrypted folder
to encrypted folder throws EXDEV error.

Turning on encryption for /data/app-staging has the following concerns:

1. Turning on the encryption will erase all of its content. But this is fine
since during OTA we fail all staged sessions anyway.
2. We need to create hardlinks from /data/app-staging to
/data/apex/active. This is also fine since we will be creating link from
encrypted folder (/data/app-staging) to non-encrypted folder and this
does not throw EXDEV error.

Bug: 163037460
Test: atest StagedInstallTest
Change-Id: Ie78f6df0c0e08de54a39c5e406957ad0a56b7727
2020-09-24 19:37:21 +01:00
Treehugger Robot
978faa37ba Merge "Chanage uid to userId where it denotes an Android user id." 2020-09-24 17:57:49 +00:00
Janis Danisevskis
0a738d9504 Chanage uid to userId where it denotes an Android user id.
This patch changes the variable name `uid` to `userId` where it
denotes an Android user id. This makes it harder to mistake the user id
for an actual UID.

Test: Trivial refactoring no logical changes.
Bug: 163636858
Change-Id: I9e240367bcd30bbfa1816014a7f44bbcb58ede4b
2020-09-23 18:01:37 -07:00
Tom Cherry
de540ad2f1 Merge "logd: enable CFI" 2020-09-23 18:44:02 +00:00
Tom Cherry
d96139f14c logd: enable CFI
Test: logd runs normally
Change-Id: Ic3e117bd445ae339fed7846e3eaa14478580f091
2020-09-23 09:34:15 -07:00
Treehugger Robot
928910999f Merge "Removed RWLock fuzzer" 2020-09-22 18:40:23 +00:00
David Anderson
9ec8c31afb Merge "libsnapshot: Make the new Open calls look more like MapUpdateSnapshot." 2020-09-22 17:47:06 +00:00
Jooyung Han
fb2dafa538 Merge "ueventd: change firmware location in apexes" 2020-09-22 01:36:35 +00:00
Treehugger Robot
55d3e1f9b9 Merge "logd: additional logging if read_offset > buffer_it->write_offset()" 2020-09-22 01:14:15 +00:00
Tom Cherry
5d1fbece58 logd: additional logging if read_offset > buffer_it->write_offset()
I didn't expect this to ever be hit, but apparently it is, so add
additional logging to track it down.

Bug: 168870781
Test: build
Change-Id: Ia472bc7458a3727e4d407365672f7394426ae515
2020-09-21 15:10:20 -07:00
David Anderson
f53794d1af libsnapshot: Make the new Open calls look more like MapUpdateSnapshot.
To make the transition to these new calls easier, give them a very
similar signature to MapUpdateSnapshot. Also, allow them to work in
non-compression mode.

Bug: 168554689
Test: builds
Change-Id: I2eb6b41ba8a294dbde1763aabd7701a80c0789f3
2020-09-21 12:06:49 -07:00
Tom Cherry
b92ac53aeb Merge "logd: remove min heap in SerializedFlushToState" 2020-09-21 18:10:43 +00:00
David Anderson
32771b2aa3 Merge "libsnapshot: Prototype the new API for mapping writable snapshots." 2020-09-21 17:56:08 +00:00
Jooyung Han
529ace17b6 Merge "fs_config: add bin paths of flattened apexes" 2020-09-21 15:47:59 +00:00
Tom Cherry
67e08784ed Merge "Use libcutils_headers for android_filesystem_config.h" 2020-09-21 15:29:41 +00:00
Jooyung Han
a70cea57a9 fs_config: add bin paths of flattened apexes
Added missing partitions (/product and /vendor).

APEXes can be put in /system, /system_ext, /product, and /vendor.
Binaries within "flattened" apexes should be marked as executable.

Bug: 167383491
Bug: 169025459
Test: OVERRIDE_TARGET_FLATTEN_APEX=true m vendorimage with a vendor apex
      simg2img $OUT/vendor.img vendor.img
      debugfs -R 'ls -l /vendor/apex/com.android.foo/bin' vendor.img
      => check if binaries are executable
Change-Id: I67284166d70c98a2a184b47e7052ade8b9039df9
2020-09-21 19:50:43 +09:00
Jooyung Han
2833e5d37d ueventd: change firmware location in apexes
To be consistent with other prebuilt modules within APEXes, the location
for firmware files is switched from /apex/*/firmware to
/apex/*/etc/firmware.

Bug: 167942098
Test: loading vibrator firmware from vibrator apex(sunfish)
Change-Id: Ia05735bf5a54482fded26525fa4a8f795dcfc029
2020-09-21 10:56:10 +09:00
Jooyung Han
62ccfa0c61 Merge "ueventd: scans /apex/*/firmware for firmwares" 2020-09-19 22:47:26 +00:00
Jooyung Han
21cad321db ueventd: scans /apex/*/firmware for firmwares
In addition to "firmware_directories", ueventd scans /apex/*/firmware/
directory as well to find firmware files.

Bug: 167942098
Test: loading firmware from vibrator apex successfully.
      (sunfish)
Change-Id: I90fc8f9ad843a08b1ca98a2be1b5d22c0c5954a3
2020-09-19 08:07:35 +09:00
Josh Gao
596f3b5384 Merge "adbd: Fix check against valid payload size" 2020-09-18 23:01:18 +00:00
Tom Cherry
a5edc0fbbc Use libcutils_headers for android_filesystem_config.h
android_filesystem_config.h is found since system/core/include is on
the include path for all projects and contains a symlink to the real
android_filesystem_config.h.  This is fragile and the below bug seeks
to remove this symlink and have users correctly depend on
libcutils_headers.

Bug: 165825252
Test: build
Change-Id: I1aad6a2e8fbe87635e97b0ac1be3414403353382
2020-09-18 22:48:42 +00:00
Tom Cherry
6533fff0e0 logd: remove min heap in SerializedFlushToState
There was a bug in SerializedFlushToState::Prune() caused by an access
to a SerializedLogEntry raw pointer as a member of a MinHeapElement,
which was deleted earlier in the function.

Instead of just fixing the order of the access and the deletion, I
sought out to remove the raw pointer entirely.  In doing so, I noticed
that the min heap doesn't provide significant benefit, since we'll
only ever have 8 log buffers so scalability is not an issue.

Therefore this change removes the min heap entirely and uses the
existing log_position_ and logs_needed_from_next_position_ members to
keep track of which are the next unread logs.

It also adds a smoke test for SerializedFlushToState::Prune() and
additional CHECK() statements to help prevent future errors.

Bug: 168869299
Test: unit tests
Change-Id: Id4d5fdbaff2fe6dc49c38f01e73f900f84d3696b
2020-09-18 15:32:32 -07:00
Peter Collingbourne
43ebae3e5d Merge "Dump the per-thread TAGGED_ADDR_CTRL value if available." 2020-09-18 22:00:53 +00:00
David Anderson
2f11ec6a13 libsnapshot: Prototype the new API for mapping writable snapshots.
Since we can't provide a single device or fd anymore, we need to expose
a CowWriter directly. Additionally, we expose an API for reading
snapshots through the FileDescriptor abstraction.

Bug: 168554689
Test: builds
Change-Id: If7e8adbfe69c2a84d34c63d4b0adff2b3365fd82
2020-09-18 14:24:40 -07:00
Mayank Rana
71a33cfa67 adbd: Fix check against valid payload size
block->payload and its size are not valid when it is used to check
against bytes_left due to std::move() performed on its just prior
to the check. Hence check will always fail to detect the case where
received data is more than expected. To detect this condition and
allow error handling with std::move(), remove extra payload variable
and directly use block->payload.

Bug: http://b/168917244
Change-Id: I992bbba9d9a9861a195834f69d62e69b90658210
2020-09-18 19:26:45 +00:00
Bill Yi
691a80ca09 Merge "Merge mainline-release 6664920 to master - DO NOT MERGE" 2020-09-18 18:47:48 +00:00
Christopher Ferris
36991d8e26 Merge "Fix x86_64 check for signal handler." 2020-09-18 18:02:36 +00:00
Tom Cherry
54ac487031 Merge "Add sdk_version: "minimum" to liblog_headers" 2020-09-18 15:28:25 +00:00
Bill Yi
34ecedbcc8 Merge mainline-release 6664920 to master - DO NOT MERGE
Merged-In: Ib2a6c8b5cc127d4aab61a454f47f3cce410d674e
Change-Id: Ief5996d70b59986c15a1b8056c678a6ef35a72d3
2020-09-17 21:57:28 -07:00
Tom Cherry
93ad204395 Remove logging symlinks from system/core/include
Soong will instead directly include those paths.

Test: treehugger
Change-Id: Ic189e0f597f69ab36b25a94dcde81165da3e53db
2020-09-17 14:32:48 -07:00
Tom Cherry
b80d98dcf7 Add sdk_version: "minimum" to liblog_headers
There are libraries built with the NDK but bundled with the platform
that were otherwise directly including the header path.  It's better
for them to include liblog_headers instead.

Test: build
Change-Id: Icca3684ba5b2539789d30de9df840da4ade0dc67
2020-09-17 14:32:48 -07:00
Christopher Ferris
a293170a2c Fix x86_64 check for signal handler.
The check for a signal handler was checking for the instruction after
the syscall. On cuttlefish 64 bit, the instruction was not a nop, so
the check failed, and the signal handler was not working. Only check
the instructions up to the syscall instead.

Bug: 168806886

Test: Ran on x86_64.
Change-Id: I605ed22248748f525939e55d734caa5b08c80bb2
2020-09-17 14:19:54 -07:00
Treehugger Robot
0407302aa8 Merge "Remove sysutils symlink from system/core/include." 2020-09-17 19:49:01 +00:00
David Anderson
975ea3217e Merge changes from topic "vab-brotli"
* changes:
  libsnapshot: Add an append mode to CowWriter.
  libsnapshot: Add support for brotli compression.
2020-09-17 19:32:23 +00:00
Yifan Hong
4fd78ec4b3 Merge changes from topic "revert-1413808-modules_partition-UXSIXCGPHZ"
* changes:
  Revert "rootdir: Add modules directory"
  Revert "fastboot: add modules partition"
2020-09-16 22:45:54 +00:00
Tom Cherry
73b1ac878b Merge "Remove include/private/android_logger.h" 2020-09-16 22:07:02 +00:00
Tom Cherry
46ec1a561d Merge changes I150dc5fe,I72d327c2,I6c5a97dc
* changes:
  Remove include/private/android_filesystem_capability.h
  Remove include/private/canned_fs_config.h
  Remove include/private/fs_config.h
2020-09-16 20:38:33 +00:00
Tom Cherry
3d8b739f94 Remove include/private/android_logger.h
Users should depend on liblog or liblog_headers for this include.

Test: treehugger
Change-Id: I10dca8638082b2231e2c0713644f103c4c7e9b3f
2020-09-16 11:32:47 -07:00
Akilesh Kailash
840d7b2aa8 Merge "Support of multiple device partitions by dm-user driver" 2020-09-16 18:02:56 +00:00
Tom Cherry
7eb9580a29 Remove include/private/android_filesystem_capability.h
android_filesystem_capability.h should be included as part of
libcutils, not as a global include.  It looks like the few users of
this file already do this correctly, so it's time to remove the
symlink.

Test: treehugger
Change-Id: I150dc5fee24bef3518b1f26728ef2bec669ee63a
2020-09-16 10:43:03 -07:00
Tom Cherry
61ebd66137 Remove include/private/canned_fs_config.h
canned_fs_config.h should be included as part of libcutils, not as a
global include.  It looks like the few users of this file already do
this correctly, so it's time to remove the symlink.

Test: treehugger
Change-Id: I72d327c2f1f374a1fa9e22b5ee1cceb0311a6818
2020-09-16 10:23:43 -07:00
Tom Cherry
9c2005fc27 Remove include/private/fs_config.h
This file is empty and should have no users including it.

Test: treehugger
Change-Id: I6c5a97dc42456d51c89762c93c6a744a69780843
2020-09-16 10:20:46 -07:00
Elliott Hughes
ed14908226 Merge "fastboot: switch to ZipEntry64." 2020-09-16 16:41:53 +00:00
Josh Gao
190921ed5c Merge "ADB internals documentation" 2020-09-16 05:54:40 +00:00
Fabien Sanglard
59c0640fb0 ADB internals documentation
Document the internals of adb pipeline. In particular the fdevent,
smart socket, and transport flow.

Bug: NA
Test: NA
Change-Id: Ia8fd8a6da843b8e91ca3005545f33bd0a82cc0c3
2020-09-15 22:50:59 -07:00
Peter Collingbourne
864f15dd6d Dump the per-thread TAGGED_ADDR_CTRL value if available.
This value indicates whether memory tagging is enabled on a thread,
the mode (sync or async) and the set of excluded tags. This information
can sometimes be important for understanding an MTE related crash,
so include it in the per-thread tombstone output.

Bug: 135772972
Change-Id: I25a16e10ac7fbb2b1ab2a961a5279f787039000b
2020-09-15 21:32:36 -07:00
Akilesh Kailash
516ded7320 Support of multiple device partitions by dm-user driver
Add basic support for daemon creation and handle signals

Test: Add test case to test system and product COW partitions
Bug: 162790322

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Icf8dbe49d2237cec6f7dbcdd84256eb6c5afa1cd
2020-09-16 00:35:42 +00:00