Commit Graph

43233 Commits

Author SHA1 Message Date
Mark Salyzyn bb1256a728 llkd: add bit_wait_io to stack monitoring
This will discover if the I/O is starved.

Add the ability to search for " <symbol>.cfi+0x".

Cleaned up README.md to reflect current defaults.

Test: none
Bug: 113648929
Change-Id: I990a54f99de536406fd752a490e60f962380d71a
2018-11-01 08:13:33 -07:00
Treehugger Robot 312339167e Merge "Mount vendor overlay from the system partition" 2018-11-01 04:24:33 +00:00
Treehugger Robot cc684eb085 Merge "libprocinfo: provide MapInfo structure for reading maps." 2018-11-01 02:46:47 +00:00
Treehugger Robot 91c47309a0 Merge "liblog: Fix memory leaks" 2018-11-01 02:11:31 +00:00
Justin Yun 6bab0a9c23 Mount vendor overlay from the system partition
Using overlayfs, the system partition may provide files for older
version of vendor partitions by overlaying on the vendor partition.
Directories in /system/vendor_overlay will be overlaid on the
directories in /vendor to override existing files or provide new
files.

This feature works only if the kernel support overlayfs and has a
patch for override_creds. Otherwise, no-op.

Bug: 114679254
Test: Build and boot: nothing affected without overlayfs, or
                      vendor file is overrided with overlayfs

Change-Id: Iff3a308945299034123ba7bcb40dc787e102730e
2018-11-01 10:26:12 +09:00
Yabin Cui bb3e479268 Merge "libbase: support char parameter in StartsWith/EndsWith." 2018-10-31 18:42:33 +00:00
Treehugger Robot 1206850289 Merge "fs_mgr: overlayfs takes const std::vector<const fstab_rec*>&" 2018-10-31 17:52:18 +00:00
Mark Salyzyn a762e007c5 fs_mgr: overlayfs takes const std::vector<const fstab_rec*>&
fs_mgr_overlayfs_mount_all() and fs_mgr_overlayfs_required_devices()
to also take const std::vector<const fstab_rec*>& argument.

Bug: 117933812
Test: manual adb-remount-test.sh
Change-Id: Ic72fcca1fe32c311ff3f903c7275e6f7dfba46a7
2018-10-31 14:42:44 +00:00
Treehugger Robot e26b8b0181 Merge "debuggerd_fallback: fix fd leak." 2018-10-31 06:05:28 +00:00
Bo Hu 3e3797a947 Merge "adb: print emulator console output" 2018-10-31 04:28:17 +00:00
Yabin Cui 0fe48f943d libprocinfo: provide MapInfo structure for reading maps.
Bug: none
Test: run libprocinfo_test.
Change-Id: I4d3c0f3012e91571aef7ebf4b154df1c9c5addc2
2018-10-30 17:36:09 -07:00
Yabin Cui a656b98634 libbase: support char parameter in StartsWith/EndsWith.
Bug: 117568547
Test: run libbase_test.
Change-Id: I5a6a412733c594f5a116f333b8e091d2d9f60e06
2018-10-30 17:20:50 -07:00
Josh Gao 08163cb032 debuggerd_fallback: fix fd leak.
Previously, when we received simultaneous dump requests, we were CASing
a file descriptor value into a variable, and then failing to close it
if the CAS failed.

Bug: http://b/118412443
Test: debuggerd_test
Change-Id: I075c35a239426002eb9416da3d268c3d1a18e9d2
2018-10-30 15:33:58 -07:00
bohu 09faa66006 adb: print emulator console output
It is very helpful to see the output of the following adb command:
adb emu <emulator commands...>

Change-Id: I7905370fb955de4d457a323a7e9e780aaca5d45e
2018-10-30 14:36:33 -07:00
Christopher Ferris e94eb5140c Merge "Update for v4.19 kernel headers." 2018-10-30 19:11:33 +00:00
Treehugger Robot b10f63526a Merge "adb install-multiple to also accept .fsv_sig" 2018-10-30 18:26:32 +00:00
Christopher Ferris 461baeb44e Update for v4.19 kernel headers.
Add new trap type TRAP_UNK.

Test: Unit tests pass.
Change-Id: I2b9cb8ddd1d993aa4819831aaca34f8da4286b52
(cherry picked from commit ead88bc88e)
2018-10-30 09:22:12 -07:00
Christopher Ferris b31badf70f Merge "Verify that the elf matches the expected arch." 2018-10-30 16:16:45 +00:00
Christopher Ferris 4568f4bc0f Verify that the elf matches the expected arch.
To avoid a case where a malicious app might try and trick the system to
create an elf and register object that mismatches, always verify that they
are the same arch.

