Fix zygote crash loop on 32-bit devices (#145) - #153
Merged
Conversation
Bump LSPlt to pick up the PatchPLTEntry fix. While backing up a hook region, LSPlt left it unmapped between moving the original segment aside and mapping the writable copy in its place. That region holds libandroid_runtime.so's .got and .got.plt, and on arm32 that library is the process's only provider of __aeabi_memcpy, __aeabi_memmove and friends -- each a bare `b <sym>@plt` through its own GOT, since bionic keeps its copies hidden. Any call to them from anywhere in the process during the window faults. On a 32-bit Android 10 device this killed zygote from inside our remote entry() call, the tracer restored registers and detached without the region ever being mapped back, and zygote then died again on its next __aeabi_memmove. Magisk restarted it and the whole thing repeated, leaving the device unusable.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Bump LSPlt to pick up the PatchPLTEntry fix.
While backing up a hook region, LSPlt left it unmapped between moving the original segment aside and mapping the writable copy in its place. That region holds libandroid_runtime.so's .got and .got.plt, and on arm32 that library is the process's only provider of __aeabi_memcpy, __aeabi_memmove and friends -- each a bare
b <sym>@pltthrough its own GOT, since bionic keeps its copies hidden. Any call to them from anywhere in the process during the window faults.On a 32-bit Android 10 device this killed zygote from inside our remote entry() call, the tracer restored registers and detached without the region ever being mapped back, and zygote then died again on its next __aeabi_memmove. Magisk restarted it and the whole thing repeated, leaving the device unusable.