Commit graph

42896 commits

Author SHA1 Message Date
Christopher Ferris
9d0ad238ca Fix problem adding too many frames.
When adding a frame with a dex pc, two frames will be added total. However,
if there is only enough room for a single frame, two get added any way.

Only add a single frame in this case, and add a unit test for this case.

Test: Passes unit tests.
Change-Id: If320584b126967a042c623d8fdf3f51dbc1c2251
2018-10-12 16:36:35 -07:00
Evgenii Stepanov
b3bc842750 Merge "Export HWASAN_OPTIONS when SANITIZE_TARGET:=hwaddress" 2018-10-12 21:45:56 +00:00
Suren Baghdasaryan
1f149d8d2a Merge "lmkd: Fix an invalid access to a pointer after it's freed" 2018-10-12 21:22:38 +00:00
Julien Desprez
618f0e11d6 Add adb_integration_test_device to general-tests
Run some more tests for adb.

Test: tradefed.sh run template/local_min --template:map test=atest --include-filter adb_integration_test_device --log-level VERBOSE --log-level-display verbose
Bug: 112104122
Change-Id: I44b5a2aed8d86ab2dca62081d5b3b05f6e01cabd
2018-10-12 13:48:14 -07:00
Treehugger Robot
0730260a6a Merge changes Ib244a98f,Ib173f251
* changes:
  liblp: Don't store BlockDeviceInfo separately in MetadataBuilder.
  liblp: Move backup sectors to the start of the partition.
2018-10-12 20:28:37 +00:00
David Anderson
db29503b4d liblp: Remove last_logical_sector from LpMetadataGeometry.
Now that backup metadata is stored at the start of the super partition,
this field is no longer needed. In actuality, it was not needed even
before then: both it and first_logical_sector exist for convenience,
since they can be re-derived at any time given an LpMetadataGeometry.

Bug: 116802789
Test: liblp_test gtest
      device with dynamic partitions flashes and boots

Change-Id: I259a443097e689a0a9db7f822bbf1a52d40076dc
2018-10-12 13:05:12 -07:00
David Anderson
a520c5e28b liblp: Don't store BlockDeviceInfo separately in MetadataBuilder.
There's no reason to do this, since the fields are already in
LpMetadataGeometry. Removing this also simplifies multiple-block-device
support.

Bug: 116802789
Test: liblp_test gtest
Change-Id: Ib244a98fdd9d36c94a2dffd81bef68a1d5644ab9
2018-10-12 13:05:12 -07:00
David Anderson
06f7a967be liblp: Move backup sectors to the start of the partition.
Previously, metadata backups were stored at the end of the partition to
make them easy to locate. On older devices where the super partition
could span system/vendor partitions, we may want to leave the end of
each partition free to store an AVB footer. To allow this, we now store
geometry and metadata backups near the start of the partition instead.
They are still positioned at a fixed offset.

Bug: 116802789
Test: device boots after flashing new metadata
Change-Id: Ib173f251a4a13e290adcc4ac5cfbeb030eacda30
2018-10-12 13:05:11 -07:00
Treehugger Robot
5c61dbd12c Merge "fs_mgr: overlay drop redundant check" 2018-10-12 19:51:11 +00:00
Christopher Ferris
a2f38f1bde Fix up the definition of Elf::GetInfo.
The function should have returned a bool, so now it does.
Also use a different lighter weight function for validating the elf
in one place that didn't need to keep the max size value.

Test: Unit tests pass.
Change-Id: Ibde674e608091ba04abf22fad2fdc4dbdb2c6e73
2018-10-12 11:29:06 -07:00
Suren Baghdasaryan
0106327486 lmkd: Fix an invalid access to a pointer after it's freed
pid_remove() frees a structure representing registered process and the
pointer can't be used anymore. This change fixes an instance when pointer
was used after it was freed. pid_remove() is moved to the end of the
function and comments are added to prevent similar situation in the future.

Bug: 117625315

Change-Id: I6a922952a31232497b3f9caf87d5a21bd402db94
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-10-12 11:28:33 -07:00
Treehugger Robot
c53a0e9158 Merge "liblp: Add a gtest for sparse image creation." 2018-10-12 15:18:47 +00:00
Minchan Kim
d37dd4a6f0 Merge "export dumpstatez into stable_properties" 2018-10-12 07:23:23 +00:00
Josh Gao
58d5906be3 Merge "Revert "adb: don't close sockets before hitting EOF."" 2018-10-12 06:38:55 +00:00
Josh Gao
faf1328a64 Revert "adb: don't close sockets before hitting EOF."
This reverts commit ffc11d3cf3.

Reason for revert: DeviceIdleFreqCheckTest failing

Bug: http://b/117630047
Change-Id: Ia51a4a30e785bc5b2526695de3f442aac298198f
2018-10-12 05:08:45 +00:00
Treehugger Robot
11cbf7d711 Merge "adb: add reboot-fastboot command" 2018-10-12 03:38:05 +00:00
David Anderson
f89838887f liblp: Add a gtest for sparse image creation.
Note that this moves SparseBuilder into images.h, and splits
ReadLogicalPartitionGeometry into componenet methods for better
testability.

