From owner-freebsd-arch Sat Sep 14 2:16: 2 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F416D37B413 for ; Sat, 14 Sep 2002 02:15:37 -0700 (PDT) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 90F2C442F3 for ; Sat, 14 Sep 2002 02:07:28 -0700 (PDT) (envelope-from nate@rootlabs.com) Received: (qmail 28630 invoked by uid 1000); 14 Sep 2002 09:07:31 -0000 Date: Sat, 14 Sep 2002 02:07:31 -0700 (PDT) From: Nate Lawson To: Terry Lambert Cc: arch@freebsd.org Subject: Re: PATCH: vnode->v_tag to const char * In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 13 Sep 2002, Nate Lawson wrote: > Sorry, this isn't helpful. See the start of this thread where I am > changing vp->v_tag. Since v_tag is not (and should never have > been) usable as a fs type id, I need something to replace it with to > detect a procfs vnode. Checking for VFCF_SYNTHETIC lumps devfs and > fdescfs in with procfs and thus programs like su no longer work (because > stdin is /dev/tty which is on devfs which, like procfs, has > VFCF_SYNTHETIC set). > > Another possibility I considered was checking for VFCF_SYNTHETIC and vtype > != VCHR (since procfs uses standard VDIR/VREG files). This didn't work > either (I was able to hang the system with "su < /proc/curproc/mem"). The panic is due to a recursive lock and was not added (or fixed) by the v_tag commit. I am testing a local fix for the lock problem and will commit it soon. > I need two things: > 1. To know all the filesystem types that are unsafe for set[ug]id > programs with open descriptors on 0-2. Procfs is one, but there are > probably others. Any fs where the semantics of the fd change across an > exec is suspect. > 2. A way to uniquely identify those fs types via a vnode. > > This may need to be a new flag somewhere (say, struct vfsconf). Pseudofs > already uses PFS_PROCDEP but this never gets propagated to a vnode. > > -Nate I did this by adding VV_PROCDEP to vnode.h and setting it in pseudofs when allocing a new vnode and the client fs (say procfs) has set PFS_PROCDEP. The latter is propagated to children, which works cleanly for the other fs like this (linprocfs). -Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message