Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Bradley Morgan <bradley.morgan@linux.dev>
Cc: mpilaniy@redhat.com, include@grrlz.net,
	kexec@lists.infradead.org, ltao@redhat.com, prudo@redhat.com
Subject: Re: [PATCH kexec-tools] kexec: fix kexec_file_load fallback error handling
Date: Tue, 1 Dec 2026 20:04:49 +0000	[thread overview]
Message-ID: <20261201200449.GC456681@horms.kernel.org> (raw)
In-Reply-To: <9F5D9F78-0D9E-4BBB-B66A-98C21EF44730@linux.dev>

On Fri, Nov 27, 2026 at 04:08:47PM +0000, Bradley Morgan wrote:
> On 27 November 2026 13:18:57 GMT, Mukesh Pilaniya <mpilaniy@redhat.com>
> wrote:
> >Hi Bradley,
> >
> >On 24/08/26 4:33 pm, Mukesh Pilaniya wrote:
> >> Hi Bradley, thanks for review.
> >> 
> >> On 22/08/26 12:44 am, Bradley Morgan wrote:
> >>> On 14 August 2026 08:53:29 BST, Mukesh Pilaniya <mpilaniy@redhat.com>
> >>> wrote:
> >>>> With the default -a (--kexec-syscall-auto) option, kexec-tools first
> >>>> tries kexec_file_load() and falls back to kexec_load() when the
> >syscall
> >>>> is not implemented (ENOSYS) or the kernel does not have a loader for
> >the
> >>>> image format (ENOEXEC/ENOTSUP). [...] Falling back on EINVAL hides the
> >>>> real error, because EINVAL means something went wrong during loading.
> >>>>
> >>>> Remove EINVAL from the fallback path.
> >>>
> >>> Hiding the real error behind a fallback is exactly what makes this one
> >>> hurt to debug, so good direction.
> >>>
> >>>> Several kexec_file_load() image probe functions incorrectly return
> >>>> -EINVAL rather than -ENOEXEC when encountering an unrecognized image
> >>>> format. This kernel patch fixes the issue:
> >>>>
> >https://lore.kernel.org/all/20260813-mpilaniy-v1-1-777d4d0e30f7@redhat.com/
> >>>
> >>> That one is still being reworked, Pratyush just LGTM'd the
> >>> probe_default change a couple days ago and the fix isn't in any tree
> >>> yet. And until it is, the arm64 probe and the riscv image probe still
> >>> return -EINVAL, and that last errno is what kexec_image_probe_default()
> >>> leaks to userspace (I checked the loader lists in the tree). So if this
> >>> lands on tools before the kernel fix lands, an image that used to
> >>> silently fall back to kexec_load() on those arches now just fails with
> >>> EINVAL.
> >>>
> >>> Is the plan to hold this one until the kernel side is in? Because right
> >>> now it looks like it can race ahead of its dependency.
> >>>
> >> Yes, the kernel patch will merge first, then this one. I will follow up
> >> on the same thread once the kernel fix is merged.
> >Both kernel commits (b7c94f4d096 and 2792b4b15f) have been merged
> >upstream from Linux v7.4-rc1 onward, so this change should be good to
> >merge as well.
> 
> 
> Thx!
> 
> 
> Reviewed-by: Bradley Morgan <bradley.morgan@linux.dev>

Likewise, thanks. Applied.

- kexec: fix kexec_file_load fallback error handling
  https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=12469cc6e39d


      reply	other threads:[~2026-12-01 20:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14  7:53 [PATCH] kexec: fix kexec_file_load fallback error handling Mukesh Pilaniya
2026-08-21 19:14 ` Bradley Morgan
2026-08-24 11:03   ` Mukesh Pilaniya
2026-11-27 13:18     ` [PATCH kexec-tools] " Mukesh Pilaniya
2026-11-27 16:08       ` Bradley Morgan
2026-12-01 20:04         ` Simon Horman [this message]

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=20261201200449.GC456681@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=bradley.morgan@linux.dev \
    --cc=include@grrlz.net \
    --cc=kexec@lists.infradead.org \
    --cc=ltao@redhat.com \
    --cc=mpilaniy@redhat.com \
    --cc=prudo@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox