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 v...@zeniv.linux.org.uk 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

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

2013-09-28 Thread Inki Dae
2013/9/26 Al Viro v...@zeniv.linux.org.uk 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

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

2013-09-28 Thread Inki Dae
2013/9/29 Inki Dae inki@samsung.com 2013/9/26 Al Viro v...@zeniv.linux.org.uk 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

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-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-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: fix wrong pointer access at vm close Thanks for your comment

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 pointer access at vm close You

[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 Al Viro
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() (since -fault() is always called with -mmap_sem held). Looks like a garden-variety AB-BA deadlock

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

2013-09-23 Thread 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() (since -fault() is always called with -mmap_sem held). Looks like a garden