criu
criu copied to clipboard
Using Compel with PTRACE_TRACEME
Hello Team,
I have been using compel for my project lately & it ran fine as I just had to inject code during the runtime of the victim, basically at any convenient point of time post victim's execution. However, now I'm in a situation where I have to ptrace the victim, right from the beginning of its execution & at the same time do parasite injection during its runtime. Hence, I have no choice than to use PTRACE_TRACEME right before execve and use compel apis at runtime for injection. Since compel_stop_task uses PTRACE_SEIZE and PTRACE_INTERRUPT for stopping the application and for other things, it gives me a hard time to ptrace victim from beginning & do parasitic injection during runtime. I tried tweaking the code in infect.c of compel, but couldn't succeed as I am fully not aware of the compel code.
Is it possible to use compel in such cases?? Like having the victim being traced right from the beginning of its execution & use compel apis for code injection during runtime?? or am I missing some documentation that suggest how to use compel apis in such cases?? Kindly help me with is issue here.
Thanks in advance, Abilesh Sundarasamy
cc @cyrillos
Hi guys, Would somebody kindly comment on this, please fyi @rppt
A friendly reminder that this issue had no activity for 30 days.
@abiabilesh If I understand your problem correctly. You can detach your ptrace from task leaving it stopped by signal, then inject via compel which also uses ptrace and which also should be able to leave task stopped after it finished, then you can grab it back with ptrace by your main task...
See https://github.com/checkpoint-restore/criu/issues/1960#issuecomment-1220043721.
A friendly reminder that this issue had no activity for 30 days.