Commit Graph

42232 Commits

Author SHA1 Message Date
Julien Desprez 75fea7ec3b Add adb integration test to general-tests
In order to run them continuously, add them to general-test
zip.

Test: make general-tests
Bug: 112104122
Change-Id: I7a1143ac638626069ed78ddd450063e9489e22e8
2018-08-08 12:08:50 -07:00
Treehugger Robot 1e0e1b44bd Merge "lmkd: Skip memory.stat usage when per-app memcgs are not used" 2018-08-08 16:44:22 +00:00
Suren Baghdasaryan 1d1c002c3d lmkd: Skip memory.stat usage when per-app memcgs are not used
Initial change to remove memory.stat usage when per-application memcgs
are disabled was partially merged into AOSP under the following id:
Ib6dd7586d3ef1c64cb04d16e2d2b21fa9c8e6a3a
This change adds the missing parts.

Bug: 110384555
Change-Id: I1265021b1ede0e68efbf80d6430a959eaf46a69a
Merged-In: Ib6dd7586d3ef1c64cb04d16e2d2b21fa9c8e6a3a
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-08-08 01:18:38 +00:00
Suren Baghdasaryan 41950dd414 Merge "lmkd: Protect against buffer overflow" 2018-08-08 00:52:18 +00:00
Tao Bao 8fa3adb8a9 Merge "Merge libsync_recovery rules into libsync." 2018-08-08 00:26:38 +00:00
Greg Kaiser f0da9b0cc2 lmkd: Protect against buffer overflow
We're passing a 'line' whose backing buffer is PAGE_MAX in size
into memory_stat_parse_line().  We protect overflowing the smaller
LINE_MAX 'key' buffer via some C preprocessing macros to assure
we limit the size.

Test: Local build with LMKD_LOG_STATS set for this file.
Bug: 76220622
Change-Id: I9e50d4270f7099e37a9bfc7fb9b9b95cc7adb086
2018-08-07 15:42:19 -07:00
Treehugger Robot 7d4e7d3156 Merge "Revert "Support Speck encryption."" 2018-08-07 21:11:51 +00:00
Treehugger Robot 6b0ecdab15 Merge "fastboot: Fix product-services typo" 2018-08-07 18:24:10 +00:00
Tao Bao ba22102ce3 Merge "Make libadf, libsync_recovery recovery_available." 2018-08-07 18:05:45 +00:00
Tao Bao f32d3df46f Merge libsync_recovery rules into libsync.
Statically linking against libsync is no longer a concern, since libsync
has supported the modern sync ABI (which is frozen upstream) after the
recent cleanup works.

Test: `m dist` with aosp_taimen-userdebug
Change-Id: Ic162bc7ff7c9dd306658d11d4b71e2d18730a2ee
2018-08-07 11:00:50 -07:00
Jerry Zhang 9b66330375 Make libadf, libsync_recovery recovery_available.
Bug: 110380063
Test: `m dist` with aosp_taimen-userdebug
Change-Id: Ie3543ff89b6b4f0de04eff0f85f8001f4b27d86a
2018-08-07 10:53:07 -07:00
Mark Salyzyn f3c332725b Merge "bootstat: duplicate boot reason entries" 2018-08-07 17:38:50 +00:00
Greg Kaiser 954c141c48 Revert "Support Speck encryption."
This reverts commit 49c27c5cb2.

Remove the Speck encryption support. It was eventually
decided not to allow Speck in Android P, so this code
is no longer needed and wasn't used outside of testing.

Bug: 112009351
Test: Confirmed AES continues to work with FBE.
Change-Id: Ia5458143be5687fff8d541d8fa2c8ee24a369da4
2018-08-07 10:10:31 -07:00
Mark Salyzyn 274b5447fa bootstat: duplicate boot reason entries
Selected visually obvious non-compliant boot reasons to allow
for future re-use of a later formerly duplicated entry.

Test: compile
Bug: 112157996
Change-Id: I3c6b449d36f9e4b745214dd7840b1dc1258bf483
2018-08-07 09:57:32 -07:00
Xin Li 5d707816ac Merge "Merge Android Pie into master" 2018-08-07 16:51:24 +00:00
David Anderson 8cdea7ff0c fastboot: Fix product-services typo
The build system generates a partition name of "product_services" for
the product-services partition, so fastboot's image list must reflect
this.