Bug: 116802789
Test: liblp_test gtest
Change-Id: Ib41a46b633c71623c136a10fcc8017e4de20884c
2018-10-11 17:49:50 -07:00
Ryan Prichard
3673f99dd2 Change ZipArchiveHandle from void* to ZipArchive*
A typedef to void* allows an implicit conversion from ZipArchiveHandle*
(or any other pointer type) to ZipArchiveHandle.

See I95d79809b6e118fb3c39c7b98b8055c8e324db1a in platform/bionic.

Bug: none
Test: m checkbuild
Change-Id: I3dd426cb64c46ef81e1dd81b4a2e4f40ac2701df
2018-10-11 14:18:08 -07:00
Mark Salyzyn
21afa1693f fs_mgr: overlay drop redundant check
fs_mgr_update_verity_state() provides the needed result, we do not
need to check verity state manually.

Caveat:

The open-coded verity check is not 100% redundant, as it ensures
that if /vendor is not mounted, where the device mount table resides
to aid in a correct enumeration of all verity-enabled mount points,
that /system is not accidentally overlay mounted on a verity checked
volume.  This is a unlikely corner condition.  A fix for this
condition in the future is to instead migrate this redundant
checking into fs_mgr_update_verity_state() since system is
considered ever present and can be blindly performed without the
required /system or / mount point entries in fstab.  Note that
the overlay logic is #ifdef'd out on user builds, so it is not
really a security or reliability issue on a release build.

Test: manual
Bug: 109821005
Change-Id: Ib4a7f9438b2a3cb008e263605a7a7647737c40f2
2018-10-11 13:45:51 -07:00
Tom Cherry
4c67290da6 Merge "init: add [[nodiscard]] to Result" 2018-10-11 20:34:04 +00:00
Mark Salyzyn
d8e94bd3f2 adb: add reboot-fastboot command
Alias reboot-fastboot to reboot fastboot

Test: manual
Bug: 117604012
Change-Id: I5f7842e420fbc0b1d9ae8e1231887fb8644b29e9
2018-10-11 13:21:16 -07:00
Tom Cherry
d987264625 init: add [[nodiscard]] to Result
It's better to either check these results or explicitly ignore them.
Only a few callers weren't already doing this, so it's relatively
trivial to enforce.

Test: build
Change-Id: I44cdc342e46128f66cac914aaa0b9b4559cacd8c
2018-10-11 10:39:33 -07:00
Pirama Arumuga Nainar
a2ccce870c Merge changes from topic "windows-libcxx"
* changes:
  Do not enable -Wold-style-cast for Windows
  Add sys/types.h in utf8.h
  Adapt to switch to libc++ for Windows
2018-10-11 17:00:53 +00:00
Treehugger Robot
8ef3fe14bb Merge "fs_mgr: deprecate check for ro.build.system_root_image" 2018-10-11 14:56:49 +00:00
Minchan Kim
b7f6c5a1cd export dumpstatez into stable_properties
Vendor might want to pause/resume some operations while a bugreport is captured
so that we need to export dumpstatez into stable_properties.h for vendor to get
property event when dumpstatez launch.

Test: confirmed manually with "adb bugreport"
Bug: 117536084
Change-Id: Ib743c5e59ca20cc44470110c814d85e4cbb90c0c
Signed-off-by: Minchan Kim <minchan@google.com>
2018-10-11 18:02:58 +09:00
Idries Hamadi
86554e949b Merge "Reverted aapt dependency to be a dependency on libandroidfw" 2018-10-11 06:15:04 +00:00
Treehugger Robot
3f50316ea1 Merge "Suppress implicit-fallthrough warning." 2018-10-11 01:01:13 +00:00
Rajeev Kumar
d936e628a3 Merge "Read memory stats from /proc/pid/stat file." 2018-10-10 23:24:05 +00:00
Rajeev Kumar
4dbc24d393 Read memory stats from /proc/pid/stat file.
(cherry pick from commit 0301683e49)
Bug: 117333340
Test: Manual testing using alloc-stress tool
Merged-In: Ie555933aafa6a6b7aa1dbf5518ebe804376e0afd
Change-Id: Ie555933aafa6a6b7aa1dbf5518ebe804376e0afd
2018-10-10 22:23:25 +00:00
Treehugger Robot
a605668edd Merge "Do not calculate CRC for sparse images during fastboot flash" 2018-10-10 22:22:30 +00:00
Treehugger Robot
cd72cbb5d8 Merge "set_active command should update current slot information." 2018-10-10 22:13:15 +00:00
Mark Salyzyn
d556c41a48 fs_mgr: deprecate check for ro.build.system_root_image
If there is a "/" in the fstab, can only be there on system as root.

This drops the troubling and annoying log message:

    [libfs_mgr]Could not find verity device for mount point: /: No such device or address

