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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090511123935.31159.74518.stgit@sofia.in.ibm.com>
Date:	Mon, 11 May 2009 18:09:35 +0530
From:	Gautham R Shenoy <ego@...ibm.com>
To:	Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul E McKenney <paulmck@...ibm.com>,
	Oleg Nesterov <oleg@...sign.ru>
Cc:	linux-kernel@...r.kernel.org
Subject: [RFC/PATCH PATCH 2/6] lockdep: Remove strict read checks.

Read locks would cause IRQ inversion problems only when they're being taken in
a IRQ context. So, except for this case, skip the strict read checks for every
other case.

Signed-off-by: Gautham R Shenoy <ego@...ibm.com>
---

 kernel/lockdep.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 8d3c2b5..597479a 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -1986,8 +1986,6 @@ static int RECLAIM_FS_verbose(struct lock_class *class)
 	return 0;
 }
 
-#define STRICT_READ_CHECKS	1
-
 static int (*state_verbose_f[])(struct lock_class *class) = {
 #define LOCKDEP_STATE(__STATE) \
 	__STATE##_verbose,
@@ -2032,9 +2030,13 @@ mark_lock_irq(struct task_struct *curr, struct held_lock *this,
 	/*
 	 * Validate that the lock dependencies don't have conflicting usage
 	 * states.
+	 *
+	 * Skip the part if it's a read_lock with LOCK_ENABLED_XXX.
+	 * We'll do that check when a write variant of the same lock is taken,
+	 * or we take the read variant of lock in the LOCK_USED_IN_XXX state.
 	 */
-	if ((!read || !dir || STRICT_READ_CHECKS) &&
-			!usage(curr, this, excl_bit, state_name(new_bit & ~1)))
+	if (!(read && dir) && !usage(curr, this, excl_bit,
+					state_name(new_bit & ~1)))
 		return 0;
 
 	/*
@@ -2044,8 +2046,7 @@ mark_lock_irq(struct task_struct *curr, struct held_lock *this,
 		if (!valid_state(curr, this, new_bit, excl_bit + 1))
 			return 0;
 
-		if (STRICT_READ_CHECKS &&
-			!usage(curr, this, excl_bit + 1,
+		if (!usage(curr, this, excl_bit + 1,
 				state_name(new_bit + 1)))
 			return 0;
 	}

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