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, "Maciej W. Rozycki" <macro@mips.com>,
	Paul Burton <paul.burton@mips.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	James Hogan <jhogan@kernel.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	linux-fsdevel@vger.kernel.org, linux-mips@linux-mips.org,
	Sasha Levin <alexander.levin@microsoft.com>
Subject: [PATCH 4.4 47/70] binfmt_elf: Respect error return from `regset->active
Date: Mon, 24 Sep 2018 13:52:46 +0200	[thread overview]
Message-ID: <20180924113105.276328364@linuxfoundation.org> (raw)
In-Reply-To: <20180924113058.420454070@linuxfoundation.org>

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

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

From: "Maciej W. Rozycki" <macro@mips.com>

[ Upstream commit 2f819db565e82e5f73cd42b39925098986693378 ]

The regset API documented in <linux/regset.h> defines -ENODEV as the
result of the `->active' handler to be used where the feature requested
is not available on the hardware found.  However code handling core file
note generation in `fill_thread_core_info' interpretes any non-zero
result from the `->active' handler as the regset requested being active.
Consequently processing continues (and hopefully gracefully fails later
on) rather than being abandoned right away for the regset requested.

Fix the problem then by making the code proceed only if a positive
result is returned from the `->active' handler.

Signed-off-by: Maciej W. Rozycki <macro@mips.com>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Fixes: 4206d3aa1978 ("elf core dump: notes user_regset")
Patchwork: https://patchwork.linux-mips.org/patch/19332/
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/binfmt_elf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1707,7 +1707,7 @@ static int fill_thread_core_info(struct
 		const struct user_regset *regset = &view->regsets[i];
 		do_thread_regset_writeback(t->task, regset);
 		if (regset->core_note_type && regset->get &&
-		    (!regset->active || regset->active(t->task, regset))) {
+		    (!regset->active || regset->active(t->task, regset) > 0)) {
 			int ret;
 			size_t size = regset->n * regset->size;
 			void *data = kmalloc(size, GFP_KERNEL);



  parent reply	other threads:[~2018-09-24 11:56 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-24 11:51 [PATCH 4.4 00/70] 4.4.158-stable review Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 01/70] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 02/70] ALSA: msnd: Fix the default sample sizes Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 03/70] ALSA: usb-audio: Fix multiple definitions in AU0828_DEVICE() macro Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 04/70] xfrm: fix passing zero to ERR_PTR() warning Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 05/70] gfs2: Special-case rindex for gfs2_grow Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 06/70] clk: imx6ul: fix missing of_node_put() Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 07/70] kbuild: add .DELETE_ON_ERROR special target Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 08/70] dmaengine: pl330: fix irq race with terminate_all Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 09/70] MIPS: ath79: fix system restart Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 10/70] media: videobuf2-core: check for q->error in vb2_core_qbuf() Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 11/70] mtd/maps: fix solutionengine.c printk format warnings Greg Kroah-Hartman
2018-09-24 11:52   ` Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 12/70] fbdev: omapfb: off by one in omapfb_register_client() Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 13/70] video: goldfishfb: fix memory leak on driver remove Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 14/70] fbdev/via: fix defined but not used warning Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 15/70] perf powerpc: Fix callchain ip filtering when return address is in a register Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 16/70] fbdev: Distinguish between interlaced and progressive modes Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 17/70] ARM: exynos: Clear global variable on init error path Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 18/70] perf powerpc: Fix callchain ip filtering Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 19/70] powerpc/powernv: opal_put_chars partial write fix Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 20/70] MIPS: jz4740: Bump zload address Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 21/70] mac80211: restrict delayed tailroom needed decrement Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 22/70] xen-netfront: fix queue name setting Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 23/70] arm64: dts: qcom: db410c: Fix Bluetooth LED trigger Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 24/70] s390/qeth: fix race in used-buffer accounting Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 25/70] s390/qeth: reset layer2 attribute on layer switch Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 26/70] platform/x86: toshiba_acpi: Fix defined but not used build warnings Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 27/70] crypto: sharah - Unregister correct algorithms for SAHARA 3 Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 28/70] xen-netfront: fix warn message as irq device name has / Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 29/70] RDMA/cma: Protect cma dev list with lock Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 30/70] pstore: Fix incorrect persistent ram buffer mapping Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 31/70] xen/netfront: fix waiting for xenbus state change Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 32/70] IB/ipoib: Avoid a race condition between start_xmit and cm_rep_handler Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 33/70] Tools: hv: Fix a bug in the key delete code Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 34/70] misc: hmc6352: fix potential Spectre v1 Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 35/70] usb: Dont die twice if PCI xhci host is not responding in resume Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 36/70] USB: Add quirk to support DJI CineSSD Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 37/70] usb: Avoid use-after-free by flushing endpoints early in usb_set_interface() Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 38/70] usb: host: u132-hcd: Fix a sleep-in-atomic-context bug in u132_get_frame() Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 39/70] USB: add quirk for WORLDE Controller KS49 or Prodipe MIDI 49C USB controller Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 40/70] USB: net2280: Fix erroneous synchronization change Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 41/70] USB: serial: io_ti: fix array underflow in completion handler Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 42/70] usb: misc: uss720: Fix two sleep-in-atomic-context bugs Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 43/70] USB: yurex: Fix buffer over-read in yurex_write() Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 44/70] usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt() Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 45/70] cifs: prevent integer overflow in nxt_dir_entry() Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 46/70] CIFS: fix wrapping bugs in num_entries() Greg Kroah-Hartman
2018-09-24 11:52 ` Greg Kroah-Hartman [this message]
2018-09-24 11:52 ` [PATCH 4.4 48/70] audit: fix use-after-free in audit_add_watch Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 49/70] mtdchar: fix overflows in adjustment of `count` Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 50/70] MIPS: loongson64: cs5536: Fix PCI_OHCI_INT_REG reads Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 51/70] ARM: hisi: handle of_iomap and fix missing of_node_put Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 52/70] ARM: hisi: fix error handling and " Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 53/70] ARM: hisi: check of_iomap and fix " Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 54/70] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 55/70] parport: sunbpp: fix error return code Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 56/70] coresight: Handle errors in finding input/output ports Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 57/70] coresight: tpiu: Fix disabling timeouts Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 58/70] gpiolib: Mark gpio_suffixes array with __maybe_unused Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 59/70] drm/amdkfd: Fix error codes in kfd_get_process Greg Kroah-Hartman
2018-09-24 11:52 ` [PATCH 4.4 60/70] rtc: bq4802: add error handling for devm_ioremap Greg Kroah-Hartman
2018-09-24 11:53 ` [PATCH 4.4 61/70] ALSA: pcm: Fix snd_interval_refine first/last with open min/max Greg Kroah-Hartman
2018-09-24 11:53 ` [PATCH 4.4 62/70] selftest: timers: Tweak raw_skew to SKIP when ADJ_OFFSET/other clock adjustments are in progress Greg Kroah-Hartman
2018-09-24 11:53   ` Greg Kroah-Hartman
2018-09-24 11:53   ` gregkh
2018-09-24 11:53 ` [PATCH 4.4 63/70] drm/panel: type promotion bug in s6e8aa0_read_mtp_id() Greg Kroah-Hartman
2018-09-24 11:53 ` [PATCH 4.4 64/70] IB/nes: Fix a compiler warning Greg Kroah-Hartman
2018-09-24 11:53 ` [PATCH 4.4 65/70] pinctrl: qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant Greg Kroah-Hartman
2018-09-24 11:53   ` Greg Kroah-Hartman
2018-09-24 11:53 ` [PATCH 4.4 66/70] USB: serial: ti_usb_3410_5052: fix array underflow in completion handler Greg Kroah-Hartman
2018-09-24 11:53 ` [PATCH 4.4 67/70] mei: bus: type promotion bug in mei_nfc_if_version() Greg Kroah-Hartman
2018-09-24 11:53 ` [PATCH 4.4 68/70] drivers: net: cpsw: fix segfault in case of bad phy-handle Greg Kroah-Hartman
2018-09-24 11:53 ` [PATCH 4.4 69/70] MIPS: VDSO: Match data page cache colouring when D$ aliases Greg Kroah-Hartman
2018-09-24 11:53 ` [PATCH 4.4 70/70] MIPS: VDSO: Drop gic_get_usm_range() usage Greg Kroah-Hartman
2018-09-24 18:06 ` [PATCH 4.4 00/70] 4.4.158-stable review Nathan Chancellor
2018-09-24 21:06 ` Dan Rue
2018-09-24 22:15 ` Shuah Khan
2018-09-25  9:14   ` Greg Kroah-Hartman
2018-09-25  9:08 ` Greg Kroah-Hartman
2018-09-25 20:41 ` 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=20180924113105.276328364@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alexander.levin@microsoft.com \
    --cc=jhogan@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=macro@mips.com \
    --cc=paul.burton@mips.com \
    --cc=ralf@linux-mips.org \
    --cc=stable@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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.