On Tue, Sep 20, 2011 at 09:46:08PM +0000, Florian Tobias Schandinat wrote:
Hi Andrew,
On 09/20/2011 09:11 PM, akpm@google.com wrote:
quoted
From: Andrea Righi <redacted>
Subject: fb: fix potential deadlock between lock_fb_info and console_lock
fb_set_suspend() must be called with the console semaphore held, which
means the code path coming in here will first take the console_lock() and
then call lock_fb_info().
However several framebuffer ioctl commands acquire these locks in reverse
order (lock_fb_info() and then console_lock()). This gives rise to
potential AB-BA deadlock.
Fix this by changing the order of acquisition in the ioctl commands that
make use of console_lock().
I already have another patch [1] that fixes the same issue in a different way.
It looks less risky than yours and got more feedback.
Best regards,
Florian Tobias Schandinat
[1] http://marc.info/?l=linux-kernel&m0833638508657&w=2
Looks better than my version.
For what it's worth it:
Reviewed-by: Andrea Righi <redacted>
Thanks,
-Andrea