From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Righi Subject: Re: [Linux-fbdev-devel] [2.6.29-rc2] fb_mmap: circular locking dependency on hibernation Date: Sat, 31 Jan 2009 19:11:55 +0100 Message-ID: <4984946B.5000205@gmail.com> References: <200901272137.57757.arvidjaar@mail.ru> <200901300716.06137.arvidjaar@mail.ru> <498485E0.4080501@gmail.com> Reply-To: righi.andrea@gmail.com Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Geert Uytterhoeven Cc: Andrey Borzenkov , Linux Frame Buffer Device Development , "Antonino A. Daplas" , linux-pm@lists.linux-foundation.org, Linux Kernel Development On 2009-01-31 18:44, Geert Uytterhoeven wrote: > On Sat, 31 Jan 2009, Andrea Righi wrote: >> On 2009-01-30 05:15, Andrey Borzenkov wrote: >>> On 29 of January 2009 12:10:11 Geert Uytterhoeven wrote: >>>> On Tue, 27 Jan 2009, Andrey Borzenkov wrote: >> fbcon: avoid circular locking dependency between fb_info->lock and mm->mmap_sem >> >> In fbcon notifier the handler for FB_EVENT_SET_CONSOLE_MAP doesn't need >> to hold fb_info->lock. >> >> Simply unlock it before calling set_con2fb_map(), that could try to >> acquire mm->mmap_sem to avoid a circular locking dependency with >> fb_mmap() (that acquires mm->mmap_sem -> fb_info-lock). > > However, set_con2fb_map() accesses the array of fb_info pointers > registered_fb[], which seems to be a bit unsafe now the BKL is no longer held. mmmh.. not sure about that, registered_fb[] was never accessed with fb_info->lock held, see register/unregister_framebuffer(). But maybe this is another issue, and anyway, the array and also num_registered_fb don't seem to be protected at all... -Andrea