diff --git a/src/tools/process_stub/main.cpp b/src/tools/process_stub/main.cpp index 702450f8b7f..c54480af4c1 100644 --- a/src/tools/process_stub/main.cpp +++ b/src/tools/process_stub/main.cpp @@ -25,6 +25,7 @@ #ifdef Q_OS_LINUX #include #include +#include #endif #include @@ -260,7 +261,11 @@ void setupUnixInferior() }); #else // PTRACE_TRACEME will stop execution of the child process as soon as execve is called. - inferiorProcess.setChildProcessModifier([] { ptrace(PTRACE_TRACEME, 0, 0, 0); }); + inferiorProcess.setChildProcessModifier([] { + ptrace(PTRACE_TRACEME, 0, 0, 0); + // Disable attachment restrictions so we are not bound by yama/ptrace_scope mode 1 + prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY); + }); #endif } #endif