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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-ce677831a4abd0f9f957c90ac6f6a0d0472bafb4@git.kernel.org>
Date:	Thu, 16 Dec 2010 10:42:45 GMT
From:	tip-bot for Dan Carpenter <error27@...il.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
	a.p.zijlstra@...llo.nl, error27@...il.com, tglx@...utronix.de,
	mingo@...e.hu
Subject: [tip:perf/urgent] perf: Fix off by one in perf_swevent_init()

Commit-ID:  ce677831a4abd0f9f957c90ac6f6a0d0472bafb4
Gitweb:     http://git.kernel.org/tip/ce677831a4abd0f9f957c90ac6f6a0d0472bafb4
Author:     Dan Carpenter <error27@...il.com>
AuthorDate: Sun, 24 Oct 2010 21:50:42 +0200
Committer:  Ingo Molnar <mingo@...e.hu>
CommitDate: Thu, 16 Dec 2010 11:14:31 +0100

perf: Fix off by one in perf_swevent_init()

The perf_swevent_enabled[] array has PERF_COUNT_SW_MAX elements.

Signed-off-by: Dan Carpenter <error27@...il.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
LKML-Reference: <20101024195041.GT5985@...ker>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
 kernel/perf_event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 7b87017..2870fee 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -4719,7 +4719,7 @@ static int perf_swevent_init(struct perf_event *event)
 		break;
 	}
 
-	if (event_id > PERF_COUNT_SW_MAX)
+	if (event_id >= PERF_COUNT_SW_MAX)
 		return -ENOENT;
 
 	if (!event->parent) {
--
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