frida-python segfaults and causes device to reboot
Grimler91 opened this issue · 6 comments
Problem description
Trying to use frida-python on arm with enforcing selinux seem to cause the device to reboot. I do not yet know if this is due to the arch or due to selinux being in enforcing mode.
Steps to reproduce
Install frida-python and tsu and run for example tsudo python3 loader.py
with loader.py containing for example
#!/data/data/com.termux/files/usr/bin/python3
import frida
import time
device = frida.get_local_device()
pid = device.spawn(["some.app (for example com.termux.app)"])
device.resume(pid)
time.sleep(1)
session = device.attach(pid)
Expected behavior
The app should be started.
Additional information
This might be because the selinux policy is not currently modified by frida-python, as discussed in frida/frida#1178
Yay! We're getting closer to a workable frida on android! Hmm... maybe you should run a logcat and then try to replicate the bug. That way, when it reboots, you'll have a record of all the under the hood stuff and what exactly is making the program bug out.
Tried it, but it doesn't show anything anything. /proc/last_kmesg
contains relevant information about the crash (I think).
However, I am not able to reproduce the crash today, even though I haven't changed anything (I think). It seems to work fine on arm as well. I will add the missing selinux patch and run some more tests, but if it doesn't crash again I'll probably close this.
@shadowslasher410 have you tried it?
Yeah, I haven't noticed anything wrong with it so far. I'm happy everything ended up working out. Oh, and you can also close the issue I posted as well, since it's all good now that we got our frida. :)
@shadowslasher410 Great!
I cannot close your other issue, I do not have read&write rights to the github.com/frida/frida repository. You should be able to close it yourself though!
@Grimler91 Oh by the way, just a thought, the problem with selinux permissive might be an issue with lineageOS, because I know on the XDA forum post that it says it has problems with SElinux permissive.
Edit: at least it did with my specific phone (moto g5s plus xt1806), i forgot what phone you have.