Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Dec 2002 08:25:48 -0800
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        phk@freebsd.org
Cc:        "Paul A. Scott" <pscott@skycoast.us>, current@freebsd.org
Subject:   Re: revoke(2) redux...
Message-ID:  <20021224082548.A27172@FreeBSD.org>
In-Reply-To: <1731.1040741036@critter.freebsd.dk>; from phk@freebsd.org on Tue, Dec 24, 2002 at 03:43:56PM %2B0100
References:  <BA2DAFDF.17D6B%pscott@skycoast.us> <1731.1040741036@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
* De: phk@freebsd.org [ Data: 2002-12-24 ]
	[ Subjecte: Re: revoke(2) redux... ]
> revoke is used in most "login daemons", telnetd, getty and elsewhere.
> 
> There is no way you can close the race between:
> 
> 	revoke("/dev/ttyfoo");
> and
> 	open("/dev/ttyfoo");
> 
> Not even in init(8).  There is always the risk that another process
> opens the device between the two.

Don't the chmod hacks performed on TTYs to essentially go from "this is
free" to "this is mine" close that race more or less?  I understand from
watching xpty discussion that if a tty matches certain mode/... requirements
then one should try to chown it and chmod it appropriately to themselves,
and if that fails, go back to looking for one (aquiring a lock on the tty
essentially) then do a revoke on it, because it's now really ours, and then
go on to open it...  Kicking people off only once the open works is an
interesting idea (wrt frevoke), but by then we've already trashed the perms...
I'm not sure whether there's a meaningful race in that (though of course
there are lots of races in that, especially if not appropriately coded)
and how much of a bad window exists wrt revoke/frevoke, and whether it is
really solved by fvrevoke.

juli.
-- 
Juli Mallett <jmallett@FreeBSD.org>
OpenDarwin, Mono, FreeBSD Developer.
ircd-hybrid Developer, EFnet addict.
FreeBSD on MIPS-Anything on FreeBSD.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021224082548.A27172>