frida / frida-gum

Cross-platform instrumentation and introspection library written in C
https://frida.re
Other
734 stars 242 forks source link

gumjs: prevent File and SQLite apis from triggering Interceptor #690

Closed mrmacete closed 1 year ago

mrmacete commented 1 year ago

When these APIs are called from threads not ignored by the Interceptor, they can trigger hooks on some libc functions: this is not expected and could cause assertions or undefined behaviour (like random deadlocks) depending on what the hooks do.

This change makes sure that while all calls to sqlite3 and FILE functions are performed by gumjs, Interceptor is ignoring the thread.

mrmacete commented 1 year ago

hmm tests are failing on linux, checking.

mrmacete commented 1 year ago

oh yeah stat is called differently on linux 😅 fixing

mrmacete commented 1 year ago

not sure what's going on with android-arm (arm64) the File test for v8 is failing but the error is not very informative 🤔

ok 866 /GumJS/Script/File/file_can_be_written_to#V8
sh: line 7: 14196 Trap                    ./gum-tests

Error: Command exited with error: 133

double checking my changes to the v8 side

mrmacete commented 1 year ago

oh wow not sure what's going on here, this is new: https://github.com/frida/frida-gum/actions/runs/3526209484/jobs/5913869715

could it be related related to using GumV8InterceptorIgnoreScope? (i don't see how though, interceptor is a singleton right?)