Skip to content

v0.4.9

Latest

Choose a tag to compare

@Bahtya Bahtya released this 27 May 03:32

Fix

  • Replace libc inline hooks with GOT patching — v0.4.8 regression fix. The write_inline_hook approach modified libc code pages with mprotect(RWX), overwrote function prologues with ldr 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 for exit and execve instead. Uses same batch mprotect(RW) + write + mprotect(R) pattern as bash's GOT patching. No icache flush needed.
  • Fixed: exit() interceptor now calls saved original libc exit() for non-coroutine contexts (preserves atexit handlers and stdio flush), instead of raw exit_group syscall

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