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]
Date:	Wed, 31 Aug 2011 16:43:06 +0200
From:	Jiri Slaby <jirislaby@...il.com>
To:	Alan Cox <alan@...ux.intel.com>
CC:	Jiri Slaby <jslaby@...e.cz>, gregkh@...e.de,
	linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/6] TTY: serial, remove tasklet for tty_wakeup

On 07/19/2011 06:34 PM, Alan Cox wrote:
> On Thu, 14 Jul 2011 14:35:12 +0200
> Jiri Slaby <jslaby@...e.cz> wrote:
> 
>> tty_wakeup can be called from any context. So there is no need to have
>> an extra tasklet for calling that. Hence save some space and remove
>> the tasklet completely.
>>
>> Signed-off-by: Jiri Slaby <jslaby@...e.cz>
>> Cc: Greg Kroah-Hartman <gregkh@...e.de>
>> Cc: Alan Cox <alan@...ux.intel.com>
>> ---
>>  drivers/tty/serial/serial_core.c |   20 +-------------------
>>  include/linux/serial_core.h      |    1 -
>>  2 files changed, 1 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/tty/serial/serial_core.c
>> b/drivers/tty/serial/serial_core.c index 2cbf1bd..4786232 100644
>> --- a/drivers/tty/serial/serial_core.c
>> +++ b/drivers/tty/serial/serial_core.c
>> @@ -72,7 +72,7 @@ void uart_write_wakeup(struct uart_port *port)
>>  	 * closed.  No cookie for you.
>>  	 */
>>  	BUG_ON(!state);
>> -	tasklet_schedule(&state->tlet);
>> +	tty_wakeup(state->port.tty);
> 
> Probably worth noting that this is only safe if the uart locks are held
> and because of the current lock/ref drop combinations in the
> serial_core code otherwise it can race with hangup...

I see this was merged. Since I was not sure this patch is OK after your
comment, I reviewed the code now. It shouldn't be an issue right now,
exactly as you wrote. I.e. the device is stopped, ISR synchronized and
even then ->hangup sets tty to NULL.

I have a patch in my queue which converts all these guys to
tty_port_tty_get. This is needed before I can use tty_port_hangup
obviously. It is because the order there is opposite (set tty to NULL,
then shutdown everybody).

thanks for review,
-- 
js
--
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