archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <>
Cc: Greg Kroah-Hartman <>,, "Maciej W. Rozycki" <>,
	Paul Burton <>,
	Alexander Viro <>,
	James Hogan <>,
	Ralf Baechle <>,,,
	Sasha Levin <>
Subject: [PATCH 4.9 073/111] binfmt_elf: Respect error return from `regset->active
Date: Mon, 24 Sep 2018 13:52:40 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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


From: "Maciej W. Rozycki" <>

[ 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 <>
Signed-off-by: Paul Burton <>
Fixes: 4206d3aa1978 ("elf core dump: notes user_regset")
Cc: Alexander Viro <>
Cc: James Hogan <>
Cc: Ralf Baechle <>
Signed-off-by: Sasha Levin <>
Signed-off-by: Greg Kroah-Hartman <>
 fs/binfmt_elf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1706,7 +1706,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);

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

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <>]

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \

* 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 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).