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]
Date:	Thu, 29 Aug 2013 05:51:12 +0200
From:	Miklos Szeredi <mszeredi@...e.cz>
To:	Ian Kent <raven@...maw.net>
Cc:	Al Viro <viro@...IV.linux.org.uk>,
	Miklos Szeredi <miklos@...redi.hu>, rwheeler@...hat.com,
	avati@...hat.com, bfoster@...hat.com, dhowells@...hat.com,
	eparis@...hat.com, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	KONISHI Ryusuke <konishi.ryusuke@....ntt.co.jp>
Subject: Re: [PATCH 0/9] [RFC v2] safely drop directory dentry on failed
 revalidate

Ian,

I'm having problems fully understanding what autofs4 is trying to do
with have_submounts().


> On Wed, 2013-08-21 at 06:40 +0100, Al Viro wrote:

> fs/autofs4/dev-ioctl.c:542:             err = have_submounts(path.dentry);

This is an ioctl() asking whether we have anything mounted on the autofs
mount.  Using have_submounts() and then a separate follow_down() looks
racy.  have_submounts() could succeed and then follow_down() could fail.
Or the other way round.  Shouldn't the two cases be handled separately
here?  If the autofs is a just a simple trigger then use follow_down().
If it's a multi-mount thing, then use have_submounts().

What is the userspace automount daemon using this for?  Do we really
need the recursive check for submounts?


> fs/autofs4/root.c:381:                  if (have_submounts(dentry)) {

Here it explicitly says it's for v5 and for rootless mutli-mount.  So
for example:

/mnt/auto/            root of an indirect mount
/mnt/auto/foo         directory with DCACHE_NEED_AUTOMOUNT
/mnt/auto/foo/bar     directory without DCACHE_NEED_AUTOMOUNT
/mnt/auto/foo/bar/baz directory with an automount trigger mounted on it

In this case when d_automount for "foo" is called we don't call the
userspace daemon because things are mounted under foo.  If there was no
trigger under baz, then we would try to handle "foo" as an indirect
mount and call userspace.

But it's pretty confusing.  Do we really *ever* need to call automount
on "foo" if it was part of a multi-mount thing? 

> fs/autofs4/waitq.c:338:         if (have_submounts(dentry))

And here we re-validate the thing after taking another autofs4 lock.
Why this double checking?

Thanks,
Miklos

--
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