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>] [day] [month] [year] [list]
Date:   Wed, 13 Jun 2018 23:24:21 -0700
From:   tip-bot for Jiri Olsa <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     jolsa@...hat.com, linux-kernel@...r.kernel.org, jolsa@...nel.org,
        tglx@...utronix.de, acme@...hat.com, hpa@...or.com,
        yao.jin@...ux.intel.com, acme@...nel.org, mingo@...nel.org
Subject: [tip:perf/urgent] perf c2c: Keep struct hist_entry at the end of
 struct c2c_hist_entry

Commit-ID:  4c8205273626f27b9e5a64bdc194ab483a8cce66
Gitweb:     https://git.kernel.org/tip/4c8205273626f27b9e5a64bdc194ab483a8cce66
Author:     Jiri Olsa <jolsa@...hat.com>
AuthorDate: Fri, 8 Jun 2018 02:22:11 +0200
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Fri, 8 Jun 2018 13:35:53 -0300

perf c2c: Keep struct hist_entry at the end of struct c2c_hist_entry

Exactly as the comment just before 'struct c2c_hist_entry" says, i.e.
the last entry in struct hist_entry is a zero length array, that when
allocating space for hist_entry gets extra space if callchains are in
use, which, if hist_entry is not at the end of c2c_hist_entry, the
members after it gets corrupted when callchains get added to the rb
trees collecting them, etc.

Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Reported-by: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Jin Yao <yao.jin@...ux.intel.com>
Fixes: 7f834c2e84bb ("perf c2c report: Display node for cacheline address")
Link: http://lkml.kernel.org/n/tip-bh0ke4fh2ygpj3yowna7o1di@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/builtin-c2c.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 307b3594525f..6a8738f7ead3 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -56,16 +56,16 @@ struct c2c_hist_entry {
 
 	struct compute_stats	 cstats;
 
+	unsigned long		 paddr;
+	unsigned long		 paddr_cnt;
+	bool			 paddr_zero;
+	char			*nodestr;
+
 	/*
 	 * must be at the end,
 	 * because of its callchain dynamic entry
 	 */
 	struct hist_entry	he;
-
-	unsigned long		 paddr;
-	unsigned long		 paddr_cnt;
-	bool			 paddr_zero;
-	char			*nodestr;
 };
 
 static char const *coalesce_default = "pid,iaddr";

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