Score:1

PTRACE_TRACEME error "Operation not permmited"

np flag

I am trying to use PTRACE_TRACEME to trace the child process:

if (ptrace(PTRACE_TRACEME, 0, NULL, NULL) == -1) {
   perror("ptrace_traceme");
   exit(EXIT_FAILURE);
}

And I got the error:

ptrace_traceme: Operation not permitted

As I understood the reason for the issue is security features.

I tried changing from - kernel.yama.ptrace_scope = 1 to: kernel.yama.ptrace_scope = 0.

I also checked that SELinux is disabled. About strace, I saw that strace can solve that problem but I didn't understand how, something with: strace -f ./program_name.

In addition, I run the program as a root and the problem was still not fixed, I start to think that the problem is not related to security features.

BTW, I am using Ubuntu 22.04.

Thanks for your helps!

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.