Test: Ran unit tests.
Change-Id: I66978e9e02f8e4f396856912e7019528ead4838e
2018-10-29 18:08:09 -07:00
Tom Cherry 1d0ee36de7 Merge "fs_mgr: fix userdebug/user argument type mismatch" 2018-10-30 00:14:56 +00:00
Tom Cherry 8dcae262d7 fs_mgr: fix userdebug/user argument type mismatch
Test: build
Change-Id: I394bd14ef987d3b763869e05fdbf1ed32153ce59
2018-10-29 17:08:23 -07:00
Victor Hsieh 02ef4bb190 adb install-multiple to also accept .fsv_sig
.fsv_sig will be fs-verity signature in PKCS#7 format.

Test: adb install-multiple foo.apk foo.apk.fsv_sig
Bug: 112037636
Change-Id: I4a9b2203334d4974602c7f138222ade1aa319ccb
2018-10-29 16:55:06 -07:00
Treehugger Robot b7d9b6a995 Merge "fs_mgr: fs_mgr_has_shared_blocks() needs logical blk_device" 2018-10-29 22:18:37 +00:00
David Anderson 2cda71c9f6 Merge "liblp: Allow the super partition to span multiple block devices." 2018-10-29 20:57:06 +00:00
Suren Baghdasaryan d04b38b0e5 Merge "lmkd: Cleanup unused code for killing processes in bulk" 2018-10-29 20:09:29 +00:00
Suren Baghdasaryan d5eaeffcf3 Merge "lmkd: retune rate at which processes are killed" 2018-10-29 20:09:04 +00:00
Eric Biggers 82c6ba74e2 Merge "init: use libfscrypt for file-based encryption setup" 2018-10-29 17:19:39 +00:00
Suren Baghdasaryan f81b5f44d8 lmkd: Cleanup unused code for killing processes in bulk
find_and_kill_processes() does not kill multiple processes at a time
anymore. Remove support for bulk process killing.

Change-Id: Id09132a9cebe44589a1a3ebcbff800a16fa56557
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-10-29 16:20:50 +00:00
Tim Murray e7853f637c lmkd: retune rate at which processes are killed
Kill a single process at a time and try to wait up to 100ms for
that process to reclaim memory before triggering another kill.

Test: boots, works
bug: 116877958
Change-Id: I6775d0534b3e3728c04389d3eae1a00e3cbf9f27
2018-10-29 16:20:29 +00:00
Elliott Hughes 959aea7eae Merge "libziparchive: use lseek directly." 2018-10-27 14:59:53 +00:00
Elliott Hughes b70d19e75e libziparchive: use lseek directly.
The Mac doesn't have lseek64, and this code is built with
_FILE_OFFSET_BITS=64 anyway.

Bug: N/A
Test: ran tests
Change-Id: Ibda49c44ecfbe21b304e163e48f7ea42d97e38a7
2018-10-26 21:27:38 -07:00
Treehugger Robot 787de64fad Merge "fastboot: wipe overlayfs for partition" 2018-10-27 00:18:24 +00:00
David Anderson 43cb5db90a Merge "fastbootd: Remove metadata merging code." 2018-10-26 23:23:34 +00:00
Yuchao Zhou 1e6f4d8dab Merge "Yet another Mac fix." 2018-10-26 23:20:24 +00:00
Elliott Hughes 9c8bd669e8 Yet another Mac fix.
system/core/libziparchive/zip_archive.cc:847:36: error: use of undeclared identifier 'lseek64'; did you mean 'lseek'?
  const off64_t current_offset = lseek64(fd, 0, SEEK_CUR);

Bug: N/A
Test: builds
Change-Id: If762011722d53376bb6dab35c6ee8031762e5a95
2018-10-26 16:14:21 -07:00
Mark Salyzyn 1b066c313b fs_mgr: fs_mgr_has_shared_blocks() needs logical blk_device
For logical partitions, the fstab supplied during
fs_mgr_overlayfs_setup() does not have the correct blk_device and
thus check in fs_mgr_has_shared_blocks() inside
fs_mgr_overlayfs_enabled() will fail to provide the correct status.

Call fs_mgr_update_logical_partition() to fix this up.  Side effect
is an API change where fstab can no longer be considered const when
passed into fs_mgr_overlayfs_mount_all() and
fs_mgr_overlayfs_required_devices().

Some additional minor cleanup as well.  Move fs_mgr_rm_all() higher
up as-is in the file as it has no dependencies, which will complicate
future changes.  Add --help to adb-remount-test.sh unit test script,
improve error handling and checking.

Test: adb-remount-test.sh
Bug: 109821005
Bug: 117605276
Change-Id: I548d3797d49661529490d1a0bf96b63e57491704
2018-10-26 22:54:46 +00:00
Yuchao Zhou 55d31ecd86 Merge "More Mac build fixes." 2018-10-26 22:47:40 +00:00
Tom Cherry 668f70f6ef Merge "init: fix error messages when an invalid section header is found" 2018-10-26 22:31:52 +00:00
Mark Salyzyn 044f04baed fastboot: wipe overlayfs for partition
Arrange to delete the overlayfs backing when a specified partition
has been flashed.

