[PATCH v3 0/6] pidfd_getfd: fix decoder

Ákos Uzonyi uzonyi.akos at gmail.com
Sun May 24 10:41:32 UTC 2020


From: Uzonyi Ákos <uzonyi.akos at gmail.com>

These patches fix pidfd_getfd decoder, which incorrectly assumed its
first argument being a pid, but actually that is a pidfd.

First, some functions are added to util.c, which makes the decoding possible.

Changes in v3:
  Restore optimization of printpidfd
  Use dup (not dup2) in test
  Use pipe (not sleep) for synchronization in test
Changes in v2:
  Check pid validity by ">0" instead of ">=0"
  Use different fd number in test

Ákos Uzonyi (6):
  pathtrace.c: add getfdpath_pid
  util.c: add printfd_pid
  Rename print_pid_fd -> printfd_pid_tracee_ns
  util.c: add pidfd_get_pid
  pidfd_getfd: fix decoder
  tests/pidfd_getfd.c: test decoding of targetfd

 defs.h              | 13 ++++++++++-
 kcmp.c              |  8 +++----
 pathtrace.c         | 15 ++++++++++---
 pidfd_getfd.c       | 20 ++++++++++++-----
 tests/gen_tests.in  |  6 ++---
 tests/pidfd_getfd.c | 35 ++++++++++++++++++++++++-----
 util.c              | 54 +++++++++++++++++++++++++++------------------
 7 files changed, 108 insertions(+), 43 deletions(-)

--
2.26.2



More information about the Strace-devel mailing list