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:	Tue, 05 Mar 2013 22:56:57 +0100
From:	Jiri Slaby <jslaby@...e.cz>
To:	Peter Hurley <peter@...leysoftware.com>
CC:	jhovold@...il.com, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Alan Stern <stern@...land.harvard.edu>,
	USB list <linux-usb@...r.kernel.org>,
	linux-serial@...r.kernel.org, Alan Cox <alan@...rguk.ukuu.org.uk>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [Fwd: [PATCH v2 0/4] TTY: port hangup and close fixes]

On 03/05/2013 06:06 PM, Peter Hurley wrote:
>>> @@ -225,15 +232,13 @@ void tty_port_hangup(struct tty_port *port)
>>         spin_lock_irqsave(&port->lock, flags);
>>         port->count = 0;
>>         port->flags &= ~ASYNC_NORMAL_ACTIVE;
>> -       if (port->tty) {
>> +       if (port->tty)
>>                 set_bit(TTY_IO_ERROR, &port->tty->flags);
>> -               tty_kref_put(port->tty);
>> -       }
>> -       port->tty = NULL;
>>         spin_unlock_irqrestore(&port->lock, flags);
>>> +       tty_port_shutdown(port, port->tty);
>>
>> What prevents port->tty to be NULL here already?
> 
> Nothing. That's why it's tested in tty_port_shutdown() above.

I know :). But the question is rather don't we want to pass the real
refcounted port->tty (take a snapshot inside the lock) instead?

thanks,
-- 
js
suse labs
--
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