Commit graph

53639 commits

Author SHA1 Message Date
Alessio Balsini
1cabfe44b7 Merge "Fuzzer for libdm's dm-linear devices creation"
am: d4a1cd2cdd

Change-Id: Ib1f19b49053ea0de14603118555b1f66a3d5b710
2019-10-11 09:33:34 -07:00
Treehugger Robot
d4a1cd2cdd Merge "Fuzzer for libdm's dm-linear devices creation" 2019-10-11 15:38:23 +00:00
Greg Kaiser
27ee4c8d08 Merge "lmkd: Remove unnecessary conditional"
am: 6b0e789a21

Change-Id: Iaa24b3f79aa09fa3957c91b55a28c170196afd50
2019-10-11 07:46:38 -07:00
Treehugger Robot
6b0e789a21 Merge "lmkd: Remove unnecessary conditional" 2019-10-11 14:30:00 +00:00
Nikita Ioffe
0ee759cc4c Merge "userspace reboot: stop post-data services and wait for them to be killed"
am: 4592237300

Change-Id: I0f9e4a03f883c8cf301f3f918c921e91c9612f03
2019-10-11 03:39:10 -07:00
Alessio Balsini
66568bf4b0 Merge "Move TempDevice to test_util.h"
am: 30820a384c

Change-Id: Ie6fdce86c133bf54f8bce79593d8fbe3d9ead914
2019-10-11 03:38:40 -07:00
Nikita Ioffe
4592237300 Merge "userspace reboot: stop post-data services and wait for them to be killed" 2019-10-11 10:29:50 +00:00
Treehugger Robot
30820a384c Merge "Move TempDevice to test_util.h" 2019-10-11 10:18:43 +00:00
Orion Hodson
0110459633 Merge "Move libnative{bridge,loader} to art/"
am: 5a1489ce4e

Change-Id: Ie9794335a461f286f69bd8a60a9ddf72142728f0
2019-10-11 03:04:27 -07:00
Florian Mayer
d91c9eae3f Merge "Remove useless goto."
am: b8ba80ebd2

Change-Id: I6a47e60d3b68180a14afcd1ec80d2f71fb1abfd2
2019-10-11 03:03:56 -07:00
Treehugger Robot
5a1489ce4e Merge "Move libnative{bridge,loader} to art/" 2019-10-11 09:57:05 +00:00
Florian Mayer
b8ba80ebd2 Merge "Remove useless goto." 2019-10-11 09:41:36 +00:00
Suren Baghdasaryan
bc605b7b75 Merge "libmeminfo: Report VMA flags in showmap report"
am: 9186612f9a

Change-Id: Ic607f518e33221e9297565fa0d9f65e1bb2555f3
2019-10-10 13:40:15 -07:00
Suren Baghdasaryan
9186612f9a Merge "libmeminfo: Report VMA flags in showmap report" 2019-10-10 20:13:48 +00:00
Alessio Balsini
08916b9ea2 Fuzzer for libdm's dm-linear devices creation
Create a fuzzer that fuzzes the parameters used for the creation
of dm-linear tables through libdm.
This fuzzer is based on libdm::DmLinear.

Bug: none
Test: dm_linear_fuzzer
Change-Id: I052144c6eb0db4fa6a37b5e54fbcb8193e5dc88f
Signed-off-by: Alessio Balsini <balsini@google.com>
2019-10-10 20:59:33 +01:00
Alessio Balsini
5e6dc03fd5 Move TempDevice to test_util.h
TempDevice is useful class for tests, move it to test_util.h to improve
its visibility and make it usable by other tests.

Bug: none
Test: none
Change-Id: Idad5667844b10559b24f8f5e657e47d99e14209e
Signed-off-by: Alessio Balsini <balsini@google.com>
2019-10-10 20:59:33 +01:00
Florian Mayer
ad427b74c4 Remove useless goto.
Test: build

Change-Id: Ifb8d832de1115eefbf2e09c6d5c8f03244566933
2019-10-10 18:15:24 +01:00
Nikita Ioffe
3f4b0d6113 userspace reboot: stop post-data services and wait for them to be killed
* Refactored code around stopping services a little bit to reuse it
  between full reboot and userspace reboot.
* Add a scope_guard to fallback to full reboot in case userspace reboot
  fails.
* In case of userspace reboot init will also wait for services to be
  terminated/killed and log the ones that didn't react to
  SIGTERM/SIGKILL in time.
* If some of the services didn't react to SIGKILL, fail userspace reboot.

Test: adb reboot userspace
Bug: 135984674
Change-Id: I820c7bc406169333b0f929f0eea028d8384eb2ac
2019-10-10 18:13:42 +01:00
Tom Cherry
a41b154c3c Merge "liblog: use packed structs instead of raw unaligned reads"
am: cad2fc2429

Change-Id: I71f8c128207bf6690e94f5845f0cf98771000bd9
2019-10-10 07:03:07 -07:00
Greg Kaiser
5670fabb94 lmkd: Remove unnecessary conditional
We want poll_handler to be handler_info, so it's more efficient
to just unconditionally assign it.

