From owner-freebsd-current Wed Oct 22 02:12:27 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id CAA18563 for current-outgoing; Wed, 22 Oct 1997 02:12:27 -0700 (PDT) (envelope-from owner-freebsd-current) Received: from salmon.maths.tcd.ie (mmdf@salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id CAA18555; Wed, 22 Oct 1997 02:12:24 -0700 (PDT) (envelope-from dwmalone@maths.tcd.ie) Received: from graves.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id aa03556; 22 Oct 97 10:08 +0100 To: Bruce Evans cc: current@freebsd.org, freebsd-stable@freebsd.org Subject: Recursive mount [ was Re: -STABLE reboots ] In-reply-to: Your message of "Wed, 22 Oct 1997 10:37:46 +1000." <199710220037.KAA17789@godzilla.zeta.org.au> Date: Wed, 22 Oct 1997 10:08:11 +0100 From: David Malone Message-ID: <9710221008.aa03556@salmon.maths.tcd.ie> Sender: owner-freebsd-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > This is an old problem. `mount -t any /foo /foo' always panics. Fix: > don't do that. However, since mount_msdos is setuid root, anyone can > do that using any = msdos. Fix in 2.2: mount_msdos should not be > setuid root. I thought about tring to rewrite the mount code for the various filesystems to ask for a recursive lock, and then compare the mount point and "device", but that would require me to learn quite a bit about VFS. > The problem is more serious in -current, since mount(2) is unprivileged, > so even `mount /foo /foo' panics (if the mounter is root or owns /foo). Could someone add a sysctl to current that makes mount a privilaged syscall? David.