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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 29 May 2014 14:07:34 +0200
From:	Miklos Szeredi <miklos@...redi.hu>
To:	David Howells <dhowells@...hat.com>
Cc:	viro@...IV.linux.org.uk, torvalds@...ux-foundation.org,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	hch@...radead.org, akpm@...ux-foundation.org, apw@...onical.com,
	nbd@...nwrt.org, neilb@...e.de, jordipujolp@...il.com,
	ezk@....cs.sunysb.edu, sedat.dilek@...il.com,
	hooanon05@...oo.co.jp, mszeredi@...e.cz
Subject: Re: Kernel errors with overlay filesystem v22

On Thu, May 29, 2014 at 12:28:45PM +0100, David Howells wrote:
> 
> This sequence of commands produces both errors:
> 
>  mount -t tmpfs lower_layer /lower
>  mount -t tmpfs upper_layer /upper
>  mkdir /upper/upper
>  mkdir /upper/work
>  mount -t overlayfs overlayfs /mnt -olowerdir=/lower,upperdir=/upper/upper,workdir=/upper/work
>  # The lockdep error was reported in the above mount command

The lockdep error is due to lazyness on my part and trying to hold
mnt_want_write() on upper for the lifetime of the overlay.  That doesn't work
well with the freeze protection part (sb_start_write()) because then upper can't
be frozen while the overlay is mounted, which is not what we want, I think.

So I'll just have to bite the bullet and add those mnt_want_write/mnt_end_write
to those vfs_* calls that need it.

>  umount /mnt
>  umount /upper
>  # The dentry leak error was reported in the last umount command

Okay, this was just sloppy testing of the workdir thing that was added to this
version.  Below patch fixes it.

Thanks,
Miklos


diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 04879abbbf98..3e2cbbce69e1 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -381,6 +381,7 @@ static void ovl_put_super(struct super_block *sb)
 	if (!(sb->s_flags & MS_RDONLY))
 		mnt_drop_write(ufs->upper_mnt);
 
+	dput(ufs->workdir);
 	mntput(ufs->upper_mnt);
 	mntput(ufs->lower_mnt);
 
@@ -706,7 +707,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
 
 	mntput(upperpath.mnt);
 	mntput(lowerpath.mnt);
-	mntput(workpath.mnt);
+	path_put(&workpath);
 
 	oe->__upperdentry = dget(upperpath.dentry);
 	oe->lowerdentry = lowerpath.dentry;
--
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