[DynInst_API:] [dyninst/dyninst] f86e3c: common: use ptrace if yama blocked process_vm_read...


Date: Wed, 30 Nov 2016 14:54:56 -0800
From: Josh Stone <cuviper@xxxxxxxxx>
Subject: [DynInst_API:] [dyninst/dyninst] f86e3c: common: use ptrace if yama blocked process_vm_read...
  Branch: refs/heads/master
  Home:   https://github.com/dyninst/dyninst
  Commit: f86e3c2ea2e9c8a11a13b42b2b60438c53e597b5
      https://github.com/dyninst/dyninst/commit/f86e3c2ea2e9c8a11a13b42b2b60438c53e597b5
  Author: Josh Stone <jistone@xxxxxxxxxx>
  Date:   2016-11-29 (Tue, 29 Nov 2016)

  Changed paths:
    M common/src/linuxKludges.C

  Log Message:
  -----------
  common: use ptrace if yama blocked process_vm_readv/writev

Having sysctl kernel.yama.ptrace_scope=1, one may only call ptrace
attach on direct descendants.  The same restriction is also checked for
`process_vm_readv`/`writev` and certain procfs files.  However, if an
intermediate parent process already exited, we could end up with a
grandchild that we're still ptracing but isn't our descendant, so we
can't use the `process_vm` functions anymore -> `EPERM`.

We already had a fallback here for `EFAULT`, to just use `ptrace` memory
access, so use the same fallback after `EPERM` too.

Fixes #274.


  Commit: d8807bc88d1bd739ead169458aca54d9354e4bdc
      https://github.com/dyninst/dyninst/commit/d8807bc88d1bd739ead169458aca54d9354e4bdc
  Author: Josh Stone <cuviper@xxxxxxxxx>
  Date:   2016-11-30 (Wed, 30 Nov 2016)

  Changed paths:
    M common/src/linuxKludges.C

  Log Message:
  -----------
  Merge pull request #280 from cuviper/yama-process_vm_rw

common: use ptrace if yama blocked process_vm_readv/writev


Compare: https://github.com/dyninst/dyninst/compare/e12519599272...d8807bc88d1b
[← Prev in Thread] Current Thread [Next in Thread→]
  • [DynInst_API:] [dyninst/dyninst] f86e3c: common: use ptrace if yama blocked process_vm_read..., Josh Stone <=