Zbigniew Jędrzejewski-Szmek | 90aeeef | 2015-06-27 14:00:14 -0400 | [diff] [blame] | 1 | # The ptrace system call is used for interprocess services, |
| 2 | # communication and introspection (like synchronisation, signaling, |
| 3 | # debugging, tracing and profiling) of processes. |
| 4 | # |
| 5 | # Usage of ptrace is restricted by normal user permissions. Normal |
| 6 | # unprivileged processes cannot use ptrace on processes that they |
| 7 | # cannot send signals to or processes that are running set-uid or |
| 8 | # set-gid. Nevertheless, processes running under the same uid will |
| 9 | # usually be able to ptrace one another. |
| 10 | # |
| 11 | # Fedora enables the Yama security mechanism which restricts ptrace |
| 12 | # even further. Sysctl setting kernel.yama.ptrace_scope can have one |
| 13 | # of the following values: |
| 14 | # |
| 15 | # 0 - Normal ptrace security permissions. |
| 16 | # 1 - Restricted ptrace. Only child processes plus normal permissions. |
| 17 | # 2 - Admin-only attach. Only executables with CAP_SYS_PTRACE. |
| 18 | # 3 - No attach. No process may call ptrace at all. Irrevocable. |
| 19 | # |
| 20 | # For more information see Documentation/security/Yama.txt in the |
| 21 | # kernel sources. |
| 22 | # |
| 23 | # The default is 1., which allows tracing of child processes, but |
| 24 | # forbids tracing of arbitrary processes. This allows programs like |
| 25 | # gdb or strace to work when the most common way of having the |
| 26 | # debugger start the debuggee is used: |
| 27 | # gdb /path/to/program ... |
| 28 | # Attaching to already running programs is NOT allowed: |
| 29 | # gdb -p ... |
| 30 | # This default setting is suitable for the common case, because it |
| 31 | # reduces the risk that one hacked process can be used to attack other |
| 32 | # processes. (For example, a hacked firefox process in a user session |
| 33 | # will not be able to ptrace the keyring process and extract passwords |
| 34 | # stored only in memory.) |
| 35 | # |
| 36 | # Developers and administrators might want to disable those protections |
| 37 | # to be able to attach debuggers to existing processes. Use |
| 38 | # sysctl kernel.yama.ptrace_scope=0 |
| 39 | # for change the setting temporarily, or copy this file to |
| 40 | # /etc/sysctl.d/20-yama-ptrace.conf to set it for future boots. |
| 41 | |
| 42 | kernel.yama.ptrace_scope = 0 |