]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ovl: fix permission checking for setattr
authorMiklos Szeredi <miklos@szeredi.hu>
Fri, 4 Dec 2015 18:18:48 +0000 (19:18 +0100)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:45:58 +0000 (15:45 -0700)
commite2fac9d64f293a02efced292093a5ac20edf8ad7
tree9069d1876d3a48ca847e39a5d4a1e57e707da723
parent7b2c0031d1752c72bed30a40a5ddd4ad04e7a2e8
ovl: fix permission checking for setattr

Orabug: 23331041

[ Upstream commit acff81ec2c79492b180fade3c2894425cd35a545 ]

[Al Viro] The bug is in being too enthusiastic about optimizing ->setattr()
away - instead of "copy verbatim with metadata" + "chmod/chown/utimes"
(with the former being always safe and the latter failing in case of
insufficient permissions) it tries to combine these two.  Note that copyup
itself will have to do ->setattr() anyway; _that_ is where the elevated
capabilities are right.  Having these two ->setattr() (one to set verbatim
copy of metadata, another to do what overlayfs ->setattr() had been asked
to do in the first place) combined is where it breaks.

Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Cc: <stable@vger.kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit 2cadb57dff500076a87b934cac64bb5a2293b644)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
fs/overlayfs/inode.c