stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "perf symbols: Robustify reading of build-id from sysfs" has been added to the 4.4-stable tree
@ 2017-08-04 22:32 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-08-04 22:32 UTC (permalink / raw)
  To: acme, adrian.hunter, alexander.levin, dsahern, gregkh, jolsa,
	markus, namhyung, wangnan0
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    perf symbols: Robustify reading of build-id from sysfs

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     perf-symbols-robustify-reading-of-build-id-from-sysfs.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Fri Aug  4 15:30:20 PDT 2017
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Tue, 3 Jan 2017 15:19:21 -0300
Subject: perf symbols: Robustify reading of build-id from sysfs

From: Arnaldo Carvalho de Melo <acme@redhat.com>


[ Upstream commit 7934c98a6e04028eb34c1293bfb5a6b0ab630b66 ]

Markus reported that perf segfaults when reading /sys/kernel/notes from
a kernel linked with GNU gold, due to what looks like a gold bug, so do
some bounds checking to avoid crashing in that case.

Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Report-Link: http://lkml.kernel.org/r/20161219161821.GA294@x4
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-ryhgs6a6jxvz207j2636w31c@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 tools/perf/util/symbol-elf.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -488,6 +488,12 @@ int sysfs__read_build_id(const char *fil
 				break;
 		} else {
 			int n = namesz + descsz;
+
+			if (n > (int)sizeof(bf)) {
+				n = sizeof(bf);
+				pr_debug("%s: truncating reading of build id in sysfs file %s: n_namesz=%u, n_descsz=%u.\n",
+					 __func__, filename, nhdr.n_namesz, nhdr.n_descsz);
+			}
 			if (read(fd, bf, n) != n)
 				break;
 		}


Patches currently in stable-queue which might be from acme@redhat.com are

queue-4.4/perf-intel-pt-ensure-never-to-set-last_ip-when-packet-count-is-zero.patch
queue-4.4/perf-intel-pt-use-fup-always-when-scanning-for-an-ip.patch
queue-4.4/perf-intel-pt-fix-last_ip-usage.patch
queue-4.4/perf-tools-install-tools-lib-traceevent-plugins-with-install-bin.patch
queue-4.4/perf-symbols-robustify-reading-of-build-id-from-sysfs.patch
queue-4.4/tools-lib-traceevent-fix-prev-next_prio-for-deadline-tasks.patch
queue-4.4/perf-intel-pt-fix-ip-compression.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-04 22:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-04 22:32 Patch "perf symbols: Robustify reading of build-id from sysfs" has been added to the 4.4-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).