Bug: 78793464
Test: fastboot flash product_services works with fastbootd
Change-Id: I348f970c9584fd3dd4369e8cded66b6e39eee2b2
2018-08-07 09:29:11 -07:00
Tom Cherry 574533a657 Merge "split first stage init into a separate executable" 2018-08-07 16:08:55 +00:00
Josh Gao 50973d1865 Merge changes from topic "fdsan_debuggerd"
* changes:
  adb: actually enable fdsan.
  adb: move AdbCloser to its rightful place.
  libdebuggerd: extract and print the fdsan table.
  crash_dump: pass the address of the fdsan table.
2018-08-07 10:02:16 +00:00
Orion Hodson 919ee8ab1c Merge "Revert "Prepare to fail in RefBase destructor if count is untouched"" 2018-08-07 08:27:29 +00:00
Hans Boehm b9d0753d2b Revert "Prepare to fail in RefBase destructor if count is untouched"
This reverts commit 9d3146af22.

Reason for revert: It appears that weak symbols don't work as expected on MacOS, breaking the MacOS aapt build.

Change-Id: Ica0955106485a7bf2e2c3f09ff7910e230eb4139
2018-08-07 05:35:12 +00:00
Josh Gao 297d9bf8ea adb: actually enable fdsan.
adb was using a custom unique_fd closer that didn't have an
implementation for fdsan, which meant that none of our FDs were
actually tracked. Guard this behind ifdefs so that we only use this
on Windows, and delete our implementation of Pipe in favor of the one
in libbase while we're at it. libbase's implementation always sets
O_CLOEXEC, so fix up the instance of Pipe that doesn't expect that.

Test: mma
Test: adb start-server
Test: debuggerd `pidof adbd`
Change-Id: Ic29d641a2f93fb42384b00c51775048c8bcbe152
2018-08-06 18:50:10 -07:00
Josh Gao 9d100f1043 adb: move AdbCloser to its rightful place.
Test: mma
Change-Id: Ie74c49e8abf72f594a35d04b2b0d99b96f58f8d0
2018-08-06 18:50:10 -07:00
Josh Gao ce841d91fb libdebuggerd: extract and print the fdsan table.
This commit only prints the raw value of the owner tag, pretty-printing
will come in a follow-up commit.

Test: debuggerd `pidof adbd`
Test: static_crasher fdsan_file + manual inspection of tombstone
Change-Id: Idb7375a12e410d5b51e6fcb6885d4beb20bccd0e
2018-08-06 18:50:10 -07:00
Josh Gao 9da1f51c10 crash_dump: pass the address of the fdsan table.
Pass the address of the fdsan table down to crash_dump so that we can
dump the fdsan table along with the open file descriptor list.

Test: debuggerd_test
Test: manually ran an old static_crasher
Change-Id: Icbac5487109f2db1e1061c4d46de11b016b299e3
2018-08-06 18:50:10 -07:00
Treehugger Robot 4f878cf6cb Merge "fs_mgr: Do not mount empty partitions." 2018-08-07 00:52:34 +00:00
Treehugger Robot a70e2b2ed7 Merge "liblp: Allow flashing to readonly logical partitions." 2018-08-07 00:28:48 +00:00
Xin Li fb973d34ac Merge Android Pie into master
Bug: 112104996
Change-Id: Ib0e5b2801a931b469b753806b1fbe2fabb0c1de5
2018-08-06 17:26:31 -07:00
Treehugger Robot c4630ef445 Merge "Allow existance of partition to be checked before flashall or update" 2018-08-07 00:20:46 +00:00
Treehugger Robot c30a75a007 Merge "Add fastbootd." 2018-08-07 00:08:18 +00:00
David Anderson 6868cb9f5e fs_mgr: Do not mount empty partitions.
If a logical partition is resized to 0 bytes, it will have no extents.
This is not allowed by device-mapper, but is useful for effectively
compacting partitions with "fastboot flashall". If all logical
partitions are resized to 0, then resized to their intended size, then
we will allocate extents more efficiently.

