advanced-microcode-patching / shiva

A custom ELF linker/loader for installing ET_REL binary patches at runtime
Other
146 stars 13 forks source link

Fix interpreter crash #10

Closed elfmaster closed 1 year ago

elfmaster commented 1 year ago

In interpreter mode Shiva crashes randomly sometimes. In some cases it will not crash, but when control is passed to ld-linux.so it will fail in multiple ways.

REPRO 1 (It happens randomly and rarely)

elfmaster@esoteric-aarch64:~/amp/shiva/modules/aarch64_patches/fsplice/example6$ ./fsplice_host.patched abc abc ^[[A abc: error while loading shared libraries: abc: cannot open shared object file

REPRO 2

ld.so thinks that it was invoked directly

elfmaster commented 1 year ago

Fixed. o_stack_end is now set to the correct upper bounds stack address. The interpreter no longer has random crashes.