-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfaults (in liblog) when hooking #9
Comments
If I'm not mistaken, you're saying that hooking malloc causes a kernel panic? These issues seem very unrelated. It seems much more likely to be a some bug in the kernel. |
No the kernel does not panic, just a segfault. See line "Mode USER_32", which indicates the fault in user mode. I just rebuilt a custom kernel with verbose Segfault logging, so as to locate the register status. I wonder whether you have any luck hijacking system functions such as malloc, etc? |
Ah. Sorry I missed that. I didn't expect such output from the kernel on a userspace crash, but your custom mods explain it. I haven't had any issues hooking malloc here. Perhaps you're having a thumb vs. ARM mode problem? Are you able to get a tombstone or attach a debugger to the process to see definitively what's happening? |
Issue is the process seems to be denying debugger attach, and even if you managed to attach to it, the route it is taken is different from the one when you don't attach (it is calculating the breakpoint hash i'm afraid ...) Can you share a concrete sample which attaches malloc - which will be so much appreciated? I have built both ARM and THUMB in a single so, providing both to the hook () function. I'm sure of that as the first time when I only supply THUMB code, hook () seems to complain. Oh btw.. hijacking sprintf also seem to produce the same issue... (segfauts in libc)... |
I've always ran hijack as root, so there's no problem here with debugger attaching. Does that work for you? I don't have a sample I can share at the moment. |
When hooking malloc using the following code:
Segfaults occurs after multiple callings to hbimp_malloc () - well if one enables hook_precall and hook_postcall, segfaults take place immediately
The text was updated successfully, but these errors were encountered: