Re: [RFC] Don't propagate automount

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2019-09-26 at 14:52 -0500, Goldwyn Rodrigues wrote:
> An access to automounted filesystem can deadlock if it is a bind
> mount on shared mounts. A user program should not deadlock the kernel
> while automount waits for propagation of the mount. This is explained
> at https://bugzilla.redhat.com/show_bug.cgi?id=1358887#c10
> I am not sure completely blocking automount is the best solution,
> so please reply with what is the best course of action to do
> in such a situation.
> 
> Propagation of dentry with DCACHE_NEED_AUTOMOUNT can lead to
> propagation of mount points without automount maps and not under
> automount control. So, do not propagate them.

Yes, I'm not sure my comments about mount propagation in that
bug are accurate.

This behaviour has crept into the kernel in reasonably recent
times, maybe it's a bug or maybe mount propagation has been
"fixed", not sure.

I think I'll need to come up with a more detailed description
of what is being done for Al to be able to offer advice.

I'll get to that a bit later.

> 
> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@xxxxxxxx>
> 
> diff --git a/fs/pnode.c b/fs/pnode.c
> index 49f6d7ff2139..b960805d7954 100644
> --- a/fs/pnode.c
> +++ b/fs/pnode.c
> @@ -292,6 +292,9 @@ int propagate_mnt(struct mount *dest_mnt, struct
> mountpoint *dest_mp,
>  	struct mount *m, *n;
>  	int ret = 0;
>  
> +	if (source_mnt->mnt_mountpoint->d_flags &
> DCACHE_NEED_AUTOMOUNT)
> +		return 0;
> +

Possible problem with this is it will probably prevent mount
propagation in both directions which will break stuff.

I had originally assumed the problem was mount propagation
back to the parent mount but now I'm not sure that this is
actually what is meant to happen.

>  	/*
>  	 * we don't want to bother passing tons of arguments to
>  	 * propagate_one(); everything is serialized by namespace_sem,
> 




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux