[PATCH v3 0/7] [PIDNS] Final

Ákos Uzonyi uzonyi.akos at gmail.com
Fri Jul 24 23:12:36 UTC 2020


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

Currently pidns tests are skipped if kernel version < 4.9. Hopefully the patch
will be accepted in the kernel, so compat processes will have
ioctl(NS_GET_PARENT) too on >=4.9 kernels.

Changes in v3:
  - Split accidentally sqashed last commit
  - Undo modification of tests/pidfd_send_signal.c
  - Rename kcmp-yY test to kcmp-y--pidns-translation
  - Skip tests if unshare fails with EPERM
  - Fix buffer size in pidns_pid2str
  - Use largefile_wrappers.h macros
  - Return early if from_ns or our_ns is 0
  - Do not call ioctl(NS_GET_PARENT) again, if first failed with ENOTTY
  - Skip pidns tests if Linux kernel version < 4.9
  - Use smaller trie nodes in pidns.c
  - Remove race condition from fork--pidns-translation test
  - Move "key_size" to center in trie description
  - Use PT_TID (not PT_TGID) when translating tcp->pid
  - Fix get_ns_hierarchy and get_id_list functions
  - Fix migrate_pages test if syscall succeds
  - Fix filtering in ioctl_block--pidns-translation.test
  - Fix -a flag value in xetpriority test
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):
  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
  Add tests for PID namespace translation

 Makefile.am                                   |   4 +
 NEWS                                          |   1 +
 affinity.c                                    |   6 +-
 block.c                                       |   2 +-
 bpf.c                                         |   2 +-
 capability.c                                  |   4 +-
 clone.c                                       |  14 +-
 defs.h                                        |  32 +-
 fcntl.c                                       |  37 +-
 get_robust_list.c                             |   3 +-
 getpid.c                                      |  46 ++
 ioprio.c                                      |  26 +-
 ipc_shmctl.c                                  |   5 +-
 kcmp.c                                        |   5 +-
 largefile_wrappers.h                          |   2 +
 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                                      |   6 +-
 net.c                                         |   2 +-
 netlink.c                                     |   5 +-
 numa.c                                        |   6 +-
 pathtrace.c                                   |   5 +-
 pidfd_open.c                                  |   2 +-
 pidns.c                                       | 588 ++++++++++++++++++
 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             |  15 +
 tests/fork--pidns-translation.c               |  62 ++
 tests/fork--pidns-translation.test            |  16 +
 tests/gen_tests.in                            |  30 +-
 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     |  22 +
 tests/ioctl_block.c                           |  26 +-
 tests/ioprio--pidns-translation.c             |   2 +
 tests/ioprio.c                                |  56 +-
 tests/kcmp-y--pidns-translation.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                         |  19 +-
 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                                 | 166 +++++
 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                                        |  27 +-
 wait.c                                        |  35 +-
 138 files changed, 2670 insertions(+), 313 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-y--pidns-translation.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