]> git.baikalelectronics.ru Git - kernel.git/commit
ovl: fix race in private xattr checks
authorMiklos Szeredi <mszeredi@suse.cz>
Thu, 20 Nov 2014 15:40:00 +0000 (16:40 +0100)
committerMiklos Szeredi <mszeredi@suse.cz>
Thu, 20 Nov 2014 15:40:00 +0000 (16:40 +0100)
commit83fe0460db07561d3cd93de2a55e2ac1bdde1e44
tree53cad82bc4ae05b1d2d21a22a2ccde9658e5c8c7
parentd1f7365c7c0338f26157b0a6828ea5200ccbc993
ovl: fix race in private xattr checks

Xattr operations can race with copy up.  This does not matter as long as
we consistently fiter out "trunsted.overlay.opaque" attribute on upper
directories.

Previously we checked parent against OVL_PATH_MERGE.  This is too general,
and prone to race with copy-up.  I.e. we found the parent to be on the
lower layer but ovl_dentry_real() would return the copied-up dentry,
possibly with the "opaque" attribute.

So instead use ovl_path_real() and decide to filter the attributes based on
the actual type of the dentry we'll use.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
fs/overlayfs/inode.c