Bug 11988 - Eliminate recursive mutex in compat fb ioctl path
Eliminate recursive mutex in compat fb ioctl path
Status: CLOSED CODE_FIX
Product: Drivers
Classification: Unclassified
Component: Video(Other)
All Linux
: P1 normal
Assigned To: drivers_video-other
:
Depends on:
Blocks: 11808
  Show dependency treegraph
 
Reported: 2008-11-08 16:08 UTC by Rafael J. Wysocki
Modified: 2008-11-15 03:43 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.28-rc
Tree: Mainline
Regression: Yes


Attachments

Description Rafael J. Wysocki 2008-11-08 16:08:34 UTC
Subject    : Eliminate recursive mutex in compat fb ioctl path
Submitter  : Keith Packard <keithp@keithp.com>
Date       : 2008-11-03 7:06
References : http://marc.info/?l=linux-kernel&m=122569604828448&w=4
Handled-By : Keith Packard <keithp@keithp.com>
Patch      : http://marc.info/?l=linux-kernel&m=122569604828448&w=4
Handled-By : Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Patch      : http://lkml.org/lkml/2008/10/31/162

This entry is being used for tracking a regression from 2.6.27.  Please don't
close it until the problem is fixed in the mainline.
Comment 1 Rafael J. Wysocki 2008-11-15 03:41:22 UTC
On Friday, 14 of November 2008, Geert Uytterhoeven wrote:
> On Sun, 9 Nov 2008, Rafael J. Wysocki wrote:
> > 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.27.  Please verify if it still should be listed and let me know
> > (either way).
> > 
> > 
> > Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=11988
> > Subject		: Eliminate recursive mutex in compat fb ioctl path
> > Submitter	: Keith Packard <keithp@keithp.com>
> > Date		: 2008-11-03 7:06 (7 days old)
> > References	: http://marc.info/?l=linux-kernel&m=122569604828448&w=4
> > Handled-By	: Keith Packard <keithp@keithp.com>
> > 		  Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
> > Patch		: http://marc.info/?l=linux-kernel&m=122569604828448&w=4
> > 		  http://lkml.org/lkml/2008/10/31/162
> 
> Fixed in mainline.
> 
> commit a684e7d33096892093456dd56a582cfc3bfad648
> Author: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
> Date:   Thu Nov 6 12:53:37 2008 -0800
> 
>     fbdev: fix fb_compat_ioctl() deadlocks
> 
>     commit 3e680aae4e53ab54cdbb0c29257dae0cbb158e1c ("fb: convert
>     lock/unlock_kernel() into local fb mutex") introduced several deadlocks
>     in the fb_compat_ioctl() path, as mutex_lock() doesn't allow recursion,
>     unlike lock_kernel().  This broke frame buffer applications on 64-bit
>     systems with a 32-bit userland.
>     
>     commit 120a37470c2831fea49fdebaceb5a7039f700ce6 ("framebuffer compat_ioctl
>     deadlock") fixed one of the deadlocks.
>     
>     This patch fixes the remaining deadlocks:
>       - Revert commit 120a37470c2831fea49fdebaceb5a7039f700ce6,
>       - Extract the core logic of fb_ioctl() into a new function do_fb_ioctl(),
>       - Change all callsites of fb_ioctl() where info->lock is already held to
>         call do_fb_ioctl() instead,
>       - Add sparse annotations to all routines that take info->lock.
>     
>     Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
>     Cc: Mikulas Patocka <mpatocka@redhat.com>
>     Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
>     Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
>     Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>     Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


Note You need to log in before you can comment on or make changes to this bug.