c - gdb ptrace operation not permitted -
i'm trying attach programme gdb returns me:
attaching process 29139 not attach process. if uid matches uid of target process, check setting of /proc/sys/kernel/yama/ptrace_scope, or try again root user. more details, see /etc/sysctl.d/10-ptrace.conf ptrace: operation not permitted.
edb-debugger returns "failed attach process, please check privileges , try again."
strace returns "attach: ptrace(ptrace_attach, ...): operation not permitted"
i changed "kernel.yama.ptrace_scope" 1 0 , "/proc/sys/kernel/yama/ptrace_scope" 1 0 , tried "set environment ld_preload=./ptrace.so" this:
#include <stdio.h> int ptrace(int i, int j, int k, int l) { printf(" ptrace(%i, %i, %i, %i), returning -1\n", i, j, k, l); return 0; }
but still returns same error. how can attach debuggers?
this due kernel hardening in linux; can disable behavior echo 0 > /proc/sys/kernel/yama/ptrace_scope
or modifying in /etc/sysctl.d/10-ptrace.conf
see this article in fedora 22 (with links documentation) , this comment thread ubuntu , .
Comments
Post a Comment