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]
Message-ID: <alpine.LFD.2.00.0912120920190.3526@localhost.localdomain>
Date:	Sat, 12 Dec 2009 09:26:11 -0800 (PST)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
cc:	Ingo Molnar <mingo@...e.hu>, Greg KH <gregkh@...e.de>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	linux-kernel@...r.kernel.org
Subject: Re: [GIT PATCH] TTY patches for 2.6.33-git



On Sat, 12 Dec 2009, Linus Torvalds wrote:
> > 
> > I'm surprised that lockdep didn't notice that ab/ba I thought I saw. 
> > Maybe the do_tty_hangup()->tty_fasync() never happens.
> 
> The kernel lock cannot have any ABBA deadlocks.
> 
> If somebody blocks on another lock (after getting the kernel lock), the 
> kernel lock will be dropped. So no ABBA.

Oh, but it turns out that while there cannot be any ABBA deadlocks with 
sleeping locks, what the tty code does is invalid for _another_ reason: 
file_list_lock() is a spinlock. And that's a no-no.

You cannot take the kernel lock inside a spinlock. Ordering doesn't 
matter, there's no ABBA issues - it's simply invalid _regardless_ of any 
other use of that lock. 

I think we could possibly add a "__might_sleep()" to _lock_kernel(). It 
doesn't really sleep, but it's invalid to take the kernel lock in an 
atomic region, so __might_sleep() might be the right thing anyway.

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