Re: [RFC] deadlock in "drm/exynos: fix wrong pointer access at vm close"

2013-09-28 Thread Inki Dae
2013/9/29 Inki Dae > > > 2013/9/26 Al Viro > >> On Wed, Sep 25, 2013 at 01:34:30PM +0900, Inki Dae wrote: >> >> > It seems that we can use a new anon file instead of using drm file to >> > resolve the issue. >> >> Could you describe what are you trying to achieve with that ioctl() and >> what se

Re: [RFC] deadlock in "drm/exynos: fix wrong pointer access at vm close"

2013-09-28 Thread Inki Dae
2013/9/26 Al Viro > On Wed, Sep 25, 2013 at 01:34:30PM +0900, Inki Dae wrote: > > > It seems that we can use a new anon file instead of using drm file to > > resolve the issue. > > Could you describe what are you trying to achieve with that ioctl() and > what semantics do you want from normal mma

Re: [RFC] deadlock in "drm/exynos: fix wrong pointer access at vm close"

2013-09-28 Thread Inki Dae
Thanks for your comments. Thank, Inki Dae 2013/9/26 Al Viro > On Tue, Sep 24, 2013 at 01:41:00PM +0900, Inki Dae wrote: > > > I can't see to hold ->mmap_sem when it calls find_vma() anywhere else. > > Er... What, in your opinion, would protect the result of find_vma(), if > not that? E.g. if

Re: [RFC] deadlock in "drm/exynos: fix wrong pointer access at vm close"

2013-09-26 Thread Al Viro
On Wed, Sep 25, 2013 at 01:34:30PM +0900, Inki Dae wrote: > It seems that we can use a new anon file instead of using drm file to > resolve the issue. Could you describe what are you trying to achieve with that ioctl() and what semantics do you want from normal mmap()? ___

Re: [RFC] deadlock in "drm/exynos: fix wrong pointer access at vm close"

2013-09-26 Thread Al Viro
On Tue, Sep 24, 2013 at 01:41:00PM +0900, Inki Dae wrote: > I can't see to hold ->mmap_sem when it calls find_vma() anywhere else. Er... What, in your opinion, would protect the result of find_vma(), if not that? E.g. if another thread does munmap() on that area... vma isn't refcounted; there

RE: [RFC] deadlock in "drm/exynos: fix wrong pointer access at vm close"

2013-09-24 Thread Inki Dae
> -Original Message- > From: Inki Dae [mailto:inki@samsung.com] > Sent: Tuesday, September 24, 2013 1:41 PM > To: 'Al Viro' > Cc: 'YoungJun Cho'; 'dri-devel@lists.freedesktop.org' > Subject: RE: [RFC] deadlock in "drm/exynos: fi

RE: [RFC] deadlock in "drm/exynos: fix wrong pointer access at vm close"

2013-09-23 Thread Inki Dae
t; Sent: Monday, September 23, 2013 6:29 AM > > > To: YoungJun Cho > > > Cc: dri-devel@lists.freedesktop.org; Inki Dae > > > Subject: [RFC] deadlock in "drm/exynos: fix wrong pointer access at vm > > > close" > > > > > > You have drm_d

Re: [RFC] deadlock in "drm/exynos: fix wrong pointer access at vm close"

2013-09-23 Thread Al Viro
reedesktop.org; Inki Dae > > Subject: [RFC] deadlock in "drm/exynos: fix wrong pointer access at vm > > close" > > > > You have drm_dev->struct_mutex grabbed before ->mmap_sem in > > exynos_drm_gem_mmap_ioctl() and after - in exynos_drm_gem_fault() >

[RFC] deadlock in "drm/exynos: fix wrong pointer access at vm close"

2013-09-23 Thread Al Viro
You have drm_dev->struct_mutex grabbed before ->mmap_sem in exynos_drm_gem_mmap_ioctl() and after - in exynos_drm_gem_fault() (since ->fault() is always called with ->mmap_sem held). Looks like a garden-variety AB-BA deadlock... Incidentally, what should happen if another process

RE: [RFC] deadlock in "drm/exynos: fix wrong pointer access at vm close"

2013-09-23 Thread Inki Dae
Hi, > -Original Message- > From: Al Viro [mailto:v...@ftp.linux.org.uk] On Behalf Of Al Viro > Sent: Monday, September 23, 2013 6:29 AM > To: YoungJun Cho > Cc: dri-devel@lists.freedesktop.org; Inki Dae > Subject: [RFC] deadlock in "drm/exynos: fix wrong point