Public Member Functions | |
| ScopedPrSetPtracer (pid_t pid, bool may_log) | |
Uses PR_SET_PTRACER to set pid as the caller's ptracer. | |
| ScopedPrSetPtracer (const ScopedPrSetPtracer &)=delete | |
| ScopedPrSetPtracer & | operator= (const ScopedPrSetPtracer &)=delete |
| crashpad::ScopedPrSetPtracer::ScopedPrSetPtracer | ( | pid_t | pid, |
| bool | may_log ) |
Uses PR_SET_PTRACER to set pid as the caller's ptracer.
PR_SET_PTRACER is only supported if the Yama Linux security module (LSM) is enabled. Otherwise, prctl(PR_SET_PTRACER, ...) fails with EINVAL. See linux-4.9.20/security/yama/yama_lsm.c yama_task_prctl() and linux-4.9.20/kernel/sys.c [sys_]prctl().
An error message will be logged on failure only if may_log is true and prctl does not fail with EINVAL;
| [in] | pid | The process ID of the process to make the caller's ptracer. |
| [in] | may_log | if true, this class may log error messages. |