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: <E807E903FE6CBE4D95E420FBFCC273B827413C@nasanexd01h.na.qualcomm.com>
Date:	Mon, 18 Feb 2013 12:53:37 +0000
From:	"Bu, Yitian" <ybu@....qualcomm.com>
To:	"tglx@...utronix.de" <tglx@...utronix.de>,
	"a.p.zijlstra@...llo.nl" <a.p.zijlstra@...llo.nl>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"mingo@...nel.org" <mingo@...nel.org>
Subject: [PATCH] Fix rq->lock vs logbuf_lock unlock race

This patch is for kernel V3.7.9

>From 8796f4a2175a323aaa49ea8dd0fe68678dd5dccd Mon Sep 17 00:00:00 2001
From: ybu <ybu@....qualcomm.com>
Date: Mon, 18 Feb 2013 19:52:01 +0800
Subject: [PATCH] Fix rq->lock vs logbuf_lock unlock race

fix up the fallout from commit 07354eb1a74d1 ("locking printk:
Annotate logbuf_lock as raw")
Release console_sem after unlocking the logbuf_lock avoids some lock
inversion troubles between logbuf_lock and rq->lock.

Change-Id: I782c1d16e0e82bd156699f0f205f19781c4819e0
Signed-off-by: ybu <ybu@....qualcomm.com>
---
 kernel/printk.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/printk.c b/kernel/printk.c
index f8e0b5a..3a49454 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1356,9 +1356,9 @@ static int console_trylock_for_printk(unsigned int cpu)
 		}
 	}
 	logbuf_cpu = UINT_MAX;
+	raw_spin_unlock(&logbuf_lock);
 	if (wake)
 		up(&console_sem);
-	raw_spin_unlock(&logbuf_lock);
 	return retval;
 }
 
-- 
1.7.9.5

--
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