lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Mon,  3 May 2021 20:42:58 +0200
From:   Vyacheslav Yurkov <Vyacheslav.Yurkov@...ker.com>
To:     Miklos Szeredi <miklos@...redi.hu>, <linux-unionfs@...r.kernel.org>
CC:     <linux-kernel@...r.kernel.org>,
        Amir Goldstein <amir73il@...il.com>,
        Vyacheslav Yurkov <Vyacheslav.Yurkov@...ker.com>
Subject: [PATCH] ovl: do not set overlay.opaque for new directories

This optimization breaks existing use case when a lower layer directory
appears after directory was created on a merged layer. If overlay.opaque
is applied, new files on lower layer are not visible.

Consider the following scenario:
- /lower and /upper are mounted to /merged
- directory /merged/new-dir is created with a file test1
- overlay is unmounted
- directory /lower/new-dir is created with a file test2
- overlay is mounted again

If opaque is applied by default, file test2 is not going to be visible
without explicitly clearing the overlay.opaque attribute

Signed-off-by: Vyacheslav Yurkov <Vyacheslav.Yurkov@...ker.com>
---
 fs/overlayfs/dir.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
index 93efe7048a77..f66f96dd9f0c 100644
--- a/fs/overlayfs/dir.c
+++ b/fs/overlayfs/dir.c
@@ -338,11 +338,6 @@ static int ovl_create_upper(struct dentry *dentry, struct inode *inode,
 	if (IS_ERR(newdentry))
 		goto out_unlock;
 
-	if (ovl_type_merge(dentry->d_parent) && d_is_dir(newdentry)) {
-		/* Setting opaque here is just an optimization, allow to fail */
-		ovl_set_opaque(dentry, newdentry);
-	}
-
 	err = ovl_instantiate(dentry, inode, newdentry, !!attr->hardlink);
 	if (err)
 		goto out_cleanup;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