• Andrew Vagin's avatar
    files: try to change fsuid only if linkat() failed · 5bdc1623
    Andrew Vagin authored
    We found that linkat for "unsafe" files doesn't work in userns
    if a file uid isn't equal to the currect fsuid. This issue was
    fixed by changing fsuid before calling linkat. But in this
    case we are not able to createa link if a target directory doesn't
    have write premissions.
    
    Starting with the 4.3 kernel, it's possible to create links of
    "unsafe files":
    
    f2ca379642d7 ("namei: permit linking with CAP_FOWNER in userns")
    
    So we can try to call linkat() without changing fsuid and make one
    more attempt with changing fsuid if the first one failed with EPERM.
    Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    5bdc1623
Name
Last commit
Last update
Documentation Loading commit data...
contrib Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
lib Loading commit data...
scripts Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Makefile Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...