Patch "fs: Fix S_NOSEC handling" has been added to the 4.0-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
fs: Fix S_NOSEC handling
to the 4.0-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
fs-fix-s_nosec-handling.patch
and it can be found in the queue-4.0 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
2426f3910069ed47c0cc58559a6d088af7920201Mon Sep 17 00:00:00 2001
From: Jan Kara <[email protected]>
Date: Thu, 21 May 2015 16:05:52 +0200
Subject: fs: Fix S_NOSEC handling
From: Jan Kara <[email protected]>
commit 2426f3910069ed47c0cc58559a6d088af7920201 upstream.
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.
--- fs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/inode.c +2 -2
@@ -1693,8 +1693,8 @@ int file_remove_suid(struct file *file) error =security_inode_killpriv (dentry);if (!error && killsuid) error =__remove_suid (dentry, killsuid); -if (!error && (inode->i_sb->s_flags &MS_NOSEC )) - inode->i_flags |=S_NOSEC ; +if (!error) +inode_has_no_xattr (inode);return error; }
Patches currently in stable-queue which might be from [email protected] are
queue-4.0/fs-ufs-restore-s_lock-mutex.patch queue-4.0/fs-ufs-revert-ufs-fix-deadlocks-introduced-by-sb-mutex-merge.patch queue-4.0/fs-fix-s_nosec-handling.patch