• Filipe Brandenburger's avatar
    zdtm: add new dumpable02 test to check that dumpable flag set to 0 or 2 works · 6cf2906b
    Filipe Brandenburger authored
    This confirms that the fix to handle dumpable flag set to 2 still works after
    restore.
    
    To force dumpable flag set to 0 or 2 (whatever the fs.suid_dumpable is set to),
    chmod the test binary to 0111 (executable, but not readable) and execv() it
    while running as non-root.  The kernel will unset the dumpable flag to prevent
    a core dump or ptrace to giving the user access to the pages of the binary
    (which are supposedly not readable by that user.)
    
    Tested:
    - # test/zdtm.sh static/dumpable02
      Test: zdtm/live/static/dumpable02, Result: PASS
    - # test/zdtm.sh ns/static/dumpable02
      Test: zdtm/live/static/dumpable02, Result: PASS
    - Used -DDEBUG to confirm the value of the dumpable flag was 0 or 2 to match
      the fs.suid_dumpable sysctl in the tests (both in and out of namespaces.)
    - Confirmed that the test fails if the commit that fixes handling of dumpable
      flag with value 2 is reverted and the fs.suid_dumpable sysctl is set to 2.
    Signed-off-by: 's avatarFilipe Brandenburger <filbranden@google.com>
    Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    6cf2906b
Name
Last commit
Last update
..
app-emu Loading commit data...
bers Loading commit data...
ext-links Loading commit data...
fault-injection Loading commit data...
jenkins Loading commit data...
libcriu Loading commit data...
mem-snap Loading commit data...
mounts Loading commit data...
rpc Loading commit data...
tcp Loading commit data...
unix-callback Loading commit data...
zdtm Loading commit data...
.gitignore Loading commit data...
Makefile Loading commit data...
app-emu.sh Loading commit data...
env.sh Loading commit data...
functions.sh Loading commit data...
maps.py Loading commit data...
post-dump.sh Loading commit data...
zdtm.sh Loading commit data...