summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/systemtap
diff options
context:
space:
mode:
authorVictor Kamensky via Openembedded-core <openembedded-core@lists.openembedded.org>2018-07-20 20:38:53 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-26 13:16:41 +0100
commite40faa1dcaa715b5450e72088b19af27f3c36a18 (patch)
tree7ce2b7946b048ae9c94f82c119eddbf91bb3860f /meta/recipes-kernel/systemtap
parent941da957f97ded9caee2d5ebb8ecc524498bb792 (diff)
downloadpoky-e40faa1dcaa715b5450e72088b19af27f3c36a18.tar.gz
systemtap: fix unintialized memory accesses in dwflpp::function_entrypc
Observed failure in SystemTap v3.3 unit testing, It was tracked down to unintialized memory access in dwflpp::function_entrypc method. Upstream-Status: Backport (From OE-Core rev: 7e465c75e317718ed81a76a6c3e487668e7db1ab) Signed-off-by: Victor Kamensky <kamensky@cisco.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/systemtap')
-rw-r--r--meta/recipes-kernel/systemtap/systemtap/0001-dwflpp-function_entrypc-avoid-usage-of-uninitialized.patch46
-rw-r--r--meta/recipes-kernel/systemtap/systemtap_git.inc1
2 files changed, 47 insertions, 0 deletions
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-dwflpp-function_entrypc-avoid-usage-of-uninitialized.patch b/meta/recipes-kernel/systemtap/systemtap/0001-dwflpp-function_entrypc-avoid-usage-of-uninitialized.patch
new file mode 100644
index 0000000000..d0082a1094
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/0001-dwflpp-function_entrypc-avoid-usage-of-uninitialized.patch
@@ -0,0 +1,46 @@
1From 8466fca2a074323a235ef38d425f994a2ff7e64f Mon Sep 17 00:00:00 2001
2From: Victor Kamensky <kamensky@cisco.com>
3Date: Mon, 9 Jul 2018 09:31:19 -0700
4Subject: [PATCH] dwflpp::function_entrypc avoid usage of uninitialized memory
5
6Failure on 3.3 release was observed. Failure was elusive and
7disappeared after seemingly random configure option change, or when
8code was compiled with -O1 or -O0 (vs default -O2). Running failing
9test case under valgrind memcheck pointed to couple places where
10'Conditional jump or move depends on uninitialised value(s)' occured.
11
12After addressing these in two places in dwflpp::function_entrypc,
13valgrind memcheck run is clean and original issue got fixed.
14
15Upstream-Status: Backport
16Signed-off-by: Victor Kamensky <kamensky@cisco.com>
17---
18 dwflpp.cxx | 6 +++++-
19 1 file changed, 5 insertions(+), 1 deletion(-)
20
21diff --git a/dwflpp.cxx b/dwflpp.cxx
22index bfbb6b096..2172e705a 100644
23--- a/dwflpp.cxx
24+++ b/dwflpp.cxx
25@@ -2465,13 +2465,17 @@ bool
26 dwflpp::function_entrypc (Dwarf_Addr * addr)
27 {
28 assert (function);
29+
30+ // assign default value
31+ *addr = 0;
32+
33 // PR10574: reject 0, which tends to be eliminated COMDAT
34 if (dwarf_entrypc (function, addr) == 0 && *addr != 0)
35 return true;
36
37 /* Assume the entry pc is the base address, or (if zero)
38 the first address of the ranges covering this DIE. */
39- Dwarf_Addr start, end;
40+ Dwarf_Addr start = 0, end;
41 if (dwarf_ranges (function, 0, addr, &start, &end) >= 0)
42 {
43 if (*addr == 0)
44--
452.17.1
46
diff --git a/meta/recipes-kernel/systemtap/systemtap_git.inc b/meta/recipes-kernel/systemtap/systemtap_git.inc
index a1e05579e6..06924fc240 100644
--- a/meta/recipes-kernel/systemtap/systemtap_git.inc
+++ b/meta/recipes-kernel/systemtap/systemtap_git.inc
@@ -11,6 +11,7 @@ SRC_URI = "git://sourceware.org/git/systemtap.git \
11 file://0001-Do-not-let-configure-write-a-python-location-into-th.patch \ 11 file://0001-Do-not-let-configure-write-a-python-location-into-th.patch \
12 file://0001-Install-python-modules-to-correct-library-dir.patch \ 12 file://0001-Install-python-modules-to-correct-library-dir.patch \
13 file://0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch \ 13 file://0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch \
14 file://0001-dwflpp-function_entrypc-avoid-usage-of-uninitialized.patch \
14 " 15 "
15 16
16COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64|microblazeel|mips).*-linux' 17COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64|microblazeel|mips).*-linux'