You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Fixed a bug where threads could not enter the shared-mode proxy function after executing pthread_key_clean_all().
In the bionic pthread implementation, pthread_exit() is called during thread termination; this invokes pthread_key_clean_all(), which performs four rounds of TLS cleanup. After pthread_key_clean_all() returns, pthread_exit() proceeds to call functions like munmap().
Automatic-mode proxy functions rely on TLS to store context information, but bytehook's own TLS data was being cleared during the first round of pthread_key_clean_all(). If the proxy function was entered after this point, the original automatic-mode logic could no longer function correctly. To minimize potential side effects, the previous approach was to skip the "proxy function" and call the "original function" directly.
Scope of impact: In addition to the munmap() call within pthread_exit(), this also covers functions called by any TLS destructor functions executed during the final three rounds of TLS cleanup.
2. Fixed a bug causing occasional crashes during unhooking.
This bug was caused by a use-after-free issue in the bh_switch module; although the timing window was extremely narrow, crashes did occur.
3. Fixed a bug that could cause the entire bytehook functionality to fail.
In previous versions, calling bytehook_add_dlopen_callback() before bytehook initialization would fail, but it would corrupt internal global state values, causing subsequent hooking attempts to fail even after bytehook was initialized.
Improvements
1. Optimized specific atomic operations and memory ordering.
In previous versions, the implementation of certain atomic operations and memory ordering was imprecise; in isolated cases, this could theoretically lead to issues on the arm64 architecture.