• Jan Kara's avatar
    fs: Fix S_NOSEC handling · 2426f391
    Jan Kara authored
    file_remove_suid() could mistakenly set S_NOSEC inode bit when root was
    modifying the file. As a result following writes to the file by ordinary
    user would avoid clearing suid or sgid bits.
    
    Fix the bug by checking actual mode bits before setting S_NOSEC.
    
    CC: stable@vger.kernel.org
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    2426f391
inode.c 52 KB