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] [day] [month] [year] [list]
Message-ID: <20120328120638.76dd4b73@pyramind.ukuu.org.uk>
Date:	Wed, 28 Mar 2012 12:06:38 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Al Viro <viro@...IV.linux.org.uk>
Cc:	Richard Weinberger <richard@....at>, Jiri Slaby <jslaby@...e.cz>,
	linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
	Jiri Slaby <jirislaby@...il.com>
Subject: Re: TTY: tty_port questions

> 	* TTY layer allocates tty on demand (open() time) and feeds them
> to ->install(), which is where we associate the suckers with tty_port,
> grabbing a reference to the latter and shoving it into ->driver_data (OK,
> it or that to struct it's embedded into - all the same)

Yep - actually we want to get a tty->port pointer so we can clean up some
of the indirection and allow the core code to get at the port directly

> 	* ->open()/->close()/->hungup() simply call tty_port_...()
> [BTW, is there any reason why you do not set ->driver_data to port and
> use container_of() in the places that want other parts of containing

See aboe comment.. that's also the way I've been thinking.

> 	* removal does tty_unregister_device() + prevents ->install() from
> finding it + (under port->mutex) does tty_hangup() on associated tty (if any).
> BTW, I really don't like the look of that place - tty_hangup() is async
> (otherwise it'd deadlock instantly), so what the devil is protecting tty
> from being freed before __tty_hangup() is done with it?  And when should

Nothing. However the locking is unfixable in this area until we've
removed the big tty mutex. It's a known problem. I've killed the big tty
mutex in the console layer this -next so we are inching in the right
direction. Once the BTM has gone we can actually fix the unplug race.

> 	* ->activate() plays strange games with TTY_IO_ERROR; why do we
> bother, seeing that it's under port->mutex and anybody trying to open the
> same tty will wait anyway?

The historic code used to do this and some of our drivers are not fully
converted over so still expect that pattern of behaviour in a few spots.

Alan
--
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