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:	Wed, 5 Nov 2014 19:46:36 -0800
From:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:	Peter Hurley <peter@...leysoftware.com>
Cc:	Jiri Slaby <jslaby@...e.cz>,
	One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>,
	linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org
Subject: Re: [PATCH -next v2 10/26] tty: Don't take tty_mutex for tty count
 changes

On Wed, Nov 05, 2014 at 09:50:22PM -0500, Peter Hurley wrote:
> On 11/05/2014 09:39 PM, Peter Hurley wrote:
> > On 11/05/2014 09:33 PM, Greg Kroah-Hartman wrote:
> >> On Wed, Nov 05, 2014 at 12:12:53PM -0500, Peter Hurley wrote:
> >>> Holding tty_mutex is no longer required to serialize changes to
> >>> the tty_count or to prevent concurrent opens of closing ttys;
> >>> tty_lock() is sufficient.
> >>>
> >>> Reviewed-by: Alan Cox <alan@...ux.intel.com>
> >>> Signed-off-by: Peter Hurley <peter@...leysoftware.com>
> >>> ---
> >>>  drivers/tty/tty_io.c | 6 ------
> >>>  1 file changed, 6 deletions(-)
> >>>
> >>> diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
> >>> index ea8c6cae8d12..e59de81c39a9 100644
> >>> --- a/drivers/tty/tty_io.c
> >>> +++ b/drivers/tty/tty_io.c
> >>> @@ -1804,10 +1804,6 @@ int tty_release(struct inode *inode, struct file *filp)
> >>>  	 * each iteration we avoid any problems.
> >>>  	 */
> >>>  	while (1) {
> >>> -		/* Guard against races with tty->count changes elsewhere and
> >>> -		   opens on /dev/tty */
> >>> -
> >>> -		mutex_lock(&tty_mutex);
> >>>  		tty_lock_pair(tty, o_tty);
> >>>  		tty_closing = tty->count <= 1;
> >>>  		o_tty_closing = o_tty &&
> >>> @@ -1840,7 +1836,6 @@ int tty_release(struct inode *inode, struct file *filp)
> >>>  		printk(KERN_WARNING "%s: %s: read/write wait queue active!\n",
> >>>  				__func__, tty_name(tty, buf));
> >>>  		tty_unlock_pair(tty, o_tty);
> >>> -		mutex_unlock(&tty_mutex);
> >>>  		schedule();
> >>>  	}
> >>>  
> >>
> >> The code in my tree in this section of tty_release() looks a bit
> >> different, so I had to hand-apply this patch.
> > 
> > Although there's nothing wrong with your version, I'm wondering why this
> > didn't apply cleanly.
> > 
> > While I go look at your tree, can you check that these patches are
> > sitting on top of the earlier two patches you applied to your tty-linus
> > branch; specifically 'tty: Fix high cpu load if tty is unreleasable' and
> > 'tty: Prevent "read/write wait queue active!" log flooding'?
> 
> Yep, that's the problem: your 'tty-testing' branch doesn't have the 3 patches
> from me that you put in your 'tty-linus' branch earlier this evening. Those are:
> 
> serial: Fix divide-by-zero fault in uart_get_divisor()
> tty: Fix high cpu load if tty is unreleasable
> tty: Prevent "read/write wait queue active!" log flooding
> 
> How can I help fix this?

Ah, didn't realize that was the issue, I've merged the branches together
now, so all should be good.

Sorry for the noise,

greg k-h
--
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