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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200811272325.15452.hollisb@us.ibm.com>
Date:	Thu, 27 Nov 2008 23:25:15 -0600
From:	Hollis Blanchard <hollisb@...ibm.com>
To:	Evgeniy Polyakov <zbr@...emap.net>
Cc:	netdev@...r.kernel.org, mpm@...enic.com
Subject: Re: [PATCH 2 of 2] netconsole: add write-only tty driver

On Thursday 27 November 2008 15:47:01 Evgeniy Polyakov wrote:
> Hi.
> 
> Looks good. A short note below.
> 
> On Thu, Nov 27, 2008 at 03:11:02PM -0600, Hollis Blanchard 
(hollisb@...ibm.com) wrote:
> > +static int __init netconsole_tty_init(void)
> > +{
> > +	netconsole_tty_driver = alloc_tty_driver(1);
> > +	if (!netconsole_tty_driver)
> > +		return -ENOMEM;
> > +
> > +	netconsole_tty_driver->owner = THIS_MODULE;
> > +	netconsole_tty_driver->driver_name = "netcon";
> > +	netconsole_tty_driver->name = "netcon";
> > +	netconsole_tty_driver->minor_start = 0;
> > +	netconsole_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM;
> > +	netconsole_tty_driver->init_termios = tty_std_termios;
> > +	netconsole_tty_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | 
HUPCL;
> > +	netconsole_tty_driver->init_termios.c_ispeed = 9600;
> > +	netconsole_tty_driver->init_termios.c_ospeed = 9600;
> > +	netconsole_tty_driver->flags = TTY_DRIVER_REAL_RAW;
> > +	tty_set_operations(netconsole_tty_driver, &netconsole_tty_ops);
> > +
> > +	if (tty_register_driver(netconsole_tty_driver))
> > +		printk(KERN_ERR "Couldn't register netconsole tty driver\n");
> > +
> > +	return 0;
> > +}
> > +device_initcall(netconsole_tty_init);
> 
> Would it be better called from init_netconsole()?

Hmm, I don't remember what the ordering is here. "console_initcall", used with 
most other console-providing drivers, is done before alloc_tty_driver() can 
work. However, since init_netconsole() is a "module_initcall", I guess that 
should work. Well, it must, since init_netconsole() calls kzalloc() already...

-- 
Hollis Blanchard
IBM Linux Technology Center
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