dlinject
dlinject copied to clipboard
no protect for mutiple threads
Could you be more specific?
Could you be more specific?
For example, for a process consisting of multiple threads, when you continue the process, multiple threads may all execute this segment of code. It leads to several problems:
- dl_open is executed several times.
- one thread modifies the text while the other thread executes it, which may lead to segment fault.
Maybe steps should be like this:
- stop all threads
- continue one threads
- stop this threads again
- continue all threads
@DavidBuchanan314
IIUC, there is no execute-while-writing race condition if you use the cgroup freezer stop method.
However, when the threads are restarted, you are correct that multiple threads could theoretically enter the shellcode simultaneously. Do you have a test program that exhibits this behaviour?