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: <E1OgxmE-0002x2-QW@pomaz-ex.szeredi.hu>
Date:	Thu, 05 Aug 2010 12:34:18 +0200
From:	Miklos Szeredi <miklos@...redi.hu>
To:	Valerie Aurora <vaurora@...hat.com>
CC:	raven@...maw.net, viro@...iv.linux.org.uk, miklos@...redi.hu,
	jblunck@...e.de, hch@...radead.org, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 21/38] union-mount: Support for mounting union mount file systems

On Wed, 4 Aug 2010, Valerie Aurora wrote:
> I went for MS_WHITEOUT and MS_FALLTHRU, and added the checks for the
> ops being non-null.

This bit me.  Mount failing with EINVAL is a big PITA.

Miklos


Index: linux-2.6/fs/namespace.c
===================================================================
--- linux-2.6.orig/fs/namespace.c	2010-08-05 11:06:56.000000000 +0200
+++ linux-2.6/fs/namespace.c	2010-08-05 11:39:19.000000000 +0200
@@ -1387,6 +1387,7 @@ check_mnt_union(struct path *mntpnt, str
 		return 0;
 
 #ifndef CONFIG_UNION_MOUNT
+	printk(KERN_INFO "union mount: not supported by the kernel\n");
 	return -EINVAL;
 #endif
 	for (p = lower_mnt; p; p = next_mnt(p, lower_mnt)) {
@@ -1396,17 +1397,23 @@ check_mnt_union(struct path *mntpnt, str
 			return -EBUSY;
 	}
 
-	if (!IS_ROOT(mntpnt->dentry))
+	if (!IS_ROOT(mntpnt->dentry)) {
+		printk(KERN_INFO "union mount: not root\n");
 		return -EINVAL;
+	}
 
 	if (mnt_flags & MNT_READONLY)
 		return -EROFS;
 
-	if (!(topmost_mnt->mnt_sb->s_flags & MS_WHITEOUT))
+	if (!(topmost_mnt->mnt_sb->s_flags & MS_WHITEOUT)) {
+		printk(KERN_INFO "union mount: whiteout not supported by fs\n");
 		return -EINVAL;
+	}
 
-	if (!(topmost_mnt->mnt_sb->s_flags & MS_FALLTHRU))
+	if (!(topmost_mnt->mnt_sb->s_flags & MS_FALLTHRU)) {
+		printk(KERN_INFO "union mount: fallthrough not supported by fs\n");
 		return -EINVAL;
+	}
 
 	/* XXX top level mount should only be mounted once */
 
--
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