From owner-freebsd-hackers Wed Nov 13 11:38:36 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F9BC37B401 for ; Wed, 13 Nov 2002 11:38:35 -0800 (PST) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id D14B243E4A for ; Wed, 13 Nov 2002 11:38:34 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.5/8.12.5) with ESMTP id gADJcXFC091591; Wed, 13 Nov 2002 11:38:33 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.5/8.12.5/Submit) id gADJcX1X091590; Wed, 13 Nov 2002 11:38:33 -0800 (PST) (envelope-from dillon) Date: Wed, 13 Nov 2002 11:38:33 -0800 (PST) From: Matthew Dillon Message-Id: <200211131938.gADJcX1X091590@apollo.backplane.com> To: Poul-Henning Kamp Cc: hackers@FreeBSD.ORG Subject: Re: tty/pty devices not safe in jail? References: <98061.1037215858@critter.freebsd.dk> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG : :In message <200211131927.gADJRxP8085877@apollo.backplane.com>, Matthew Dillon w :rites: :> Hmm. While tracking down a null mount issue I think I might have :> come across a potentially serious problem with jail. It seems to :> me that it would be possible for someone inside a jailed environment :> to 'steal' pty's, tty's, or the tty side of a pty that is being :> used from within other jails or by processes outside the jail. Has :> this ever come up before? : :There has always been code in kern/tty_pty.c which makes sure that the :master and slave have the same prison: : : } else if (pti->pt_prison != td->td_ucred->cr_prison) { : return (EBUSY); : : :-- :Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 :phk@FreeBSD.ORG | TCP/IP since RFC 956 Ah, excellent. Is there a limit inside the prison so a jail cannot exhaust all available ptys? -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message