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] [day] [month] [year] [list]
Date:	Wed, 15 Oct 2014 22:25:12 -0700
From:	tip-bot for Alexander Yarygin <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	a.p.zijlstra@...llo.nl, efault@....de, jolsa@...hat.com,
	dsahern@...il.com, yarygin@...ux.vnet.ibm.com, eranian@...gle.com,
	mingo@...nel.org, namhyung.kim@....com, acme@...hat.com,
	paulus@...ba.org, linux-kernel@...r.kernel.org,
	borntraeger@...ibm.com, tglx@...utronix.de, hpa@...or.com,
	fweisbec@...il.com
Subject: [tip:perf/urgent] perf kvm stat live: Enable events copying

Commit-ID:  673d659f5c5918b7ddbafebf1f129c9eb82973b4
Gitweb:     http://git.kernel.org/tip/673d659f5c5918b7ddbafebf1f129c9eb82973b4
Author:     Alexander Yarygin <yarygin@...ux.vnet.ibm.com>
AuthorDate: Fri, 3 Oct 2014 18:40:12 +0400
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Wed, 15 Oct 2014 17:39:03 -0300

perf kvm stat live: Enable events copying

Process of analyzing events caused by 2 functions: mmap_read() and
finished_round().

During mmap_read(), perf receives events from shared memory, queues
their pointers for further processing in finished_round() and notifies
the kernel that the events have been processed.

By the time when finished_round() is invoked, queued events can be
overwritten by the kernel, so the finished_round() occurs on potentially
corrupted memory.

Since there is no place where the event can be safely consumed, let's
copy events when queueing.

Signed-off-by: Alexander Yarygin <yarygin@...ux.vnet.ibm.com>
Cc: Christian Borntraeger <borntraeger@...ibm.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Mike Galbraith <efault@....de>
Cc: Namhyung Kim <namhyung.kim@....com>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Stephane Eranian <eranian@...gle.com>
Link: http://lkml.kernel.org/r/1412347212-28237-3-git-send-email-yarygin@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/builtin-kvm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index ef9fc15..b65eb050 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1358,6 +1358,7 @@ static int kvm_events_live(struct perf_kvm_stat *kvm,
 	}
 	kvm->session->evlist = kvm->evlist;
 	perf_session__set_id_hdr_size(kvm->session);
+	ordered_events__set_copy_on_queue(&kvm->session->ordered_events, true);
 	machine__synthesize_threads(&kvm->session->machines.host, &kvm->opts.target,
 				    kvm->evlist->threads, false);
 	err = kvm_live_open_events(kvm);
--
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