[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-4d439517561d009e170e2fe20be1ba25e19abe75@git.kernel.org>
Date: Wed, 30 Mar 2011 07:17:18 GMT
From: "tip-bot for David S. Miller" <davem@...emloft.net>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, linux-kernel@...r.kernel.org, paulus@...ba.org,
hpa@...or.com, mingo@...hat.com, a.p.zijlstra@...llo.nl,
davem@...emloft.net, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:perf/urgent] perf symbols: Properly align symbol_conf.priv_size
Commit-ID: 4d439517561d009e170e2fe20be1ba25e19abe75
Gitweb: http://git.kernel.org/tip/4d439517561d009e170e2fe20be1ba25e19abe75
Author: David S. Miller <davem@...emloft.net>
AuthorDate: Tue, 29 Mar 2011 14:18:39 -0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 29 Mar 2011 14:18:39 -0300
perf symbols: Properly align symbol_conf.priv_size
If symbol_conf.priv_size is not a multiple of "sizeof(u64)" we'll bus
error on sparc64 in symbol__new because the "struct symbol *" pointer
is computed by adding symbol_conf.priv_size to the memory allocated.
We cannot isolate the fix to symbol__new and symbol__delete since the
private area is computed by subtracting the priv_size value from a
"struct symbol" pointer, so then the private area can still be
potentially unaligned.
So, simply align the symbol_conf.priv_size value in symbol__init()
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
LKML-Reference: <20110328.175849.112593455.davem@...emloft.net>
Signed-off-by: David S. Miller <davem@...emloft.net>
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/symbol.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 8f73907..f06c10f 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -2406,6 +2406,8 @@ int symbol__init(void)
if (symbol_conf.initialized)
return 0;
+ symbol_conf.priv_size = ALIGN(symbol_conf.priv_size, sizeof(u64));
+
elf_version(EV_CURRENT);
if (symbol_conf.sort_by_name)
symbol_conf.priv_size += (sizeof(struct symbol_name_rb_node) -
--
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