• Pavel Emelyanov's avatar
    reg-files: Do not try to linkat with wrong user · 9a392dff
    Pavel Emelyanov authored
    We link files to each other at restore time to restore
    unlinked paths. Kernel has strange secutiry restrictions
    about linkat we use. If the fsuid of the caller doesn't
    equals the uid of the file and the file is not "safe"
    one, then only global CAP_CHOWN will be allowed to link().
    
    This brings problems in user namespaces -- uns root is
    not allowed to linkat any file, unlike global root.
    
    Fortunately, we can change the fsuid temporarily and
    still linkat the file we want. Hopefully this hack will
    go away some day soon, when the kernel will have saner
    checks for linkat capabilities.
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
    9a392dff
Name
Last commit
Last update
..
app-emu Loading commit data...
bers Loading commit data...
crit 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...
pipes Loading commit data...
rpc Loading commit data...
security Loading commit data...
tcp Loading commit data...
unix-callback Loading commit data...
zdtm Loading commit data...
.gitignore Loading commit data...
Makefile Loading commit data...
Makefile.zdtm 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...
zdtm_ct.c Loading commit data...
zdtm_mount_cgroups Loading commit data...