summaryrefslogtreecommitdiffstats
path: root/meta
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:31 +0100
commit7e465c75e317718ed81a76a6c3e487668e7db1ab (patch)
treeb48486dc9add4c95bddbee84a006e3302894d05e /meta
parentd8a60b324c340bf88e2e8650f4771030490709c5 (diff)
downloadopenembedded-core-contrib-7e465c75e317718ed81a76a6c3e487668e7db1ab.tar.gz
openembedded-core-contrib-7e465c75e317718ed81a76a6c3e487668e7db1ab.tar.bz2
openembedded-core-contrib-7e465c75e317718ed81a76a6c3e487668e7db1ab.zip
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 Signed-off-by: Victor Kamensky <kamensky@cisco.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta')
-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 @@
+From 8466fca2a074323a235ef38d425f994a2ff7e64f Mon Sep 17 00:00:00 2001
+From: Victor Kamensky <kamensky@cisco.com>
+Date: Mon, 9 Jul 2018 09:31:19 -0700
+Subject: [PATCH] dwflpp::function_entrypc avoid usage of uninitialized memory
+
+Failure on 3.3 release was observed. Failure was elusive and
+disappeared after seemingly random configure option change, or when
+code was compiled with -O1 or -O0 (vs default -O2). Running failing
+test case under valgrind memcheck pointed to couple places where
+'Conditional jump or move depends on uninitialised value(s)' occured.
+
+After addressing these in two places in dwflpp::function_entrypc,
+valgrind memcheck run is clean and original issue got fixed.
+
+Upstream-Status: Backport
+Signed-off-by: Victor Kamensky <kamensky@cisco.com>
+---
+ dwflpp.cxx | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/dwflpp.cxx b/dwflpp.cxx
+index bfbb6b096..2172e705a 100644
+--- a/dwflpp.cxx
++++ b/dwflpp.cxx
+@@ -2465,13 +2465,17 @@ bool
+ dwflpp::function_entrypc (Dwarf_Addr * addr)
+ {
+ assert (function);
++
++ // assign default value
++ *addr = 0;
++
+ // PR10574: reject 0, which tends to be eliminated COMDAT
+ if (dwarf_entrypc (function, addr) == 0 && *addr != 0)
+ return true;
+
+ /* Assume the entry pc is the base address, or (if zero)
+ the first address of the ranges covering this DIE. */
+- Dwarf_Addr start, end;
++ Dwarf_Addr start = 0, end;
+ if (dwarf_ranges (function, 0, addr, &start, &end) >= 0)
+ {
+ if (*addr == 0)
+--
+2.17.1
+
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 \
file://0001-Do-not-let-configure-write-a-python-location-into-th.patch \
file://0001-Install-python-modules-to-correct-library-dir.patch \
file://0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch \
+ file://0001-dwflpp-function_entrypc-avoid-usage-of-uninitialized.patch \
"
COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64|microblazeel|mips).*-linux'