Test: TreeHugger
Change-Id: I55b5164da1817ef77b5d455eb618f9a2471afc5c
2019-10-10 06:52:23 -07:00
Tom Cherry
cad2fc2429 Merge "liblog: use packed structs instead of raw unaligned reads" 2019-10-10 13:46:54 +00:00
Tom Cherry
bbbf089137 liblog: use packed structs instead of raw unaligned reads
Per jmgao@, we still need to worry about unaligned integer accesses.

In any case, we already have the packed structs for all of the
unaligned data that we're reading, so this change favors using those
packed structs.

Bug: 142256213
Test: x86,arm32,arm64 liblog-unit-tests
Change-Id: I21fc629eac49895d03b5b31daa4cc494b0c4c230
2019-10-09 18:20:49 -07:00
Suren Baghdasaryan
e8f1468b14 libmeminfo: Report VMA flags in showmap report
Add VMA flags into showmap report so that we can distinguish different
sections of an executable or a library.

Bug: 138148041
Test: showmap -v <PID>
Change-Id: Ic1a13accbea447548c75a0c54d750280e40c6de8
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-10-09 16:18:18 -07:00
Suren Baghdasaryan
bee72d2abb Merge "lmkd: Track processes using pidfds"
am: d11c6f7fd8

Change-Id: I7cf396167954f51d3c7a092b5eebc54826f69f88
2019-10-09 11:13:15 -07:00
Suren Baghdasaryan
d11c6f7fd8 Merge "lmkd: Track processes using pidfds" 2019-10-09 17:46:14 +00:00
Hridya Valsaraju
9000ddccfc Merge "Export ion_4.12.h and ion_4.19.h"
am: 524dc3f8ef

Change-Id: Id3c5d84e61db4db3c70dff4822b5cc4805ddaad3
2019-10-09 10:06:38 -07:00
Hridya Valsaraju
524dc3f8ef Merge "Export ion_4.12.h and ion_4.19.h" 2019-10-09 16:58:32 +00:00
Suren Baghdasaryan
c06d551848 Merge "lmkd: Add support for process death notifications"
am: 530098cebc

Change-Id: I9316ebe6e9b8497f2a34dfb5a6423e216a73811f
2019-10-09 09:47:08 -07:00
Suren Baghdasaryan
530098cebc Merge "lmkd: Add support for process death notifications" 2019-10-09 16:18:40 +00:00
Daichi Hirono
446e8a8133 Merge "Add a link from runtime ns to the neuralnetworks ns"
am: b18dc5d287

Change-Id: If606607fd6bae18483212b35da0ec989b0e9b8c2
2019-10-09 08:26:48 -07:00
Tom Cherry
a66512dd6f Merge "liblog: remove alarm in logd_reader.cpp"
am: e3fc9ac7e3

Change-Id: I9708f7b1e84820b1bbf230a8fb5eeea3e88699f0
2019-10-09 08:20:46 -07:00
Treehugger Robot
b18dc5d287 Merge "Add a link from runtime ns to the neuralnetworks ns" 2019-10-09 15:20:03 +00:00
Tom Cherry
e3fc9ac7e3 Merge "liblog: remove alarm in logd_reader.cpp" 2019-10-09 14:48:38 +00:00
Orion Hodson
60239d2069 Move libnative{bridge,loader} to art/
Bug: 137364733
Test: m
Change-Id: I8fc0796745f7310f477fe9f8b0821586742dd9c0
2019-10-09 13:32:35 +01:00
Martin Stjernholm
79a4720e47 Merge "Continue without DEX support if libdexfile_external.so fails to load."
am: 58ee7e3ae1

Change-Id: I59da83cbc2d6cb747498d6c623b86aad10d1bfe3
2019-10-09 05:19:26 -07:00
Martin Stjernholm
58ee7e3ae1 Merge "Continue without DEX support if libdexfile_external.so fails to load." 2019-10-09 12:06:07 +00:00
Orion Hodson
20cc17ba74 Merge "Prepare for libnative{bridge,loader} moving to art/"
am: 2a46301b48

Change-Id: Iafc1d91efdc1fa12ac6b4ffb16cba1cfc346e6fa
2019-10-09 00:56:52 -07:00
Daichi Hirono
e76c0d2816 Add a link from runtime ns to the neuralnetworks ns
libneuralnetworks.so could be preloaded. In that case, it should be
accessible from libnativeloader which runs in the art namespace.

Bug: 141847343
Bug: 142089311
Test: m, cheets2 boots
Change-Id: I8710b624dff131f5cb797d53915f6597e3017c34
2019-10-09 07:43:52 +00:00
Treehugger Robot
2a46301b48 Merge "Prepare for libnative{bridge,loader} moving to art/" 2019-10-09 07:43:46 +00:00
Hridya Valsaraju
f142c4dd41 Export ion_4.12.h and ion_4.19.h
Also, clean-up duplicate copies of the header files.

