lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101027113152.GA30513@boole.suse.de>
Date:	Wed, 27 Oct 2010 13:31:53 +0200
From:	"Dr. Werner Fink" <werner@...e.de>
To:	Jiri Slaby <jslaby@...e.cz>
Cc:	Al Viro <viro@...IV.linux.org.uk>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	linux-kernel@...r.kernel.org, Alan Cox <alan@...rguk.ukuu.org.uk>
Subject: Re: [PATCH 28/49] tty: Add a new file /proc/tty/consoles

On Wed, Oct 27, 2010 at 11:51:18AM +0200, Jiri Slaby wrote:
> On 10/27/2010 11:27 AM, Dr. Werner Fink wrote:
> > Such a list would be very helpful e.g. to extend sulogin
> > to be able to prompt for maintenance on all terminal lines
> > of the system console after e.g. failed fsck.  Currently
> > only the preferred terminal line is prompted for maintenance.
> 
> I think nobody objects to the /proc/tty/consoles. This is a good thing
> to have. The patch just needs to be fixed (and you already did and sent
> me in private).
> 
> The objections are against the way how you find out the real tty behind
> /dev/console. The method to walk through fd, guessing private_data etc.
> is simply unacceptable.
> 
> Actually couldn't you just use one of:
> 1) ttyprintk driver (well, this will insert mess into klog)
> 2) send the output to all enabled consoles in /proc/tty/consoles
> ?

Hmmm ... I've wonder about the comment on add_preferred_console()
of kernel/printk.c:

 * add_preferred_console - add a device to the list of preferred consoles.
 * @name: device name
 * @idx: device index
 * @options: options for this console
 *
 * The last preferred console added will be used for kernel messages
 * and stdin/out/err for init.  Normally this is used by console_setup
 * above to handle user-supplied console arguments; however it can also
 * be used by arch-specific code either to override the user or more
 * commonly to provide a default console (ie from PROM variables) when
 * the user has not supplied one.

that is that the first line always provides the preferred terminal
line.  In other words the detection stuff is not required as long
as the statement in the comment for add_preferred_console() will
remain now and in future.  Indeed register_console() reorders the
list of console drivers if the preferred terminal line will be
changed and this line is marked with the flag CON_CONSDEV.

Now as stdin/out/err for init resides on the preferred terminal
line this could be OK.  If a program is runniung on /dev/console
then also its stdin is directed to the preferred console line.

Werner

-- 
System V style init programs - http://savannah.nongnu.org/projects/sysvinit/

View attachment "0002-Add-a-new-file-proc-tty-consoles-to-be-able-to.patch" of type "text/x-patch" (7485 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