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