Bug: 140916230
Test: make, ./ion-unit-tests
Change-Id: Iab06ba622ab1d50e902ae20411bae73d0b00bbc7
2019-10-08 21:36:03 -07:00
Suren Baghdasaryan
11dc734a06 lmkd: Track processes using pidfds
lmkd uses PIDs to track processes, however occasionally a PID of a process
might be reused without lmkd detecting that. This can happen if originally
registered process crashes, PID numbers wrap around and the same PID gets
reused for a different process. In this situation lmkd might kill a wrong
process. To prevent this issue from occurring lmkd will track processes
using their pidfd. During process registration lmkd calls sys_pidfd_open
and stores returned pidfd with the process record. Returned pidfd will not
be reused until lmkd closes it which happens only after the process is
unregistered. This way lmkd ensures that process identification is unique
and can't be reused.

Bug: 135608568
Test: lmkd_unit_test with and without pidfd kernel support
Change-Id: Ida10ea13905c250e47f792cdd6bd2e65aeaa3709
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-10-08 18:15:34 -07:00
Suren Baghdasaryan
f2081a96be lmkd: Add support for process death notifications
With pidfd polling support lmkd can detect process death without periodic
polling. Implement mechanism to detect kernel pidfd support using
pidfd_open syscall existence as an indicator. Implement the logic to use
pidfd to wait for process death.

Bug: 135608568
Test: lmkd_unit_test with and without pidfd kernel support
Change-Id: Ic6db7e50893534467f5130a7f998b66fb4451272
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-10-08 18:15:12 -07:00
Tom Cherry
5398021b9e liblog: remove alarm in logd_reader.cpp
There is an alarm() call that provides a 30 second timeout in case
logd is unavailable.  The main reason for this is in the case that logd
is crashing, debuggerd is ptrace'ing logd, and tombstoned is
attempting to dump log messages.  In this case, with no other checks
and without this alarm, tombstoned will deadlock when dumping log
messages.

However, tombstoned already has two mechanisms to prevent the above
situation from happening:
1) It checks that the thread name that is is dumping is either logd or
   starts with "logd." and skips dumping logs in this case.
2) It does not dump logs if it is running in process for any process.

Calling alarm() or modifying signal handlers from general purpose
libraries is not recommended either, so without a strong reason to
keep this, this change removes it.

This also shortens the liblog.wrap_mode_blocks test time, since the 30
second issue that it ensures does not happen has been fundamentally
removed.

Test: `kill -8 `pidof logd`` succeeds without delay
Test: liblog, logd unit tests
Change-Id: Id8a40544645d220e49f7ba299201af80a0c44de9
2019-10-08 13:05:55 -07:00
Tom Cherry
036b7c2998 Merge "liblog: remove code checking for fd = 0"
am: 5d7969b58a

Change-Id: I240832dbc14fc8ef10f331d80fc84abd8fcfd820
2019-10-08 12:37:01 -07:00
Tom Cherry
5d7969b58a Merge "liblog: remove code checking for fd = 0" 2019-10-08 19:24:02 +00:00
Martin Stjernholm
9062bb4269 Continue without DEX support if libdexfile_external.so fails to load.
libunwindstack may be used in situations where we cannot guarantee that
libdexfile_external.so is available, e.g. from libc_malloc_debug.so in the
bootstrap Bionic, or in APEXes with incomplete linker configs.

Test: atest libunwindstack_unit_test
Test: atest --host libunwindstack_unit_test
Test: rm -f out/host/linux-x86/lib*/libdexfile_external.so && \
  out/host/linux-x86/nativetest64/libunwindstack_unit_test/libunwindstack_unit_test
  (check that DexFile(s)Test tests fail without abort)
Bug; 139408016
Change-Id: I7eeee77ab363d9d39412ece2038ce786394bb34f
2019-10-08 19:21:45 +01:00
Christopher Ferris
1e93edb93b Merge "Handle when bias is different in elf headers."
am: c48c2afa1e

Change-Id: I77d95e4045d5c1c7dab4bda1797f1a338594334d
2019-10-08 10:56:14 -07:00
Christopher Ferris
c48c2afa1e Merge "Handle when bias is different in elf headers." 2019-10-08 17:41:25 +00:00
Elliott Hughes
33f155046d Merge "init: actually report which signal is causing the reboot."
am: 4d7d903e2b

Change-Id: I930bb03395804e293ceca6e5544018809cdbcc7c
2019-10-08 10:41:19 -07:00
Christopher Ferris
819f13116e Handle when bias is different in elf headers.
The original code assumed that the load bias in the program headers
would be exactly the same as in eh_frame/eh_frame_hdr/debug_frame.

This isn't guaranteed, so add a section bias for use when creating
a DwarfSection. In addtion, make the load bias and section bias
a signed value. There is no reason that this value needs to be positive,
so don't force it to be.

Add a new offline test that has a different load bias in eh_frame than
in the executable load.

Add additional unit tests to verify the load bias values are set properly.

Clean up the tests in ElfInterfaceTest, making all tests names follow the
same convention.

Bug: 141888859
Bug: 142094469

Test: New units and old unit tests pass on host and taimen.
Change-Id: Ib878123ab5545f0f315c749cfe0d27b012d873ee
2019-10-08 17:36:06 +00:00