Hello, this appears to be working as designed.

In Linux, process tracing is tied with the process dumping flag. The
dumpable flag is cleared at execve(2) time when a setuid or setgid
application is executed. This flag persists to child processes created
by fork(2) and will only be reset when a process calls execve(2) again.

The server.c program does not call any of the exec() family of
functions, nor system(3). Thus the flag is never set in the child
process.

You may be able to amend your application to call prctl(2) with
PR_SET_DUMPABLE if you wish to be able to trace the child. I will
caution you that the child may contain private data from the parent in
either shared memory segments that are open in both, copied memory
segments, duplicated file descriptors, etc. It would be better to change
your application design to use an execve(2) when starting a child
process that must be traced to ensure that a minimum of resources are
shared between parent and child.

Many thanks for the very clear description and source code. It really
helped me to understand what you were seeing and why.

Thanks

** Changed in: linux-signed (Ubuntu)
       Status: New => Won't Fix

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1860822

Title:
  ptrace fails with yama/ptrace_scope=0

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-signed/+bug/1860822/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to