From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: [RFC] deadlock in "drm/exynos: fix wrong pointer access at vm close" Date: Sun, 22 Sep 2013 22:29:11 +0100 Message-ID: <20130922212911.GU13318@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [195.92.253.2]) by gabe.freedesktop.org (Postfix) with ESMTP id B8DD5E612E for ; Sun, 22 Sep 2013 15:30:44 -0700 (PDT) Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: YoungJun Cho Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org 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 shares the same opened file (e.g. inherited over fork()) and does mmap() just as we have ->f_op switched?