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, 30 Dec 2009 13:34:38 -0800
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Borislav Petkov <petkovbb@...glemail.com>,
	David Airlie <airlied@...ux.ie>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Greg KH <greg@...ah.com>, Al Viro <viro@...IV.linux.org.uk>
Subject: Re: drm_vm.c:drm_mmap: possible circular locking dependency detected (was: Re: Linux 2.6.33-rc2 - Merry Christmas ...)

Linus Torvalds <torvalds@...ux-foundation.org> writes:

> We've seen it several times (yes, mostly with drm, but it's been seen with 
> others too), and it's very annoying. It can be fixed by having very 
> careful readdir implementations, but I really would blame sysfs in 
> particular for having a very annoying lock reversal issue when used 
> reasonably.

Maybe.  The mnmap_sem has some interesting issues all of it's own.
What reasonable thing is the drm doing that is causing problems?

> So the optimal situation would be for sysfs to not have that annoying lock 
> dependency, and it would really have to be sysfs_readdir() that drops the 
> sysfs_mutex around the filldir call (and that obviously implies having to 
> re-validate and be really careful).
>
> Added Eric and Greg to the cc, in case the sysfs people want to solve it.

There are scalability reasons for dropping the sysfs_mutex in sysfs_readdir
and I have some tenative patches for that.  I will take a look after I
come back from the holidays, in a couple of days.  I don't understand
the issue as described.

> And yes, one option would be to just fix drm - by avoiding calling any 
> sysfs functions while holding the mmap_lock (either in the mmap callback 
> or the page fault paths). However, as mentioned, I really do think that 
> the blame can be laid on sysfs for trying to be a nice generic interface, 
> but having a damn inconvenient locking model.

Could be.  I have simplified the sysfs locking quite a bit this last
round.  I don't know if there is much more than corner cases left to
improve.

Eric

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