Commit graph

53615 commits

Author SHA1 Message Date
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
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
Tom Cherry
29d0e89364 liblog: remove code checking for fd = 0
Fix a typo where I check socket()'s return value for 0 instead of -1
as an error.

Remove code that checks if socket() returns 0 as the actual fd that it
returns.  This should not happen in any well formed program.

Test: liblog unit tests
Change-Id: I1d878e85d9a39155d68c6c84e9cf9b0db8d1b3a4
2019-10-08 10:18:20 -07:00
Elliott Hughes
4d7d903e2b Merge "init: actually report which signal is causing the reboot." 2019-10-08 17:13:59 +00:00
Orion Hodson
a65f314e17 Prepare for libnative{bridge,loader} moving to art/
Add temporary public visibility for libraries.

Update bpfmt for ART's repohooks.

Bug: 137364733
Test: m nothing
Test: copy libs to art/, create a CL, run repohooks, m nothing.

Change-Id: Ib9a280136e4b992fe17b8943cf404c9c803efb8d
2019-10-08 16:44:44 +01:00
Nikita Ioffe
5e0e30db92 Merge "Add a skeleton of userspace reboot"
am: f1933c910d

Change-Id: I099d8bf703e13dacdb9717be77a3222541f02432
2019-10-08 07:51:16 -07:00
Nick Desaulniers
b71825ebce Merge "[liblog] fix -Wreorder-init-list"
am: 5bbe4a1b26

Change-Id: Ib06905d5e7ba024347322849d262191ba1410cd4
2019-10-08 07:45:30 -07:00
Nikita Ioffe
f1933c910d Merge "Add a skeleton of userspace reboot" 2019-10-08 14:42:36 +00:00
Treehugger Robot
5bbe4a1b26 Merge "[liblog] fix -Wreorder-init-list" 2019-10-08 14:24:41 +00:00
Nikita Ioffe
ba6968e636 Add a skeleton of userspace reboot
This CL only draws boundaries between userspace and full reboots, and
adds some functionality that will be required for userspace reboot:

* Whenever device is shutting down is now controlled in reboot.cpp,
  since during userspace reboot this state can change.
* Now it's also possible to restart handling of control messages inside
  property service. In case of userspace reboot, init will restart it
  after stopping post-data services.
* New userspace-reboot-requested trigger is added similar to shutdown
  one for full reboot.

Test: adb reboot
Test: adb reboot userspace
Bug: 135984674
Change-Id: Id55a53ba781d2b90ce40449037b6d8d47e72c476
2019-10-08 12:16:06 +01:00
Martin Stjernholm
87041ac24a Merge "Ensure all namespaces have links to /system/lib(64) for the sanitizer libs."
am: c14b27f22d

Change-Id: I59176f2691bd4185b72390883d87afebc10aa344
2019-10-08 04:13:46 -07:00
Martin Stjernholm
c14b27f22d Merge "Ensure all namespaces have links to /system/lib(64) for the sanitizer libs." 2019-10-08 11:06:05 +00:00
Steven Moreland
ae1f84cecb Merge "libutils: flattenable deprecation comment"
am: 6c1668d660

Change-Id: I73fcc23af93849a53393f2c8f4751528d314a9c9
2019-10-07 21:54:57 -07:00
Treehugger Robot
6c1668d660 Merge "libutils: flattenable deprecation comment" 2019-10-08 04:44:58 +00:00
Nick Desaulniers
34282df8bb [liblog] fix -Wreorder-init-list
Bug: 139945549
Test: mm
Change-Id: I57de1a650d2c85dfb4f8817bbc80eb2296eaf568
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-10-07 21:28:43 -07:00
Martin Stjernholm
99736dc587 Merge "Rename the runtime linker namespace following ART/Runtime APEX split."
am: b7dee5d148

Change-Id: I2f62b8c8202503447c0905efcd23ef8d74709fff
2019-10-07 20:57:17 -07:00
Treehugger Robot
b7dee5d148 Merge "Rename the runtime linker namespace following ART/Runtime APEX split." 2019-10-08 03:33:29 +00:00
Kiyoung Kim
c467e46c4d Merge "Disable to build ld.config.txt with previous vndk version"
am: 59a9cef6a0

Change-Id: Iaa2d719a5a27ecd4c13c08c922f80766d2d72e34
2019-10-07 18:20:00 -07:00
Elliott Hughes
636ebc9b3b init: actually report which signal is causing the reboot.
It wasn't clear to me why init was rebooting until I saw that it was
SIGABRT, which then made me read through earlier log spam to work out
what was actually unhappy (the SELinux compiler, in my case).

Test: worked out why init was rebooting my device
Change-Id: I605d8956213c4c23711073fd4b0ff99562b7f351
2019-10-07 18:16:23 -07:00
Steven Moreland
ae9749a29a libutils: flattenable deprecation comment
This class isn't used very much and it isn't supported by AIDL. In order
to recommend new users against this and recommend an alternative, added
a comment here.

Bug: 142282873
Test: N/A

Change-Id: If7c6c9fac6c868ed6a515e658de752092d25d5f9
2019-10-07 18:14:14 -07:00
Kiyoung Kim
59a9cef6a0 Merge "Disable to build ld.config.txt with previous vndk version" 2019-10-08 00:57:41 +00:00
Tobias Thierer
dd75048680 Merge "init: drop unused direct dependency on libcrypto.so"
am: 4ad0da974e

Change-Id: Ibf39a5c8af771b1e772ac28ef00c0000ecfc190a
2019-10-07 16:31:11 -07:00
Treehugger Robot
4ad0da974e Merge "init: drop unused direct dependency on libcrypto.so" 2019-10-07 23:12:56 +00:00
Suren Baghdasaryan
eca889f293 Merge "lmkd: Fix string null termination in proc_get_size and proc_get_name"
am: d72d846754

Change-Id: I8f94dffd1583861289df8fd68ea5d18ace4238dc
2019-10-07 16:09:35 -07:00
Suren Baghdasaryan
d72d846754 Merge "lmkd: Fix string null termination in proc_get_size and proc_get_name" 2019-10-07 22:53:49 +00:00
Elliott Hughes
b186f5fe1f Merge "adb: log more detail on failure to read keys."
am: 69627e52b9

Change-Id: I80feb0056cf1b87344c3e737f26a4eb6fc3012e6
2019-10-07 15:43:51 -07:00