All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Markus Trippelsdorf <markus@trippelsdorf.de>,
	Adrian Hunter <adrian.hunter@intel.com>,
	David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Wang Nan <wangnan0@huawei.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Sasha Levin <alexander.levin@verizon.com>
Subject: [PATCH 4.4 80/91] perf symbols: Robustify reading of build-id from sysfs
Date: Fri,  4 Aug 2017 16:16:16 -0700	[thread overview]
Message-ID: <20170804231600.328837447@linuxfoundation.org> (raw)
In-Reply-To: <20170804231555.678888089@linuxfoundation.org>

4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

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;
 		}

  parent reply	other threads:[~2017-08-04 23:42 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-04 23:14 [PATCH 4.4 00/91] 4.4.80-stable review Greg Kroah-Hartman
2017-08-04 23:14 ` [PATCH 4.4 01/91] af_key: Add lock to key dump Greg Kroah-Hartman
2017-08-04 23:14 ` [PATCH 4.4 02/91] pstore: Make spinlock per zone instead of global Greg Kroah-Hartman
2017-08-04 23:14 ` [PATCH 4.4 03/91] net: reduce skb_warn_bad_offload() noise Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 04/91] powerpc/pseries: Fix of_node_put() underflow during reconfig remove Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 05/91] crypto: authencesn - Fix digest_null crash Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 06/91] md/raid5: add thread_group worker async_tx_issue_pending_all Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 07/91] drm/vmwgfx: Fix gcc-7.1.1 warning Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 08/91] drm/nouveau/bar/gf100: fix access to upper half of BAR2 Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 09/91] KVM: PPC: Book3S HV: Context-switch EBB registers properly Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 10/91] KVM: PPC: Book3S HV: Restore critical SPRs to host values on guest exit Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 11/91] KVM: PPC: Book3S HV: Reload HTM registers explicitly Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 12/91] KVM: PPC: Book3S HV: Save/restore host values of debug registers Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 13/91] Revert "powerpc/numa: Fix percpu allocations to be NUMA aware" Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 14/91] Staging: comedi: comedi_fops: Avoid orphaned proc entry Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 15/91] drm/rcar: Nuke preclose hook Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 16/91] drm: rcar-du: Perform initialization/cleanup at probe/remove time Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 17/91] drm: rcar-du: Simplify and fix probe error handling Greg Kroah-Hartman
2017-08-07 15:17   ` Ben Hutchings
2017-08-08 16:29     ` Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 18/91] perf intel-pt: Fix ip compression Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 19/91] perf intel-pt: Fix last_ip usage Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 20/91] perf intel-pt: Use FUP always when scanning for an IP Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 21/91] perf intel-pt: Ensure never to set last_ip when packet count is zero Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 22/91] xfs: dont BUG() on mixed direct and mapped I/O Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 23/91] nfc: fdp: fix NULL pointer dereference Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 24/91] net: phy: Do not perform software reset for Generic PHY Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 25/91] isdn: Fix a sleep-in-atomic bug Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 26/91] isdn/i4l: fix buffer overflow Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 27/91] ath10k: fix null deref on wmi-tlv when trying spectral scan Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 28/91] wil6210: fix deadlock when using fw_no_recovery option Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 29/91] mailbox: always wait in mbox_send_message for blocking Tx mode Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 30/91] mailbox: skip complete wait event if timer expired Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 31/91] mailbox: handle empty message in tx_tick Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 32/91] mpt3sas: Dont overreach ioc->reply_post[] during initialization Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 33/91] kaweth: fix firmware download Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 34/91] kaweth: fix oops upon failed memory allocation Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 35/91] sched/cgroup: Move sched_online_group() back into css_online() to fix crash Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 36/91] PM / Domains: defer dev_pm_domain_set() until genpd->attach_dev succeeds if present Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 37/91] RDMA/uverbs: Fix the check for port number Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 38/91] libnvdimm, btt: fix btt_rw_page not returning errors Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 39/91] ipmi/watchdog: fix watchdog timeout set on reboot Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 40/91] dentry name snapshots Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 41/91] [media] v4l: s5c73m3: fix negation operator Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 42/91] Make file credentials available to the seqfile interfaces Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 43/91] /proc/iomem: only expose physical resource addresses to privileged users Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 44/91] vlan: Propagate MAC address to VLANs Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 45/91] pstore: Allow prz to control need for locking Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 46/91] pstore: Correctly initialize spinlock and flags Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 47/91] pstore: Use dynamic spinlock initializer Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 48/91] net: skb_needs_check() accepts CHECKSUM_NONE for tx Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 52/91] tpm: fix a kernel memory leak in tpm-sysfs.c Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 53/91] tpm: Replace device number bitmap with IDR Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 54/91] x86/mce/AMD: Make the init code more robust Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 55/91] r8169: add support for RTL8168 series add-on card Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 57/91] ipv6: Should use consistent conditional judgement for ip6 fragment between __ip6_append_data and ip6_finish_output Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 58/91] net/mlx4: Remove BUG_ON from ICM allocation routine Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 59/91] drm/msm: Ensure that the hardware write pointer is valid Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 60/91] drm/msm: Verify that MSM_SUBMIT_BO_FLAGS are set Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 61/91] vfio-pci: use 32-bit comparisons for register address for gcc-4.5 Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 62/91] irqchip/keystone: Fix "scheduling while atomic" on rt Greg Kroah-Hartman
2017-08-04 23:15 ` [PATCH 4.4 63/91] ASoC: tlv320aic3x: Mark the RESET register as volatile Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 64/91] spi: dw: Make debugfs name unique between instances Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 65/91] ASoC: nau8825: fix invalid configuration in Pre-Scalar of FLL Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 66/91] irqchip/mxs: Enable SKIP_SET_WAKE and MASK_ON_SUSPEND Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 67/91] openrisc: Add _text symbol to fix ksym build error Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 68/91] dmaengine: ioatdma: Add Skylake PCI Dev ID Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 69/91] dmaengine: ioatdma: workaround SKX ioatdma version Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 70/91] dmaengine: ti-dma-crossbar: Add some of_node_put() in error path Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 71/91] ARM64: zynqmp: Fix W=1 dtc 1.4 warnings Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 73/91] ARM: s3c2410_defconfig: Fix invalid values for NF_CT_PROTO_* Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 74/91] ACPI / scan: Prefer devices without _HID/_CID for _ADR matching Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 75/91] usb: gadget: Fix copy/pasted error message Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 76/91] Btrfs: adjust outstanding_extents counter properly when dio write is split Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 77/91] tools lib traceevent: Fix prev/next_prio for deadline tasks Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 78/91] xfrm: Dont use sk_family for socket policy lookups Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 79/91] perf tools: Install tools/lib/traceevent plugins with install-bin Greg Kroah-Hartman
2017-08-04 23:16 ` Greg Kroah-Hartman [this message]
2017-08-04 23:16 ` [PATCH 4.4 81/91] video: fbdev: cobalt_lcdfb: Handle return NULL error from devm_ioremap Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 82/91] vfio-pci: Handle error from pci_iomap Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 83/91] arm64: mm: fix show_pte KERN_CONT fallout Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 84/91] nvmem: imx-ocotp: Fix wrong register size Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 85/91] sh_eth: enable RX descriptor word 0 shift on SH7734 Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 86/91] ALSA: usb-audio: test EP_FLAG_RUNNING at urb completion Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 87/91] HID: ignore Petzl USB headlamp Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 88/91] scsi: fnic: Avoid sending reset to firmware when another reset is in progress Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 89/91] scsi: snic: Return error code on memory allocation failure Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 90/91] ASoC: dpcm: Avoid putting stream state to STOP when FE stream is paused Greg Kroah-Hartman
2017-08-04 23:16 ` [PATCH 4.4 91/91] Btrfs: use down_read_nested to make lockdep silent Greg Kroah-Hartman
2017-08-05  1:52 ` [PATCH 4.4 00/91] 4.4.80-stable review Shuah Khan
2017-08-05  6:13 ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170804231600.328837447@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.levin@verizon.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus@trippelsdorf.de \
    --cc=namhyung@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.