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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150629171900.15730.43569.stgit@buzz>
Date:	Mon, 29 Jun 2015 20:19:00 +0300
From:	Konstantin Khlebnikov <khlebnikov@...dex-team.ru>
To:	linux-fsdevel@...r.kernel.org, Miklos Szeredi <miklos@...redi.hu>,
	linux-kernel@...r.kernel.org,
	Alexander Viro <viro@...iv.linux.org.uk>,
	linux-unionfs@...r.kernel.org
Cc:	linux-security-module@...r.kernel.org
Subject: [PATCH 4/4] ovl: forbid overlayfs on top of overlayfs

Mounting overlayfs using other overlayfs instance as lower or upper
layer triggers false-positive lockdep warning about possible locking
recursion of ->i_mutex in iterate_dir().

Nesting already limited with FILESYSTEM_MAX_STACK_DEPTH = 2 to prevent
kernel stack overflow. Overlayfs supports multiple lower layers thus
the same configuration could be constructed without nesting.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@...dex-team.ru>
---
 fs/overlayfs/super.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index e5db31f78c7d..381af9a5ece9 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -700,10 +700,13 @@ static bool ovl_is_allowed_fs_type(struct dentry *root)
 
 	/*
 	 * We don't support:
+	 *  - overlayfs
 	 *  - automount filesystems
 	 *  - filesystems with revalidate (FIXME for lower layer)
 	 *  - filesystems with case insensitive names
 	 */
+	if (root->d_sb->s_op == &ovl_super_operations)
+		return false;
 	if (dop &&
 	    (dop->d_manage || dop->d_automount ||
 	     dop->d_revalidate || dop->d_weak_revalidate ||

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