]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ovl: handle umask and posix_acl_default correctly on creation
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 1 Sep 2016 09:11:59 +0000 (11:11 +0200)
committerShan Hai <shan.hai@oracle.com>
Fri, 4 Aug 2017 05:55:05 +0000 (13:55 +0800)
commitee73e0d0a6cdc50f00fb9fa3b8f25c23ef95d6d1
treea4658d4ccba9b0277406521a1054b0b3f88a174f
parent8aa846dd789c478d085e531425915a2b8db060ac
ovl: handle umask and posix_acl_default correctly on creation

Setting MS_POSIXACL in sb->s_flags has the side effect of passing mode to
create functions without masking against umask.

Another problem when creating over a whiteout is that the default posix acl
is not inherited from the parent dir (because the real parent dir at the
time of creation is the work directory).

Fix these problems by:

 a) If upper fs does not have MS_POSIXACL, then mask mode with umask.

 b) If creating over a whiteout, call posix_acl_create() to get the
 inherited acls.  After creation (but before moving to the final
 destination) set these acls on the created file.  posix_acl_create() also
 updates the file creation mode as appropriate.

Fixes: 39a25b2b3762 ("ovl: define ->get_acl() for overlay inodes")
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Orabug: 26401569

(backport upstream commit 38b256973ea90fc7c2b7e1b734fa0e8b83538d50)

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