Fix
- Replace libc inline hooks with GOT patching — v0.4.8 regression fix. The
write_inline_hookapproach modified libc code pages withmprotect(RWX), overwrote function prologues withldr x16, [pc, #8]; br x16, and required manual icache flushes. On PAC=1/MTE=1 devices this caused process death with no tombstone.
Changes
- Removed:
write_inline_hook(),hook_libc_exit(),hook_libc_execve()— no more code page modification - Added:
patch_libc_got()— patches libc.so's GOT entries forexitandexecveinstead. Uses same batchmprotect(RW)+ write +mprotect(R)pattern as bash's GOT patching. No icache flush needed. - Fixed:
exit()interceptor now calls saved original libcexit()for non-coroutine contexts (preserves atexit handlers and stdio flush), instead of rawexit_groupsyscall
Why GOT patching is safer
| Aspect | Inline hook | GOT patching |
|---|---|---|
| Target | Code pages (.text) | Data pages (.got.plt) |
| mprotect | RWX (code writable+executable) | RW (data writable) |
| icache flush | Required | Not needed |
| BTI/PAC impact | Can trigger on guarded pages | Data pages have no BTI/PAC |
Verification
- Build passes, no BTI ELF properties
- Requires testing on PAC=1/MTE=1 device
Full Changelog: v0.4.8...v0.4.9