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
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>
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>
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
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
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
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
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
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
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
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
When I previously tried this in https://r.android.com/1108553 , it broke on
some targets but I think that may have been fixed. I'm trying it again now
to see if this now passes treehugger and sticks.
Note: There is still an indirect dependency via libfs_mgr.
Bug: 137267623
Test: Treehugger
Change-Id: I2d8b909e451bb64a1eb0719a145dfd74da1dcbad
Before we just got "Failed to read key". After:
adb E 10-07 08:20:14 258249 258249 auth.cpp:176] Failed to read key \
from '/usr/local/google/home/enh/.android/adbkey'
94390117965240:error:0900006e:PEM routines:OPENSSL_internal:NO_START_LINE:\
external/boringssl/src/crypto/pem/pem_lib.c:622:Expecting: ANY PRIVATE KEY
Also fix the misleading "Failed to generate" message from adb_auth_init.
Bug: http://b/141715453
Test: manually corrupted key; see above
Change-Id: I6732ee6b683c8548d596d7c22eeddab8ce9a3cea
This CL updates ld.config.vndk_lite.txt, which still is not handled by
linkerconfig.
Test: presubmits
Bug: 140790209
Change-Id: Ia822f86aa0b853656555ade0bed191e07c07d09d
Remove the kludge in libnativeloader to deal with the inconsistency wrt the
name of the APEX package.
Test: Build & boot
Test: atest system/core/libnativeloader (on cf_x86_phone)
Bug: 139408016
Change-Id: I6115b49237c78c2ea4aa943ca4fe0b296b5a2b62
As generic ld.config.txt will be covered with linker config generator,
ld.config.txt with previous vndk build is no longer required. This
change removes this part so there will be no unnecessary build step for
multiple vndk version build. Also vndk snapshot will have vndkcore and
vndkprivate files with version number, update_and_install_ld_config.mk
has been updated temporary for vndk_lite build.
Bug: 142072719
Test: m -j passed with aosp_arm64 build
Change-Id: Ia7529c80b179dc262c6e7646a34c2a05a0d9be84
Last generic ld.config.txt deprecation caused build error from
build_test build because of invalid ld.config.txt build target. To fix
this ld.config.txt build target should be enabled until
ld.config.vndklite.txt and ld.config.legacy.txt also become deprecated.
Bug: 138920271
Test: m ld.config.txt passed
Test: build_test passed
Change-Id: I7f45ee66d3ed70a1a698261e1e801a30729f592f
libneuralnetworks.so could be preloaded. In that case, it should be
accessible from libnativeloader which runs in the runtime namespace.
Bug: 141847343
Bug: 142111172
Test: m, marlin/sailfish boots
Change-Id: I5b2f3073d0711d6049b4e1e1bd0bcc403949fe14