[PATCH v2 0/7] [PIDNS] Final

Ákos Uzonyi uzonyi.akos at gmail.com
Tue Jul 21 21:19:18 UTC 2020


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

I made the requested changes to my prevoius series.

I ran a travis build [1], it seems to be fine, but on x86 all the pidns tests
are failing. According to the error message, ioctl(NS_GET_PARENT) errors
with ENOTTY. I have no idea why it happens, on my x86 system all tests pass.
If you know the reason of it, please tell me.

[1] https://travis-ci.org/github/AkosUzonyi/strace/builds/710483396

Changes in v2:
  - Add missing header files to Makefile
  - Fix pointer-to-int-cast errors
  - Fix unused-result errors
  - Use perror_msg instead of perror_func_msg where appropriate
  - Remove tcb parameter of read_int_from_file
  - Use xsprintf instead of snprintf
  - Refactor get_pid_max, get_ns_hierarchy, get_id_list functions
  - Remove -Y flag
  - Improve documentation of trie
  - Fix printing of f_owner_ex struct
  - Use printpid for F_GETOWN, F_SETOWN fcntl command arguments
  - Use printpid for shmid_ds.shm_cpid, shmid_ds.shm_clid
  - Call pidns_init before parsing arguments

Ákos Uzonyi (7):
  Remove tcb parameter of read_int_from_file
  PID namespace translation support
  Use printpid in decoders
  Use printpid in print_sockaddr and printsiginfo
  Add SYS_FUNC(tkill)
  Use get_proc_pid for /proc paths
  Implement testing framework for pidns

 Makefile.am                                   |   4 +
 NEWS                                          |   1 +
 affinity.c                                    |   6 +-
 block.c                                       |   2 +-
 bpf.c                                         |   2 +-
 capability.c                                  |   4 +-
 clone.c                                       |  14 +-
 defs.h                                        |  34 +-
 fcntl.c                                       |  37 +-
 get_robust_list.c                             |   3 +-
 getpid.c                                      |  46 ++
 ioprio.c                                      |  26 +-
 ipc_shmctl.c                                  |   5 +-
 kcmp.c                                        |   5 +-
 linux/32/syscallent.h                         |   2 +-
 linux/64/syscallent.h                         |   2 +-
 linux/alpha/syscallent.h                      |   2 +-
 linux/arm/syscallent.h                        |   2 +-
 linux/avr32/syscallent.h                      |   2 +-
 linux/bfin/syscallent.h                       |   2 +-
 linux/dummy.h                                 |   8 +-
 linux/hppa/syscallent.h                       |   2 +-
 linux/i386/syscallent.h                       |   2 +-
 linux/ia64/syscallent.h                       |   2 +-
 linux/m68k/syscallent.h                       |   2 +-
 linux/microblaze/syscallent.h                 |   2 +-
 linux/mips/syscallent-n32.h                   |   2 +-
 linux/mips/syscallent-n64.h                   |   2 +-
 linux/mips/syscallent-o32.h                   |   2 +-
 linux/powerpc/syscallent.h                    |   2 +-
 linux/powerpc64/syscallent.h                  |   2 +-
 linux/s390/syscallent.h                       |   2 +-
 linux/s390x/syscallent.h                      |   2 +-
 linux/sh/syscallent.h                         |   2 +-
 linux/sh64/syscallent.h                       |   2 +-
 linux/sparc/syscallent.h                      |   2 +-
 linux/sparc64/syscallent.h                    |   2 +-
 linux/x32/syscallent.h                        |   2 +-
 linux/x86_64/syscallent.h                     |   2 +-
 linux/xtensa/syscallent.h                     |   2 +-
 mmap_cache.c                                  |   2 +-
 msghdr.c                                      |   8 +-
 net.c                                         |   2 +-
 netlink.c                                     |   5 +-
 numa.c                                        |   6 +-
 pathtrace.c                                   |   5 +-
 pidfd_open.c                                  |   2 +-
 pidns.c                                       | 570 ++++++++++++++++++
 print_fields.h                                |  28 +-
 print_group_req.c                             |   2 +-
 printsiginfo.c                                |  24 +-
 printsiginfo.h                                |   2 +-
 process.c                                     |   3 +-
 process_vm.c                                  |   6 +-
 resource.c                                    |  27 +-
 sched.c                                       |  25 +-
 signal.c                                      |  34 +-
 sock.c                                        |  10 +-
 sockaddr.c                                    |  35 +-
 strace.1.in                                   |   6 +
 strace.c                                      |  13 +-
 syscall.c                                     |  15 +
 tests/.gitignore                              |  31 +
 tests/Makefile.am                             |  37 ++
 tests/fcntl--pidns-translation.c              |   2 +
 tests/fcntl-common.c                          |  88 ++-
 tests/fcntl.c                                 |   1 +
 tests/fcntl64--pidns-translation.c            |   2 +
 tests/fcntl64.c                               |   3 +
 tests/fork--pidns-translation.awk             |   8 +
 tests/fork--pidns-translation.c               |  62 ++
 tests/fork--pidns-translation.test            |  14 +
 tests/gen_tests.in                            |  28 +
 tests/getpgrp--pidns-translation.c            |   2 +
 tests/getpgrp.c                               |  10 +-
 tests/getpid--pidns-translation.c             |   2 +
 tests/getpid.c                                |  10 +-
 tests/getsid--pidns-translation.c             |   2 +
 tests/getsid.c                                |  11 +-
 tests/gettid--pidns-translation.c             |   2 +
 tests/gettid.c                                |  10 +-
 tests/init.sh                                 |  30 +
 tests/ioctl_block--pidns-translation.c        |   2 +
 tests/ioctl_block--pidns-translation.test     |  20 +
 tests/ioctl_block.c                           |  26 +-
 tests/ioprio--pidns-translation.c             |   2 +
 tests/ioprio.c                                |  56 +-
 tests/kcmp-yY.c                               |   2 +
 tests/kcmp.c                                  |  38 +-
 tests/kill--pidns-translation.c               |   2 +
 tests/kill.c                                  |  14 +-
 tests/migrate_pages--pidns-translation.c      |   2 +
 tests/migrate_pages.c                         |  13 +-
 tests/move_pages--pidns-translation.c         |   2 +
 tests/move_pages.c                            |  53 +-
 tests/net-sockaddr--pidns-translation.c       |   2 +
 tests/net-sockaddr.c                          |  68 ++-
 tests/netlink_audit--pidns-translation.c      |   2 +
 tests/netlink_audit--pidns-translation.test   |  13 +
 tests/netlink_audit.c                         |  13 +-
 tests/pidfd_open--pidns-translation.c         |   2 +
 tests/pidfd_open.c                            |  23 +-
 tests/pidfd_send_signal--pidns-translation.c  |   2 +
 tests/pidfd_send_signal.c                     |  15 +-
 tests/pidns.c                                 | 162 +++++
 tests/pidns.h                                 |  41 ++
 tests/prlimit64--pidns-translation.c          |   2 +
 tests/prlimit64.c                             |  19 +-
 tests/process_vm_readv--pidns-translation.c   |   2 +
 tests/process_vm_readv_writev.c               |  29 +-
 tests/process_vm_writev--pidns-translation.c  |   2 +
 tests/rt_sigqueueinfo--pidns-translation.c    |   2 +
 tests/rt_sigqueueinfo.c                       |  17 +-
 tests/rt_tgsigqueueinfo--pidns-translation.c  |   2 +
 tests/rt_tgsigqueueinfo.c                     |  28 +-
 tests/sched_xetaffinity--pidns-translation.c  |   2 +
 tests/sched_xetaffinity.c                     |  33 +-
 tests/sched_xetattr--pidns-translation.c      |   2 +
 tests/sched_xetattr.c                         |  49 +-
 tests/sched_xetparam--pidns-translation.c     |   2 +
 tests/sched_xetparam.c                        |  22 +-
 tests/sched_xetscheduler--pidns-translation.c |   2 +
 tests/sched_xetscheduler.c                    |  46 +-
 tests/signal_receive--pidns-translation.c     |   2 +
 tests/signal_receive.c                        |  24 +-
 tests/so_peercred--pidns-translation.c        |   2 +
 tests/so_peercred.c                           |  24 +
 tests/xet_robust_list--pidns-translation.c    |   2 +
 tests/xet_robust_list.c                       |  20 +-
 tests/xetpgid--pidns-translation.c            |   2 +
 tests/xetpgid.c                               |  23 +-
 tests/xetpriority--pidns-translation.c        |   2 +
 tests/xetpriority.c                           |  22 +-
 trie.c                                        | 366 +++++++++++
 trie.h                                        | 125 ++++
 util.c                                        |  29 +-
 wait.c                                        |  35 +-
 137 files changed, 2631 insertions(+), 315 deletions(-)
 create mode 100644 getpid.c
 create mode 100644 pidns.c
 create mode 100644 tests/fcntl--pidns-translation.c
 create mode 100644 tests/fcntl64--pidns-translation.c
 create mode 100644 tests/fork--pidns-translation.awk
 create mode 100644 tests/fork--pidns-translation.c
 create mode 100755 tests/fork--pidns-translation.test
 create mode 100644 tests/getpgrp--pidns-translation.c
 create mode 100644 tests/getpid--pidns-translation.c
 create mode 100644 tests/getsid--pidns-translation.c
 create mode 100644 tests/gettid--pidns-translation.c
 create mode 100644 tests/ioctl_block--pidns-translation.c
 create mode 100755 tests/ioctl_block--pidns-translation.test
 create mode 100644 tests/ioprio--pidns-translation.c
 create mode 100644 tests/kcmp-yY.c
 create mode 100644 tests/kill--pidns-translation.c
 create mode 100644 tests/migrate_pages--pidns-translation.c
 create mode 100644 tests/move_pages--pidns-translation.c
 create mode 100644 tests/net-sockaddr--pidns-translation.c
 create mode 100644 tests/netlink_audit--pidns-translation.c
 create mode 100755 tests/netlink_audit--pidns-translation.test
 create mode 100644 tests/pidfd_open--pidns-translation.c
 create mode 100644 tests/pidfd_send_signal--pidns-translation.c
 create mode 100644 tests/pidns.c
 create mode 100644 tests/pidns.h
 create mode 100644 tests/prlimit64--pidns-translation.c
 create mode 100644 tests/process_vm_readv--pidns-translation.c
 create mode 100644 tests/process_vm_writev--pidns-translation.c
 create mode 100644 tests/rt_sigqueueinfo--pidns-translation.c
 create mode 100644 tests/rt_tgsigqueueinfo--pidns-translation.c
 create mode 100644 tests/sched_xetaffinity--pidns-translation.c
 create mode 100644 tests/sched_xetattr--pidns-translation.c
 create mode 100644 tests/sched_xetparam--pidns-translation.c
 create mode 100644 tests/sched_xetscheduler--pidns-translation.c
 create mode 100644 tests/signal_receive--pidns-translation.c
 create mode 100644 tests/so_peercred--pidns-translation.c
 create mode 100644 tests/xet_robust_list--pidns-translation.c
 create mode 100644 tests/xetpgid--pidns-translation.c
 create mode 100644 tests/xetpriority--pidns-translation.c
 create mode 100644 trie.c
 create mode 100644 trie.h

--
2.27.0



More information about the Strace-devel mailing list