Test: manual
Bug: 109821005
Bug: 117605276
Change-Id: I1c6a0341c6cd2ecfbb7c71bec5679a74d579aadd
2018-10-26 20:57:14 +00:00
David Anderson b6134a6d4e fastbootd: Remove metadata merging code.
The purpose of this code was to support preserving partitions across a
flashall operation. Since we are not supporting persistent read-write
partitions, this merging code is effectively useless - it is preserving
only partitions that will be deleted.

Additionally, this code does not merge partition group changes, since
doing so accurately is difficult. Partition size changes aren't sent
until after update-super resolves, so a valid re-grouping could be
rejected during update-super if the existing partitions are too big.

This patch removes the update-super merging code until a use case comes
along and we can properly evaluate how it should work.

Bug: N/A
Test: fastboot flashall
Change-Id: I1d622b23dabdf031897be9de49f59fc8cf3caf3b
2018-10-26 13:34:40 -07:00
Tom Cherry 0166fd606d init: fix error messages when an invalid section header is found
If a section header such as 'on' or 'service' has an error with it,
the rest of the commands / options are currently reported as errors
since there is no valid parser object to parse them.  For example,

service !@#$%%^&*() /system/bin/false
    user root
    group blah
    blah blah

Generates:

init: /system/etc/init/bad.rc: 2: invalid service name '!@#$%%^&*()'
init: /system/etc/init/bad.rc: 3: Invalid section keyword found
init: /system/etc/init/bad.rc: 4: Invalid section keyword found
init: /system/etc/init/bad.rc: 5: Invalid section keyword found

This change suppresses the extraneous 'Invalid section keyword found'
messages.

Test: faulty error messages are suppressed.
Change-Id: Ieeb2d5b8b7eea33e191a88ce5a0d41701686943f
2018-10-26 12:33:52 -07:00
Tom Cherry c7452ea8c4 Merge "init: allow vendor init to action on any vendor or odm property" 2018-10-26 19:15:58 +00:00
David Anderson 3eb5ba753c Merge "fastboot: Resize logical partitions when using the flash command." 2018-10-26 18:26:42 +00:00
Elliott Hughes a56a729c14 More Mac build fixes.
The libziparchive public headers that refer to `off64_t` also need the
Mac workaround.

In fastboot, there's a stray `lseek64` but since it's only for offset 0,
any kind of seek is fine.

Bug: N/A
Test: builds
Change-Id: I68b4f95202623ebf07ffe6c3e0e21437e7922c5b
2018-10-26 10:53:24 -07:00
Tom Cherry fa79ae87f1 init: allow vendor init to action on any vendor or odm property
Partial revert of "init: if vendor_init can read a property, let it be
a trigger too" (b35f827c97).

We made a mistake when we allowed vendor init to action on any vendor
or odm property, since when a new SELinux label is created for a
vendor property, vendor_init does not automatically get read
permissions for it.

Recently, we tried to use read permissions instead of the built-in
list in init, but that broke due to the above mistaken.  Since we have
already launched with these permissions as is, we must restore them.

Bug: 118457755
Test: no denials for vendor init actionable properties on crosshatch
Change-Id: I7a9a560c9a54a177c6b83d28309e2f288f05d400
2018-10-26 08:50:45 -07:00
Treehugger Robot 52db49b68f Merge "libbase: a slightly cleaner solution to libbase's `off64_t` problem." 2018-10-26 15:38:14 +00:00
Treehugger Robot a0dcfc2a0f Merge "libcutils: lose socket_peer_is_trusted to ART, the only user." 2018-10-26 15:37:55 +00:00
Eric Biggers f05da4a4be init: use libfscrypt for file-based encryption setup
The file-based encryption setup code is being refactored into its own
library because it applies to both ext4 and f2fs, not just ext4.  Update
init to use the new location.   For fs_mgr, just remove the include of
ext4_crypt_init_extensions.h since it was unneeded.

Test: built, booted device with f2fs encryption
Change-Id: I392a763e3349f001bdbc09eb9ca975aa3451fd68
2018-10-25 17:10:15 -07:00
Elliott Hughes 46e0cc27ca libbase: a slightly cleaner solution to libbase's `off64_t` problem.
Given that I can't actually go back in time and just make bionic's
`off_t` be 64-bit.

Bug: N/A
Test: builds
Change-Id: Ic93336b07bffc0977bd0e9caad6a22ce29ca06ed
2018-10-25 16:29:02 -07:00
Treehugger Robot dd85c74655 Merge "fastboot: Check that reboot to userspace succeeded." 2018-10-25 23:06:51 +00:00