However, if a partition is left with a zero size (either intentionally
or not), this should not throw the device into a reboot loop due to
CreateLogicalPartitions failing. Instead we skip partitions with no
extents.

Bug: 78793464
Test: with fastbootd:
        fastboot create-partition example 4096
        fastboot resize-partition example 0
      device reboots successfully

Change-Id: I572efa949176c8c3c493ef00438d8badd4d7cf4f
2018-08-06 15:59:38 -07:00
David Anderson 4d71d85805 liblp: Allow flashing to readonly logical partitions.
By default, logical partitions with the readonly flag are created with a
readonly device. This change allows callers of CreateLogicalPartition
to create writable devices so they can still be flashed.

Bug: 78793464
Test: fastboot flash product_services works with fastbootd
Change-Id: Ia8d2761a3067e3b62815acbf0b6fb7f033072ba2
2018-08-06 15:47:26 -07:00
Tao Bao 19e545c12d Merge "adb: `adbd` uses shared libraries."
am: 0e947189c5

Change-Id: If6dd1b01b0ae7b71c8911045ef0570f0c226e5d9
2018-08-06 15:34:51 -07:00
Tao Bao 0e947189c5 Merge "adb: `adbd` uses shared libraries." 2018-08-06 21:55:28 +00:00
Tao Bao eca59ae895 adb: `adbd` uses shared libraries.
This CL builds the former `libadbd` as a shared library, and moves
`adbd` to using shared libraries.

We can't switch `libadbd` from static to shared library directly, due to
the circular dependency between `libadbd` and `adbd`. In particular,
daemon_service_to_fd() can't be compiled into `libadbd`, as it needs to
be overridden by recovery/minadbd.

This CL creates a static library `libadbd_core` as the common base,
which contains everything from the former `libadbd`. Both of the two
shared library targets `libadbd` and `libadbd_services` depend on
`libadbd_core`.

The `adbd` on device (under both of normal boot and recovery) now
depends on `libadbd.so` and `libadbd_services.so`. recovery/minadbd will
depend on `libadbd.so` and `libminadbd_services.so` in future (after
fully converting recovery to Soong).

Bug: 78793464
Test: `m dist`
Test: Run adbd_test on marlin.
Test: Build and flash marlin on device. Check basic adbd functionalities
      (`adb shell` and `adb sync`) under normal boot and recovery.
Test: `adb sideload` on marlin.
Change-Id: Iacbd4db524ef94abd175cd1d27688f4faf3db024
2018-08-06 11:40:47 -07:00
Hridya Valsaraju f1f0a9c8a5 Allow existance of partition to be checked before flashall or update
Bug: 112108453
Test: fastboot flashall with super.img and product-services.img in $OUT,
fastboot update with super.img and product-services.img in image.zip.

Change-Id: I5718b5e60c546c55af74292895b3f7fe169e4f02
2018-08-06 11:05:37 -07:00
Hans Boehm b708511f78 Merge "Prepare to fail in RefBase destructor if count is untouched"
am: f502182ac6

Change-Id: I91ff7140a9a72c910ef01a2e13f277fa36c82b50
2018-08-06 11:01:28 -07:00
Tom Cherry 31438489c0 split first stage init into a separate executable
In the future, systems with dm-linear will require a ramdisk to set up
the mount for system.  In this world, first stage init will be a part
of this ramdisk and handle setting up dm-linear, mounting the
necessary partitions, then pivoting to the system image, which will
become the root partition.

This also enables previous devices without system-as-root, to be
unified with system-as-root devices for all aspects of boot after the
pivot_root.

Bug: 79758715
Test: boot hikey
Test: boot sailfish, boot sailfish into recovery
Change-Id: Iefa88a3ec5994e7989aa9f26f2de0351ffa5468b
2018-08-06 10:36:43 -07:00
Hans Boehm f502182ac6 Merge "Prepare to fail in RefBase destructor if count is untouched" 2018-08-06 16:53:12 +00:00
Christopher Ferris 5aa46568b3 Merge "Be permissive about badly formed elf files."
am: c7815d675a

