All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] Don't propagate automount
@ 2019-09-26 19:52 Goldwyn Rodrigues
  2019-09-27  1:35 ` Ian Kent
  0 siblings, 1 reply; 19+ messages in thread
From: Goldwyn Rodrigues @ 2019-09-26 19:52 UTC (permalink / raw)
  To: viro; +Cc: autofs, linux-fsdevel

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.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>

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;
+
 	/*
 	 * we don't want to bother passing tons of arguments to
 	 * propagate_one(); everything is serialized by namespace_sem,

-- 
Goldwyn

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2019-10-30 19:29 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-26 19:52 [RFC] Don't propagate automount Goldwyn Rodrigues
2019-09-27  1:35 ` Ian Kent
2019-09-27  7:09   ` Ian Kent
2019-09-27  7:26     ` Ian Kent
2019-09-27  7:41       ` Ian Kent
2019-09-27 10:51         ` Ian Kent
2019-09-27 16:16           ` Goldwyn Rodrigues
2019-09-28  1:47             ` Ian Kent
2019-10-01 19:09               ` Goldwyn Rodrigues
2019-10-02  2:14                 ` Ian Kent
2019-10-28 16:28                   ` Goldwyn Rodrigues
2019-10-28 23:57                     ` Ian Kent
2019-10-29  6:39                       ` Ian Kent
2019-10-29  6:40                         ` Ian Kent
2019-10-29 16:00                         ` Goldwyn Rodrigues
2019-10-30  6:01                           ` Ian Kent
2019-10-30  6:05                             ` Ian Kent
2019-10-30 12:05                           ` Ian Kent
2019-10-30 19:28                             ` Goldwyn Rodrigues

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.