From owner-svn-src-head@FreeBSD.ORG Sat Dec 19 18:55:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3B1C106566B; Sat, 19 Dec 2009 18:55:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 1A07F8FC13; Sat, 19 Dec 2009 18:55:01 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id nBJIsvbI095505 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 19 Dec 2009 20:54:57 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id nBJIsviu084351; Sat, 19 Dec 2009 20:54:57 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nBJIsvce084350; Sat, 19 Dec 2009 20:54:57 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 19 Dec 2009 20:54:57 +0200 From: Kostik Belousov To: Ed Schouten Message-ID: <20091219185457.GH2170@deviant.kiev.zoral.com.ua> References: <200912191842.nBJIgDgP040506@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lQSB8Tqijvu1+4Ba" Content-Disposition: inline In-Reply-To: <200912191842.nBJIgDgP040506@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200732 - in head/sys: fs/devfs kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 18:55:02 -0000 --lQSB8Tqijvu1+4Ba Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 19, 2009 at 06:42:12PM +0000, Ed Schouten wrote: > Author: ed > Date: Sat Dec 19 18:42:12 2009 > New Revision: 200732 > URL: http://svn.freebsd.org/changeset/base/200732 >=20 > Log: > Let access overriding to TTYs depend on the cdev_priv, not the vnode. > =20 > Basically this commit changes two things, which improves access to TTYs > in exceptional conditions. Basically the problem was that when you ran > jexec(8) to attach to a jail, you couldn't use /dev/tty (well, also the > node of the actual TTY, e.g. /dev/pts/X). This is very inconvenient if > you want to attach to screens quickly, use ssh(1), etc. > =20 > The fixes: > =20 > - Cache the cdev_priv of the controlling TTY in struct session. Change > devfs_access() to compare against the cdev_priv instead of the vnode. > This allows you to bypass UNIX permissions, even across different > mounts of devfs. > =20 > - Extend devfs_prison_check() to unconditionally expose the device node > of the controlling TTY, even if normal prison nesting rules normally > don't allow this. This actually allows you to interact with this > device node. > =20 > To be honest, I'm not really happy with this solution. We now have to > store three pointers to a controlling TTY (s_ttyp, s_ttyvp, s_ttydp). > In an ideal world, we should just get rid of the latter two and only use > s_ttyp, but this makes certian pieces of code very impractical (e.g. > devfs, kern_exit.c). Note that struct devfs_dirent is available as vp->v_data, and devfs_dirent' de_cdp member contains pointer to cdev_priv. I think this would allow to remove s_ttydp. --lQSB8Tqijvu1+4Ba Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkstIYAACgkQC3+MBN1Mb4hR/QCgm8Ov8UdK/Tdm1mSUI0bbDiZD M/QAoLYyMcPUw4NMkDuXze8lMe2FKMQx =gT/U -----END PGP SIGNATURE----- --lQSB8Tqijvu1+4Ba--