From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:40322 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752066AbdHDWd3 (ORCPT ); Fri, 4 Aug 2017 18:33:29 -0400 Subject: Patch "perf symbols: Robustify reading of build-id from sysfs" has been added to the 4.9-stable tree To: acme@redhat.com, adrian.hunter@intel.com, alexander.levin@verizon.com, dsahern@gmail.com, gregkh@linuxfoundation.org, jolsa@kernel.org, markus@trippelsdorf.de, namhyung@kernel.org, wangnan0@huawei.com Cc: , From: Date: Fri, 04 Aug 2017 15:33:24 -0700 Message-ID: <1501886004214235@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: 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.9-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.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Fri Aug 4 15:30:10 PDT 2017 From: Arnaldo Carvalho de Melo Date: Tue, 3 Jan 2017 15:19:21 -0300 Subject: perf symbols: Robustify reading of build-id from sysfs From: Arnaldo Carvalho de Melo [ 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 Report-Link: http://lkml.kernel.org/r/20161219161821.GA294@x4 Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-ryhgs6a6jxvz207j2636w31c@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- 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 @@ -537,6 +537,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.9/perf-probe-fix-to-get-correct-modname-from-elf-header.patch queue-4.9/perf-tools-install-tools-lib-traceevent-plugins-with-install-bin.patch queue-4.9/perf-symbols-robustify-reading-of-build-id-from-sysfs.patch queue-4.9/tools-lib-traceevent-fix-prev-next_prio-for-deadline-tasks.patch queue-4.9/perf-x86-set-pmu-module-in-intel-pmu-modules.patch