Change-Id: Ie62a0bd4f1fb50a2a02a0129a5006485a51ae734
2018-08-04 10:33:46 -07:00
Christopher Ferris c7815d675a Merge "Be permissive about badly formed elf files." 2018-08-04 17:28:35 +00:00
Hans Boehm 9d3146af22 Prepare to fail in RefBase destructor if count is untouched
Move towards crashing if a normally configured RefBase object is
destroyed without ever incrementing the reference count. We've been
threatening to do this for a long time. The previously last known
violation had been fixed.

This also fixes stack trace printing from RefBase, which had previously
been broken, and which we found necessary to track down further
violations of this rule.

Unfortunately, we found several more violations with the aid of
that fix. After existing CLs are submitted, there are
still some failures, but they are no longer numerous. Thus this CL
doesn't actually crash in the event of a violation, but does log a
verbose stack trace if it encounters one.

Bugs have been filed against the remaining known RefBase client offenders.
We plan to enable crashing on usage violations once those are fixed.

The fix for the stack trace printing breakage unfortunately requires
the use of weak symbols in order to avoid a circular build dependency.
We expect to eventually replace this with execinfo.h functionality.

Some random reformatting, driven by consistency with current formatting
requirements.

Add missing include to BacktraceMap.h.

Bug: 79112958
Bug: 30292291
Test: Boot AOSP, Master
Change-Id: I8151c54560c3b6f75ffc4c48229f0388a2066958
2018-08-03 17:56:47 -07:00
Tom Cherry 5744e4d7d2 Merge "Split init's source files init first stage and second stage"
am: e0f6dc46d8

Change-Id: Iec525d3fb0e09550895d67709ed958f8337d9e34
2018-08-03 16:00:05 -07:00
Calin Juravle d856c9c2c5 Merge "Accept DexMetadata files (.dm) for install-multiple"
am: d560f39fd7

Change-Id: Ib41e955f4e9d20b10ddd517507142346b273b683
2018-08-03 15:59:18 -07:00
David Anderson 8660f5a85c Merge "liblp: Try to merge extents during partition resizes."
am: b0c9318493

Change-Id: Ib124843c47f710665e1d9134eae11edb7575863e
2018-08-03 15:58:35 -07:00
Christopher Ferris 497d0dd5e5 Merge "Fix incorrect left shifts."
am: d2b5a53ef8

Change-Id: Ica7dcb8d4606aeeeae71667400ddb833a03cd808
2018-08-03 15:57:57 -07:00
David Anderson 727c80765d Merge "liblp: Add more logging for logical partition operations."
am: 805bc5d757

Change-Id: If08681fc946f0bd21854459c7efd5986e81a7823
2018-08-03 15:57:21 -07:00
Tom Cherry e0f6dc46d8 Merge "Split init's source files init first stage and second stage" 2018-08-03 22:44:31 +00:00
Christopher Ferris 5acf069a7a Be permissive about badly formed elf files.
Here is the allowable issues with an elf file that will not result in an error:
- The program headers/section headers offset points to unreadable memory.
- Allow missing program header and/or section headers.
- Allow a symbol table section header to point to invalid symbol table values.

There is no real reason to require the elf file be perfect. Everything in
the code has sane defaults, so any missing information won't cause any
problems.

This gets rid of the warning that occurs any time an elf is loaded
from memory. In memory elf files never contain all of the section headers,
and do not contain the symbol table data.

Update tests to test these new cases.

Test: Builds and unit tests all pass.
Change-Id: Iaefe2cd6b6c965a01ed425a112d6afae339f3b78
2018-08-03 22:02:05 +00:00
Tom Cherry 44aceed016 Split init's source files init first stage and second stage
This is a baseline for splitting init first and second stage into
their own executables.

Bug: 79758715
Test: sailfish boots
Change-Id: I549ad4502893b3a5e4c2a9886f66850f6d31b619
2018-08-03 13:40:17 -07:00
Treehugger Robot d560f39fd7 Merge "Accept DexMetadata files (.dm) for install-multiple" 2018-08-03 20:14:28 +00:00