Re: [GIT PULL] Detaching mounts on unlink for 3.15-rc1
From: Al Viro
Date: Tue Apr 08 2014 - 22:31:33 EST
On Tue, Apr 08, 2014 at 05:21:32PM -0700, Eric W. Biederman wrote:
> This set of changes has been reviewed and been sitting idle for the last
> 6 weeks. In that time the vfs has slightly shifted under me the new
> version of rename and the mount hash list becoming a hlist. None of
> those changes has caused changed the code in ways to invalidate these
> changes, but small conflicts do result and I have attached my conflict
> resolution at the end of this email in case it helps.
>
> To recap these changes allow a file or a directory that is a mount point
> in one mount namespace to be unlinked/rmdired elsewhere where it is not
> a mount point (either a remote filesystem or another mount namespace).
> As has been agreed during review semantics when only a single mount
> namespace exists remain unchanged.
>
> This removes a long standing need to lie to the vfs when a mount point
> has been removed behind it's back. This also removes a DOS attack where
> an unprivileged user could prevent root from renaming or deleting files
> and directories by using them as mountpoints in another mount namespace.
>
> This change also fixes a few cases where because we were not lying to
> the vfs we could leak mount points.
>
> When renaming or unlinking directory entries that are not mountpoints
> no additional locks are taken so no performance differences can result,
> and my benchmark reflected that.
It also means that d_invalidate() now might trigger fs shutdown. Which
has bloody huge stack footprint, for obvious reasons. And d_invalidate()
can be called with pretty deep stack - walk into wrong dentry while
resolving a deeply nested symlink and there you go...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/