1. 06 Feb, 2017 22 commits
  2. 03 Feb, 2017 12 commits
  3. 01 Feb, 2017 6 commits
    • Pavel Begunkov's avatar
      zdtm: Add checkskip scripts for OFD locks · 65214e44
      Pavel Begunkov authored
      This is needed in cases when kernel doesn't support OFD locks.
      (OFD locks were added in 2014).
      
      travis-ci: success for zdtm: Add checkskip scripts for OFD locks
      Signed-off-by: 's avatarPavel Begunkov <asml.silence@gmail.com>
      Signed-off-by: 's avatarEugene Batalov <eabatalov89@gmail.com>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      65214e44
    • Andrei Vagin's avatar
      zdtm: improve socket-tcp-close-wait.c · 3dd21b1b
      Andrei Vagin authored
      * Don't send uninitialized data
      * Close descriptors more carefully
      * Add comments
      
      travis-ci: success for zdtm: improve socket-tcp-close-wait.c
      Reported-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
      Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      Reviewed-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      3dd21b1b
    • Andrey Ryabinin's avatar
      tests: add '/bin/ip' to deps in addition to '/sbin/ip' · f2181eae
      Andrey Ryabinin authored
      Some distros put 'ip' util in /bin directory.
      
      travis-ci: success for tests: add '/bin/ip' to deps in addition to '/sbin/ip'
      Signed-off-by: 's avatarAndrey Ryabinin <aryabinin@virtuozzo.com>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      f2181eae
    • Andrey Ryabinin's avatar
      net: fix stack out-of-bounds access in dump_one_netdev() · ea8483ea
      Andrey Ryabinin authored
      'info' array is off-by-one, nla_parse_nested() requires destination
      array (i.e. 'info') to have maxtype+1 (i.e. IFLA_INFO_MAX+1) elements:
      
      	ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffef823e3f8
      	WRITE of size 48 at 0x7ffef823e3f8 thread T0
      	    #0 0x7f9ab7a3915b in __asan_memset (/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libasan.so.2+0x8d15b)
      	    #1 0x7f9ab6d4e553 in nla_parse (/usr/lib64/libnl-3.so.200+0xa553)
      	    #2 0x4acfb7 in dump_one_netdev criu/net.c:445
      	    #3 0x4adb60 in dump_one_ethernet criu/net.c:594
      	    #4 0x4adb60 in dump_one_link criu/net.c:665
      	    #5 0x48af69 in nlmsg_receive criu/libnetlink.c:45
      	    #6 0x48af69 in do_rtnl_req criu/libnetlink.c:119
      	    #7 0x4b0e86 in dump_links criu/net.c:878
      	    #8 0x4b0e86 in dump_net_ns criu/net.c:1651
      	    #9 0x4a760d in do_dump_namespaces criu/namespaces.c:985
      	    #10 0x4a760d in dump_namespaces criu/namespaces.c:1045
      	    #11 0x451ef7 in cr_dump_tasks criu/cr-dump.c:1799
      	    #12 0x424588 in main criu/crtools.c:736
      	    #13 0x7f9ab67b171f in __libc_start_main (/lib64/libc.so.6+0x2071f)
      	    #14 0x4253d8 in _start (/criu/criu/criu+0x4253d8)
      
      	Address 0x7ffef823e3f8 is located in stack of thread T0 at offset 264 in frame
      	    #0 0x4ac9ef in dump_one_netdev criu/net.c:364
      
      	  This frame has 5 object(s):
      	    [32, 168) 'netdev'
      	    [224, 264) 'info' <== Memory access at offset 264 overflows this variable
      	    [320, 1040) 'req'
      	    [1088, 3368) 'path'
      	    [3424, 3625) 'stable_secret'
      
      Increase 'info' size to fix this.
      
      Fixes: b705dcc3 ("net: pass the struct nlattrs to dump() functions")
      travis-ci: success for net: fix stack out-of-bounds access in dump_one_netdev()
      Signed-off-by: 's avatarAndrey Ryabinin <aryabinin@virtuozzo.com>
      Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      ea8483ea
    • Andrey Ryabinin's avatar
      files-reg: fix use-after-free in open_remap_ghost() · ec40484e
      Andrey Ryabinin authored
      Ghost file entry used right after it has been freed:
      	ERROR: AddressSanitizer: heap-use-after-free on address 0x60700000dc50
      	READ of size 4 at 0x60700000dc50 thread T0
      	    #0 0x46e819 in open_remap_ghost criu/files-reg.c:312
      	    #1 0x46e819 in prepare_one_remap criu/files-reg.c:461
      	    #2 0x46e819 in prepare_remaps criu/files-reg.c:507
      	    #3 0x45af00 in root_prepare_shared criu/cr-restore.c:235
      	    #4 0x45af00 in restore_task_with_children criu/cr-restore.c:1421
      	    #5 0x7efc71e85f0c in clone (/lib64/libc.so.6+0xe7f0c)
      
      	0x60700000dc50 is located 32 bytes inside of 80-byte region [0x60700000dc30,0x60700000dc80)
      	freed by thread T0 here:
      	    #0 0x7efc7305184a in __interceptor_free (/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libasan.so.2+0x9884a)
      	    #1 0x46e4df in open_remap_ghost criu/files-reg.c:309
      	    #2 0x46e4df in prepare_one_remap criu/files-reg.c:461
      	    #3 0x46e4df in prepare_remaps criu/files-reg.c:507
      
      	previously allocated by thread T0 here:
      	    #0 0x7efc73051b82 in malloc (/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libasan.so.2+0x98b82)
      	    #1 0x7efc7277a8ea in protobuf_c_message_unpack (/usr/lib64/libprotobuf-c.so.1+0x48ea)
      	    #2 0xd528232002838017  (<unknown module>)
      
      Just move freeing after the last 'gfe' usage to fix this.
      
      Fixes: d0097b2d ("files: Support ghost directories restore")
      travis-ci: success for files-reg: fix use-after-free in open_remap_ghost()
      Signed-off-by: 's avatarAndrey Ryabinin <aryabinin@virtuozzo.com>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      ec40484e
    • Pavel Tikhomirov's avatar
      zdtm: do not run cow0x tests in userns · de7a2144
      Pavel Tikhomirov authored
      Opening /proc/<pid>/pagemap in userns is only available since linux
      v4.3 or later, after commit 1c90308e7a77 (pagemap: hide physical
      addresses from non-privileged users). So those tests fail on older
      kernels:
      https://ci.openvz.org/job/CRIU/job/CRIU-virtuozzo/job/criu-dev/1402
      
      travis-ci: success for zdtm: do not run cow0x tests in userns
      Signed-off-by: 's avatarPavel Tikhomirov <ptikhomirov@virtuozzo.com>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      de7a2144