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: <CA+HUmGh_wVpVkvDuS-T8A+HdAC946XWuP7-CxrK+H+JEcJ2cyw@mail.gmail.com>
Date:	Thu, 9 Oct 2014 10:39:39 -0700
From:	Francesco Ruggeri <fruggeri@...sta.com>
To:	Peter Hurley <peter@...leysoftware.com>
Cc:	Francesco Ruggeri <fruggeri@...stanetworks.com>, jslaby@...e.cz,
	Greg Kroah-Hartmann <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org
Subject: Re: [PATCH 1/1] tty: Fix pty master poll() after slave closes

Hi Peter,
thanks for your reply.

>>       poll_wait(file, &tty->read_wait, wait);
>>       poll_wait(file, &tty->write_wait, wait);
>> -     if (input_available_p(tty, 1))
>> -             mask |= POLLIN | POLLRDNORM;
>>       if (tty->packet && tty->link->ctrl_status)
>>               mask |= POLLPRI | POLLIN | POLLRDNORM;
>>       if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
>>               mask |= POLLHUP;
>>       if (tty_hung_up_p(file))
>>               mask |= POLLHUP;
>> +     if (mask & POLLHUP)
>> +             tty_flush_to_ldisc(tty);
>
> This isn't necessary for the tty_hung_up_p() case because, when the
> poll() is woken from hangup, the read buffer has already been flushed (ie.,
> cleared).
>
> Plus, this waits even if input_available_p() would already return true.
>

Let me work on a patch for stable along the lines you suggest.

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