ByteHook v1.1.2 #122
caikelun
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Announcement
1. Added compatibility with Android 17.
4.1-17 QPR1 Beta 4.Bug Fixes
1. Fixed a bug where threads could not enter the shared-mode proxy function after executing
pthread_key_clean_all().pthread_exit()is called during thread termination; this invokespthread_key_clean_all(), which performs four rounds of TLS cleanup. Afterpthread_key_clean_all()returns,pthread_exit()proceeds to call functions likemunmap().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.munmap()call withinpthread_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.
bh_switchmodule; although the timing window was extremely narrow, crashes did occur.3. Fixed a bug that could render bytehook entirely non-functional.
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.
公告
1. 兼容 Android 17。
4.1-17 QPR1 Beta 4。Bugs 修复
1. 修复了线程执行
pthread_key_clean_all()之后无法进入 shared 模式代理函数的 bug。pthread_exit(),其中会调用pthread_key_clean_all(),这个函数中会执行4轮清理 TLS 的操作。pthread_key_clean_all()返回后,pthread_exit()还会继续调用munmap()等操作。pthread_key_clean_all()的第1轮就被清理掉。此时如果再进入代理函数,automatic 模式的原有逻辑已经不可继续,为了最小化可能产生的副作用,之前的做法是跳过“代理函数”直接调用“原函数”。pthread_exit()中的munmap()以外,还包括 TLS 的后3轮清理中调用的所有 TLS 销毁函数(destructor function)中调用的其他函数。2. 修复了一个 unhook 时偶发的崩溃 bug。
bh_switch模块中的 use-after-free 问题导致的,虽然时间窗口极小,但是确实会发生崩溃。3. 修复了一个能使 bytehook 整体实效的 bug。
bytehook_add_dlopen_callback(),这个调用显然不会成功,但是却污染了 bytehook 内部的一些全局状态的值,导致之后 bytehook 初始化后再 hook 也都会失败。改进
1. 优化了部分 atomic 操作以及 memory order。
This discussion was created from the release ByteHook v1.1.2.
Beta Was this translation helpful? Give feedback.
All reactions