Test: manual
Bug: 109821005
Change-Id: I6bbfc0af63e1526e52a1c6365241dbc1d5ee7c6a
2018-10-10 14:42:29 -07:00
Chih-Hung Hsieh
e6e2b3cda4 Suppress implicit-fallthrough warning.
Bug: 112564944
Test: make checkbuild
Change-Id: I2bcfd08ec62f6d5953a9e25dbeaa42ffefda6d1c
2018-10-10 14:39:02 -07:00
Treehugger Robot
ce2a8e5b9e Merge changes I5e3f6677,I94665a41
* changes:
  fs_mgr: overlayfs create scratch using a Dynamic Logical Partition
  fs_mgr.h cleanup
2018-10-10 21:12:34 +00:00
Hridya Valsaraju
aec0de5d96 Do not calculate CRC for sparse images during fastboot flash
Bug: 78793464
Test: fastboot flashall

Sparse images with CRC are not supported by the Android build
system and hence the calculated CRC is unused.

Change-Id: Ia48b2f7e29f2adea26d185c5a8f2337c4cbe6dcb
2018-10-10 13:18:35 -07:00
Mark Salyzyn
69ebd440fe fs_mgr: overlayfs create scratch using a Dynamic Logical Partition
The default is a valid /mnt/scratch/overlay/ or /cache/overlay/
directory, with .../<mount_point>/upper and .../<mount_point>/work,
associated with each system partition <mount_point>.  Add support
for Dynamically Resized Partitions to create /mnt/scratch.

Test: manual
Bug: 109821005
Change-Id: I5e3f66778ea9e937c839e25541fedb6fbf34ab50
2018-10-10 12:26:51 -07:00
Mark Salyzyn
b5ca72811c fs_mgr.h cleanup
Drop struct from specifications, fix style.

Test: compile
Change-Id: I94665a41d514501d2f4cd6888361316e08813431
2018-10-10 12:26:49 -07:00
Hridya Valsaraju
20bdf899b2 set_active command should update current slot information.
Boot control HAL implementations will return the current boot
slot as the active slot. If a set_active command is issued on another
slot, it should be considered as the new active slot and subsequent
flashes should flash the same.

Test: fastboot set_active "b", fastboot getvar current-slot
Bug: 78793464
Change-Id: Ida3817670de8e74a7d7ae2a905e7ac1756c6bdf1
2018-10-10 12:25:11 -07:00
Josh Gao
2185d8ceef Merge "adb: don't close sockets before hitting EOF." 2018-10-10 18:13:01 +00:00
Treehugger Robot
042f2da1f3 Merge "fs_mgr: overlayfs deal with verity detection issues" 2018-10-10 16:51:57 +00:00
Mark Salyzyn
54e47908c3 fs_mgr: overlayfs deal with verity detection issues
Stop checking verity on each entry in the fstab, collect the verity
list whole and use in the loop.  Open code verity detection for
"system" for cases where device table is incompletely specified, does
not specify a "/" or a "/system" entry.

Test: manual, /system on system-as-root overlays correctly.
Bug: 109821005
Change-Id: I7bc5fbef6577bb0823cb5deb26c370219e4e597b
2018-10-10 07:26:50 -07:00
Christopher Ferris
8ddded2f96 Merge "Fix handling of globals for new linker." 2018-10-10 01:25:31 +00:00
Treehugger Robot
a1bb191541 Merge "Handle retry count correctly" 2018-10-10 00:44:49 +00:00
Treehugger Robot
9810709d91 Merge "Check validity of partition for getvar:partition-type" 2018-10-09 23:21:54 +00:00
Evgenii Stepanov
30917f77ba Export HWASAN_OPTIONS when SANITIZE_TARGET:=hwaddress
Bug: 112438058
Test: adb shell env | grep HWASAN_OPTIONS
Change-Id: I6ea4ef03269a7413b97cc62ea5b76597137bd980
2018-10-09 15:33:59 -07:00
Treehugger Robot
b2263b4a07 Merge "Return partition size in hex format." 2018-10-09 21:38:48 +00:00
Treehugger Robot
ed6f596de2 Merge "init: increase thermal shutdown timeout to 3s" 2018-10-09 21:18:22 +00:00
Hridya Valsaraju
4165e00d67 Check validity of partition for getvar:partition-type
Test: fastboot getvar partition-type:product_services_a
Bug: 79480454

Change-Id: I4020b0c94daf8fb86c29104aecc1eb8f44f89999
2018-10-09 13:32:04 -07:00
Treehugger Robot
e2015afd78 Merge "fs_mgr: fix incorrect parameter type" 2018-10-09 19:58:08 +00:00
Wei Wang
b5de088262 init: increase thermal shutdown timeout to 3s
1) increase thermal shutdown timeout to 3s for process to save work
2) respect property "ro.build.shutdown_timeout" in thermal shutdown if
   it is set less than default time - "3s"

Bug: 112432890
Test: Build
Change-Id: Idc2b24dd44c1fab8f9b047fd2468de2ee45ff783
2018-10-09 12:53:30 -07:00