In Fedora 22, if you try to attach debugger to a running process, even if by the same user, gdb will politely refuse with error message:
ptrace: Operation not permitted.
The reason is a newly enabled security feature YAMA to specifically restrict inspecting memory of other programs. See the RH bug 1196825 for original discussion. This information is yet to reflect on the Fedora security features matrix. On why this restriction is a good thing, read the Linux kernel documentation. Note that this restriction doesn’t affect program started by debugger, such as “
gdb myprogram”. To enable debugging running programs, as root do:
echo 0 > /proc/sys/kernel/yama/ptrace_scope
echo kernel.yama.ptrace_scope = 0 > /etc/sysctl.d/10-ptrace.conf