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