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, 23 Aug 2011 20:46:33 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Jiri Slaby <jslaby@...e.cz>
Cc:	gregkh@...e.de, alan@...ux.intel.com,
	Linux kernel mailing list <linux-kernel@...r.kernel.org>
Subject: Re: patch "TTY: remove tty_locked" added to tty tree

On Tuesday 23 August 2011 20:33:38 Jiri Slaby wrote:

> It looks like I need tty_locked to fix system stalls in
> tty_wait_until_sent in the end. Like with the patch attached. But if
> someone finds another way to fix this in short-term, it would be great.
>
> 
> @@ -153,8 +154,14 @@ void tty_wait_until_sent(struct tty_struct *tty, long timeout)
>  #endif
>  	if (!timeout)
>  		timeout = MAX_SCHEDULE_TIMEOUT;
> -	if (wait_event_interruptible_timeout(tty->write_wait,
> -			!tty_chars_in_buffer(tty), timeout) >= 0) {
> +
> +	if (tty_locked()) /* e.g. uart (holds) vs. tty_ioctl (does not) */
> +		retval = wait_event_interruptible_timeout_tty(tty->write_wait,
> +			!tty_chars_in_buffer(tty), timeout);
> +	else
> +		retval = wait_event_interruptible_timeout(tty->write_wait,
> +			!tty_chars_in_buffer(tty), timeout);
> 
> 

According to http://kernelnewbies.org/BigKernelLock, I concluded back then
that tty_wait_until_sent would always be called without BTM held. Has that
changed recently, or did I miss a caller that holds the BTM?

The only caller that used to call it with BKL was tty_set_ldisc, and that
got changed to release the BTM before calling it. If there is another
caller, can it do the same?

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