From: Jan Kara Date: Thu, 26 May 2016 15:21:32 +0000 (+0200) Subject: fs: Avoid premature clearing of capabilities X-Git-Tag: v3.2.84~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7230a82ecc91aaf0c62b048afb15f3b8e2d8059f;p=pandora-kernel.git fs: Avoid premature clearing of capabilities commit 030b533c4fd4d2ec3402363323de4bb2983c9cee upstream. Currently, notify_change() clears capabilities or IMA attributes by calling security_inode_killpriv() before calling into ->setattr. Thus it happens before any other permission checks in inode_change_ok() and user is thus allowed to trigger clearing of capabilities or IMA attributes for any file he can look up e.g. by calling chown for that file. This is unexpected and can lead to user DoSing a system. Fix the problem by calling security_inode_killpriv() at the end of inode_change_ok() instead of from notify_change(). At that moment we are sure user has permissions to do the requested change. References: CVE-2015-1350 Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed