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: <4998E276.9010009@cn.fujitsu.com>
Date:	Mon, 16 Feb 2009 11:50:14 +0800
From:	Wang Chen <wangchen@...fujitsu.com>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
CC:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Kernel Testers List <kernel-testers@...r.kernel.org>,
	Eric Anholt <eric@...olt.net>, Dave Airlie <airlied@...hat.com>
Subject: Re: [Bug #12419] possible circular locking dependency on i915 dma

Rafael J. Wysocki said the following on 2009-2-15 4:38:
> This message has been generated automatically as a part of a report
> of recent regressions.
> 
> The following bug entry is on the current list of known regressions
> from 2.6.28.  Please verify if it still should be listed and let me know
> (either way).
> 
> 
> Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=12419
> Subject		: possible circular locking dependency on i915 dma
> Submitter	: Wang Chen <wangchen@...fujitsu.com>
> Date		: 2009-01-08 14:11 (38 days old)
> References	: http://marc.info/?l=linux-kernel&m=123142399720125&w=4
> 
> 

Yes. It's still there in mainline.
I think the commit 546b0974c39657017407c86fe79811100b60700d
"i915: Use struct_mutex to protect ring in GEM mode." brought this regression.

The lockdep problem is as following:
thread-1
i915_cmdbuffer()
      |
      ---> lock(drm_device->struct_mutex)
                   |
		   V
	i915_dispatch_cmdbuffer()
		   |
		   ---->i915_emit_box()
                             |
                             ----->copy_from_user()
					|
					-----might_fault()
						|
						--->lock(mm->mmap_sem)

thread-2
dup_mm()
   |
   --->lock(mm->mmap_sem)
           |
	   V
	drm_vm_open()
	   |
	   -------> lock(drm_device->struct_mutex)

The different order to lock "mmap_sem" and "drm_dev->struct_mutex" introduces the problem.
But it seems no way to reverse the lock order in i915.
So how about refine the lock granularity of drm_dev->struct_mutex and exclude the mmap_sem
lock/unlock out of the drm_dev->struct_mutex lock/unlock range?

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