lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <5278C1DC.9000609@cn.fujitsu.com>
Date:	Tue, 05 Nov 2013 18:01:00 +0800
From:	Gu Zheng <guz.fnst@...fujitsu.com>
To:	jfrederich@...il.com, dsd@...top.org, jon.nettleton@...il.com,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC:	devel@...verdev.osuosl.org, Tomi Valkeinen <tomi.valkeinen@...com>,
	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: [RESEND PATCH 2/2] staging/olpc_docn: reorder the lock sequence to
 avoid potential dead lock

The lock sequence of dcon_blank_fb(fb_info->lock ---> console_lock) is against
with the one of console_callback(console_lock ---> fb_info->lock), it'll
lead to a potential dead lock, so reorder the lock sequence of dcon_blank_fb
to avoid the potential dead lock.

Signed-off-by: Gu Zheng <guz.fnst@...fujitsu.com>
---
 drivers/staging/olpc_dcon/olpc_dcon.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c
index 198595e..9db88d9 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -255,17 +255,19 @@ static bool dcon_blank_fb(struct dcon_priv *dcon, bool blank)
 {
 	int err;
 
+	console_lock();
 	if (!lock_fb_info(dcon->fbinfo)) {
+		console_unlock();
 		dev_err(&dcon->client->dev, "unable to lock framebuffer\n");
 		return false;
 	}
-	console_lock();
+
 	dcon->ignore_fb_events = true;
 	err = fb_blank(dcon->fbinfo,
 			blank ? FB_BLANK_POWERDOWN : FB_BLANK_UNBLANK);
 	dcon->ignore_fb_events = false;
-	console_unlock();
 	unlock_fb_info(dcon->fbinfo);
+	console_unlock();
 
 	if (err) {
 		dev_err(&dcon->client->dev, "couldn't %sblank framebuffer\n",
-- 
1.7.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