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]
Date:	Wed, 29 Feb 2012 02:13:40 -0800
From:	tip-bot for Jason Baron <jbaron@...hat.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, gleb@...hat.com, hpa@...or.com,
	mingo@...hat.com, jbaron@...hat.com, tglx@...utronix.de,
	mingo@...e.hu
Subject: [tip:perf/core] jump label: Add a WARN()
  if jump label key count goes negative

Commit-ID:  fadf0464b83f91ba021a358c0238a0810c0d2a0b
Gitweb:     http://git.kernel.org/tip/fadf0464b83f91ba021a358c0238a0810c0d2a0b
Author:     Jason Baron <jbaron@...hat.com>
AuthorDate: Tue, 21 Feb 2012 15:02:53 -0500
Committer:  Ingo Molnar <mingo@...e.hu>
CommitDate: Wed, 22 Feb 2012 07:59:39 +0100

jump label: Add a WARN() if jump label key count goes negative

The count on a jump label key should never go negative. Add a
WARN() to check for this condition.

Signed-off-by: Jason Baron <jbaron@...hat.com>
Cc: Gleb Natapov <gleb@...hat.com>
Cc: rostedt@...dmis.org
Cc: mathieu.desnoyers@...icios.com
Cc: davem@...emloft.net
Cc: ddaney.cavm@...il.com
Cc: a.p.zijlstra@...llo.nl
Link: http://lkml.kernel.org/r/3c68556121be4d1920417a3fe367da1ec38246b4.1329851692.git.jbaron@redhat.com
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
 kernel/jump_label.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/kernel/jump_label.c b/kernel/jump_label.c
index 01d3b70..ed9654f 100644
--- a/kernel/jump_label.c
+++ b/kernel/jump_label.c
@@ -76,8 +76,11 @@ EXPORT_SYMBOL_GPL(jump_label_inc);
 static void __jump_label_dec(struct jump_label_key *key,
 		unsigned long rate_limit, struct delayed_work *work)
 {
-	if (!atomic_dec_and_mutex_lock(&key->enabled, &jump_label_mutex))
+	if (!atomic_dec_and_mutex_lock(&key->enabled, &jump_label_mutex)) {
+		WARN(atomic_read(&key->enabled) < 0,
+		     "jump label: negative count!\n");
 		return;
+	}
 
 	if (rate_limit) {
 		atomic_inc(&key->enabled);
--
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