1. 17 Apr, 2017 4 commits
    • Dmitry Safonov's avatar
      arm32/Makefile: fix readable mappings getting +x · d7c86c8b
      Dmitry Safonov authored
      Flag `noexecstack' for ld implies `EXSTACK_DISABLE_X' ELF flag
      on CRIU binary. Without this flag the kernel ELF loader will set
      `READ_IMPLIES_EXEC' personality bit:
      >	if (elf_read_implies_exec(loc->elf_ex, executable_stack))
      >		current->personality |= READ_IMPLIES_EXEC;
      
      This flag is checked by sys_mmap():
      >	if ((prot & PROT_READ) && (current->personality & READ_IMPLIES_EXEC))
      >		if (!(file && path_noexec(&file->f_path)))
      >			prot |= PROT_EXEC;
      
      Which results in each mmap() syscall returning +x mapping for any
      readable mapping for CRIU binary, e.g:
      Before C/R:
      76fc4000-76fc5000 r--p 0001f000 b3:02 131656     /usr/lib/ld-2.25.so
      76fc5000-76fc6000 rw-p 00020000 b3:02 131656     /usr/lib/ld-2.25.so
      After restore:
      76fc4000-76fc5000 r-xp 0001f000 b3:02 131656     /usr/lib/ld-2.25.so
      76fc5000-76fc6000 rwxp 00020000 b3:02 131656     /usr/lib/ld-2.25.so
      
      Which also makes ZDTM very sad:
      1: Old maps lost: set(["76f80000-76f81000 ['rw-p', '0120400']", "25000-26000
      ['rw-p', '0120400']", "76f7d000-76f7f000 ['rw-p']", "14a8000-14c9000 ['rw-p']",
      "76f4a000-76f4c000 ['r--p', '0120400']", "7ed3d000-7ed7f000 ['rw-p']",
      "76f7f000-76f80000 ['r--p', '0120400']", "24000-25000 ['r--p', '0120400']",
      "76f4c000-76f50000 ['rw-p', '0120400']"])
      1: New maps appeared: set(["76f7f000-76f80000 ['r-xp', '0120400']",
      "7ed3d000-7ed7f000 ['rwxp']", "76f4a000-76f4c000 ['r-xp', '0120400']",
      "76f80000-76f81000 ['rwxp', '0120400']", "24000-25000 ['r-xp', '0120400']",
      "14a8000-14c9000 ['rwxp']", "25000-26000 ['rwxp', '0120400']",
      "76f7d000-76f7f000 ['rwxp']", "76f4c000-76f50000 ['rwxp', '0120400']"])
      
      Maybe we also need to set it for arm64 or even for all archs, but that
      needs to be tested in the first place, so add it now to arm32, x86
      already has it.
      Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      d7c86c8b
    • Dmitry Safonov's avatar
      python: specify python2 as .py interpreter · 057c3f29
      Dmitry Safonov authored
      On some distro the default python interpreter is Python 3,
      which results in such errors:
      >  Running zdtm/static/socket-tcp-closed.hook(--post-start)
      >  make[1]: Nothing to be done for default.
      >  ./socket-tcp-closed --pidfile=socket-tcp-closed.pid --outfile=socket-tcp-closed.out
      >    File "zdtm/static/socket-tcp-closed.hook", line 16
      >      except OSError, e:
      >                    ^
      >  SyntaxError: invalid syntax
      >  ######### Test zdtm/static/socket-tcp-closed FAIL at hook --post-start #########
      >  Running zdtm/static/socket-tcp-closed.hook(--clean)
      >    File "zdtm/static/socket-tcp-closed.hook", line 16
      >      except OSError, e:
      >                    ^
      >  SyntaxError: invalid syntax
      >  Traceback (most recent call last):
      >    File "zdtm.py", line 1921, in <module>
      >      do_run_test(tinfo[0], tinfo[1], tinfo[2], tinfo[3])
      >    File "zdtm.py", line 1388, in do_run_test
      >      try_run_hook(t, ["--clean"])
      >    File "zdtm.py", line 1053, in try_run_hook
      >      raise test_fail_exc("hook " + " ".join(args))
      >  __main__.test_fail_exc: <__main__.test_fail_exc instance at 0x76294468>
      Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      057c3f29
    • Dmitry Safonov's avatar
      arm/compel: add generated headers to .gitignore · 692da148
      Dmitry Safonov authored
      [criu]# git status -s
      ?? compel/arch/arm/plugins/std/syscalls/syscalls.S
      ?? compel/plugins/include/uapi/std/syscall-aux.S
      ?? compel/plugins/include/uapi/std/syscall-aux.h
      Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      692da148
    • Dmitry Safonov's avatar
      test/maps01: document mmap() failures · ab33ae2d
      Dmitry Safonov authored
      Arm32 devices often have poor amount of RAM. E.g., RPI2 board
      has only 1Gb memory. This lead to failures with maps01 test,
      which tries to mmap() 1Gb of memory. The failures of test is
      not very evident - let's document mmap() errors here to
      blow some light on the situation.
      Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      ab33ae2d
  2. 11 Apr, 2017 18 commits
  3. 02 Apr, 2017 18 commits