]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ovl: fix sgid on directory
authorMiklos Szeredi <mszeredi@redhat.com>
Fri, 29 Jul 2016 10:05:23 +0000 (12:05 +0200)
committerShan Hai <shan.hai@oracle.com>
Fri, 4 Aug 2017 05:49:51 +0000 (13:49 +0800)
commit5be3e97db19bc6322135e3761914cdddcc13e801
tree13a0551254bb4b2d4f8e69694e55305b40dc3fc0
parentff88e6226fae9fa43d87569331c72d409da1d98b
ovl: fix sgid on directory

When creating directory in workdir, the group/sgid inheritance from the
parent dir was omitted completely.  Fix this by calling inode_init_owner()
on overlay inode and using the resulting uid/gid/mode to create the file.

Unfortunately the sgid bit can be stripped off due to umask, so need to
reset the mode in this case in workdir before moving the directory in
place.

Reported-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Orabug: 26401569

(backport upstream commit bb0d2b8ad29630b580ac903f989e704e23462357)

Signed-off-by: Shan Hai <shan.hai@oracle.com>
Reviewed-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
fs/overlayfs/dir.c