summaryrefslogtreecommitdiff
path: root/libnativebridge/native_bridge_lazy.cc
AgeCommit message (Collapse)Author
2024-09-10Restrict exported symbols from libnative{loader,bridge} lazy libs. Martin Stjernholm
The shims in the lazy libs bypass the stubs and hence the vetted exported APIs in the .map.txt files. To avoid inadvertently giving external access to internal APIs that way, let's apply the .map.txt files as version scripts to the lazy libs instead, so that any functions added there just don't become available to external code unless the .map.txt files get updated. This hack doesn't work if the lazy libs are linked statically, so restrict them to be shared libs (although ideally they should be static instead to avoid the shared lib overheads). Also drop the shims for the two functions added in https://r.android.com/2689969 and https://r.android.com/3022103, because they're only used internally in ART and don't go through the shims. Test: atest libnativebridge-tests art_libnativebridge_cts_tests \ libnativebridge-lazy-tests libnativeloader_test \ art_libnativeloader_cts_test libnativeloader_lazy_test Bug: 124250621 Change-Id: I1e1eba3f656830f51b792ce672276f37b3f0d865
2024-04-05Add getTrampolineForFunctionPointer method to native bridge dimitry
Add a function to native bridge that generates trampolines for guest pointers and call it for native-bridged namespaces. Bug: http://b/330367443 Test: art/libnativebridge/tests/runtests.sh --skip-target Test: ./android-cts/tools/cts-tradefed run cts -m CtsJniTestCases Change-Id: I02cab5ea6c87cb4d5065033a4b6793eb57fe0f52
2023-08-08nativebridge: Add getTrampoline2 function to pass JNICallType dimitry
NativeBridge needs to know if JNI call is @CriticalNative, starting with v7 getTrampoline2 is used in place of getTrampoline. Bug: https://issuetracker.google.com/288392666 Test: art/libnativebridge/tests/runtests.sh --skip-target Change-Id: I60a2fd6ab2fb9d19dda7bbdcbe09144797bd1d49
2021-06-09Avoid internal APEX stubs in libnative{bridge,loader} and clean up Martin Stjernholm
exported symbols. The APEX stubs don't have any practical effect on the lazy loading library wrappers. Add notes about that and update the function wrappers to keep them in sync. Also add tests for the lazy libraries. That necessitated some reshuffling in libnativeloader tests to reuse the mocks. Test: art/libnativebridge/tests/runtests.sh Test: atest libnativebridge-lazy-tests Test: atest libnativeloader_test libnativeloader_lazy_test Bug: 122710865 Change-Id: I7e291f2e84d8e35731dfb1114c9b19978ff87969
2020-03-05Fix bugprone-macro-parentheses warnings Chih-Hung Hsieh
Bug: 150783705 Test: WITH_TIDY=1 make Change-Id: If8462783e9e15d46a48004285ced2a0e04d27b42
2020-01-21nativebridge: Add PreZygoteFork callback Lev Rumyantsev
It's required to clean-up the emulated enviroment (e.g. close file descriptors) after emulated execution in doPreload() in app-zygote. Test: NativeBridge6PreZygoteFork_test Test: CtsSeccompHostTestCases android.seccomp.cts.SeccompHostJUnit4DeviceTest testAppZygoteSyscalls both for Q.sdk_gphone_x86_arm.armeabi-v7a Bug: 146904103 Change-Id: Id192a1647c2f405570bf196daf65b3f2a9faca42
2019-10-11Move libnative{bridge,loader} to art/ Orion Hodson
This change moves system/core/libnative{bridge,loader} under art/. Bug: 137364733 Test: m Change-Id: I9be7333d00fcd3f36cd80520e50a30ea840187ad