90aeee
# The ptrace system call is used for interprocess services,
90aeee
# communication and introspection (like synchronisation, signaling,
90aeee
# debugging, tracing and profiling) of processes.
90aeee
#
90aeee
# Usage of ptrace is restricted by normal user permissions. Normal
90aeee
# unprivileged processes cannot use ptrace on processes that they
90aeee
# cannot send signals to or processes that are running set-uid or
90aeee
# set-gid. Nevertheless, processes running under the same uid will
90aeee
# usually be able to ptrace one another.
90aeee
#
90aeee
# Fedora enables the Yama security mechanism which restricts ptrace
90aeee
# even further. Sysctl setting kernel.yama.ptrace_scope can have one
90aeee
# of the following values:
90aeee
#
90aeee
# 0 - Normal ptrace security permissions.
90aeee
# 1 - Restricted ptrace. Only child processes plus normal permissions.
90aeee
# 2 - Admin-only attach. Only executables with CAP_SYS_PTRACE.
90aeee
# 3 - No attach. No process may call ptrace at all. Irrevocable.
90aeee
#
90aeee
# For more information see Documentation/security/Yama.txt in the
90aeee
# kernel sources.
90aeee
#
90aeee
# The default is 1., which allows tracing of child processes, but
90aeee
# forbids tracing of arbitrary processes. This allows programs like
90aeee
# gdb or strace to work when the most common way of having the
90aeee
# debugger start the debuggee is used:
90aeee
#    gdb /path/to/program ...
90aeee
# Attaching to already running programs is NOT allowed:
90aeee
#    gdb -p ...
90aeee
# This default setting is suitable for the common case, because it
90aeee
# reduces the risk that one hacked process can be used to attack other
90aeee
# processes. (For example, a hacked firefox process in a user session
90aeee
# will not be able to ptrace the keyring process and extract passwords
90aeee
# stored only in memory.)
90aeee
#
90aeee
# Developers and administrators might want to disable those protections
90aeee
# to be able to attach debuggers to existing processes. Use
90aeee
#   sysctl kernel.yama.ptrace_scope=0
90aeee
# for change the setting temporarily, or copy this file to
90aeee
# /etc/sysctl.d/20-yama-ptrace.conf to set it for future boots.
90aeee
90aeee
kernel.yama.ptrace_scope = 0