Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73A1D606A31A for ; Tue, 1 Dec 2026 20:04:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=V3nCPpX0; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fgHWMrxv DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=xPffsnctf3J4uBZ52COP3G7j7Buon7F+EpFHTEoedJk=; b=V3nCPpX0uabb1v0PmC3eZUTdux tJfSG4kAW+CNBGKxM2Ytk9I0QNJRbwZMSs1MH9P4L3ajNgDRuDrGp/utNOD8t33vqgpZ2FVNjMmho +Io+YMO4NpMvbL4P9NxEs4lHRZyLaaD7R4vO1ilNJuxWkln10zPxt2FBORteV5JlveUGzIGhYBdW6 vnLh+E3nuh083gk4aETMrtqMT8xNS+WaPWiKO61MnVLXsXKcKdJaGlh8f9miBqC+O45p2QXEZxOl2 +Bw4wSrj9jZcn0QIhELZGI9DcmCA5gPsdbTXdYHmMI9MsuOmSDAZVImlvqgYwD3QG29BnOxW+6K4K +1qzzkYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYU5t-00000009IMy-0n6U; Tue, 01 Dec 2026 20:04:53 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYU5s-00000009IMr-1Ms4 for kexec@lists.infradead.org; Tue, 01 Dec 2026 20:04:52 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 1A8A7410BC; Tue, 1 Dec 2026 20:04:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C44F21F00897; Tue, 1 Dec 2026 20:04:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796155492; bh=xPffsnctf3J4uBZ52COP3G7j7Buon7F+EpFHTEoedJk=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=fgHWMrxvUpOHEFZC1w27Vg72wwcT+Pwfp+Uwb8ZtR98UVgJ4qMFulH6z8U1Go5dt0 9KIwn6mFH1E5m293PMlg7mTgHLTqb3kRy8dCK9yCvWXQGDWwUTblunN22fGXM3Qw19 qqR0FoQZZmjgQORvYr0/xsFG39rRNN3fCK4xTIPhmuiPQ23uycDXsWfvk+b43ZkCfU q1jdWRgUtnY9Z4oszMR9i+Y2xrCkT1qn9xIsKpbreEYjD346HIolqkuMS9sbrE111u GEZ+QWhXoNHnfu4SMwkRwRen+8B9iMjQ4JtMqg8KMB56XRJWzgJcJsC122LxG+onPV SQ/FPERdcceeA== Date: Tue, 1 Dec 2026 20:04:49 +0000 From: Simon Horman To: Bradley Morgan 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 Message-ID: <20261201200449.GC456681@horms.kernel.org> References: <9F5D9F78-0D9E-4BBB-B66A-98C21EF44730@linux.dev> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9F5D9F78-0D9E-4BBB-B66A-98C21EF44730@linux.dev> X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Fri, Nov 27, 2026 at 04:08:47PM +0000, Bradley Morgan wrote: > On 27 November 2026 13:18:57 GMT, Mukesh Pilaniya > 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 > >>> 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 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