Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Apr 1996 07:13:55 -0400
From:      "Frank E. Terhaar-Yonkers" <fty@mcnc.org>
To:        bde@zeta.org.au, sos@FreeBSD.org
Cc:        current@FreeBSD.org, freebsd-current@FreeBSD.org
Subject:   Re: minor syscons bogon
Message-ID:  <199604251113.HAA02980@robin.mcnc.org.mcnc.org>

next in thread | raw e-mail | index | archive | help
Does anything actually use this kludge?  Like, how would an application
even know that /dev/ttyv[MAXCONS] == /dev/console ?  This is very ugly.

- Frank

 >> >>       if (unit == MAXCONS)
 >> >>         return CONSOLE_TTY;
 >
 >Note that (unit == MAXCONS) case is handled 2 lines after the patched
 >line, and this handling is always a no-op if the patch is applied.  Thus
 >the patch is at best incomplete.
 >
 >There are certainly some bugs here.  If /dev/ttyvn exists for n =
 >MAXCONS, then /dev/ttyvn is more or less an alias for /dev/console.
 >This causes security holes if /dev/ttyvn has weaker ownership or
 >permissions than /dev/console.  Opening and closing /dev/ttyvn messes up
 >last-close stuff for /dev/console (e.g., last-closing /dev/ttyvn nukes
 >the console tty's pgrp and session pointers).
 >
 >The problem is easy to work around: don't create /dev/ttyvn for n =
 >MAXCONS.  I consider requiring this to be acceptable, although the bug
 >is in the kernel.  Root should be very careful about the ownerships,
 >permissions and existence of all devices.  There are many similar kernel
 >bugs, because many drivers don't fully decode the minor number.  E.g.,
 >the vn driver with slices disabled only decodes 5 unit bits, so there
 >are 2^27 aliases for each device, 13 of which are created by `sh MAKEDEV
 >vn0'.
 >
 >Bruce
 >

\\\\////\\\\////\\\\\////\\\\\////\\\\////\\\\////\\\\////\\\\////\\\\////\\\\
Frank Terhaar-Yonkers,  Manager
High Performance Computing and Communications Research
MCNC
PO Box 12889	3021 Cornwallis Road
Research Triangle Park,  North Carolina  27709-2889
fty@mcnc.org   voice (919)248-1417   FAX (919)248-1455

http://www.mcnc.org/hpcc.html



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