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