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]
Date:	Mon, 10 Jan 2011 14:30:55 +0100
From:	Rodolfo Giometti <giometti@...eenne.com>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	linux-kernel@...r.kernel.org, Russell Coker <russell@...er.com.au>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Randy Dunlap <randy.dunlap@...cle.com>
Subject: Re: [PATCH 1/1] char nvtty: Network Virtual Terminal support

On Mon, Jan 10, 2011 at 01:13:32PM +0000, Alan Cox wrote:
> > By using these devices and a proper compatible server (not included
> > here but you can use sredird) you can get access to a remote tty
> > device as the tty device itself was conneted with your local host.
> > All data and settings are sent and received through the network.
> 
> And this is still something that should be done in userspace if necessary
> by fixing up the tty layer to support pty/tty pair modem lines and
> termios change reporting, or some kind of *generic* vt that can also
> expose all the config other net protocols might need.

If I well understood the pty/tty pair modem lines they can be used to
send receive serial data but they cannot be used to set the serial
parameters since the slave doesn't send to the master the serial
settings a userland application does on it, doesn't it?

> > +	default:
> > +		tty->termios->c_cflag = B0;
> 
> This btw is wrong - if you don't recognize the baud rate you want to
> force a new one. Also you shouldn't be writing all of c_cflag here just
> the baud bits, also you shouldn't in fact ever be hand mangling the baud
> bits but using the helpers.

Ok.

> 
> > +	}
> > +}
> > +#undef TEST_SET_BAUDRATE
> > +
> > +#define TEST_SET_DATASIZE(b)	case b: tty->termios->c_cflag |= CS ## b ; break
> > +static void nvtty_set_datasize(struct nvtty_serial *info, unsigned int datasize)
> > +{
> > +	struct tty_struct *tty = info->tty;
> > +
> > +	nvtty_dbg(info, "datasize=%d", datasize);
> > +
> > +	tty->termios->c_cflag &= ~CSIZE;
> > +	switch (datasize) {
> > +	TEST_SET_DATASIZE(5);
> > +	TEST_SET_DATASIZE(6);
> > +	TEST_SET_DATASIZE(7);
> > +	TEST_SET_DATASIZE(8);
> > +	default:
> > +		tty->termios->c_cflag = CS5;
> 
> Should be |=

Ok.

> > +static void nvtty_set_parity(struct nvtty_serial *info, unsigned int parity)
> > +{
> > +	struct tty_struct *tty = info->tty;
> > +
> > +	nvtty_dbg(info, "parity=%d", parity);
> > +
> > +	tty->termios->c_cflag &= ~(PARENB | PARODD);
> 
> Needs to consider the CMSPAR bit.

Ok.

I'm going to fix these issues ASAP.

> Otherwise its a very nice implementation of something I don't think we
> should have implemented in the kernel.

Thanks, but I still don't understand how I can set the serial settings
without a specific tty driver and just using the pty/tty pair modem
lines... :'(

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail: giometti@...eenne.com
Linux Device Driver                          giometti@...ux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming                     skype:  rodolfo.giometti
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