Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2519610rdb; Tue, 12 Sep 2023 04:44:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/OgbnOsJSSIboo+aHf75jXAMD5v/ndPDeONhmMqQulcIilfGHQMDofTUokn3nuatyzzE2 X-Received: by 2002:a05:6a00:b50:b0:68e:27b6:c2a0 with SMTP id p16-20020a056a000b5000b0068e27b6c2a0mr15390638pfo.29.1694519069774; Tue, 12 Sep 2023 04:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694519069; cv=none; d=google.com; s=arc-20160816; b=R9keSowpTyCjDLT/9zNbbCF0KHJH8vdnzRavMxHckXyL16AEQ9D2Mfu1B3izR0c1+1 ixor7pPa4ivKrfll0WeZ7LJ5aqrD1CQ4KMDoBYwrMWfVg+mz3o4M5Y6uH5IvWN6V8NJC 0UBMZOLCNPfwPD35hsZmekiNNNuzxdm4oRTxv8azqqyqGqMDIpma2ty8crBOiBNGxBSg oJ8Ck+tXTQdmAZQ9+cITHmzbN8laknFvI6YsyNEpTBebvjafmWperTutKm/Q4gpAsGu6 gptnpxkIxFRMM2OlTbxZUg7lr96GHzaZWG2bCmLJWUcbX05xNpfX8BB+U21uOSKRgC+s PeeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:subject:cc:to:from :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=G6tVIRokXJPGvWKTOTzEY6bZMaPMLiU8C0XfnDPSZEo=; fh=byEzJYWbQjHxKRx8T2S7Wg86xkQSMUBoNIrh958O07I=; b=icPFHYfDWpPz4yyAfFdHJFIQ6LdA4WKYuRpHCjfGi4+6yHagghuhbpMID2k/IpYWwp R+GLeh4BNODXPEP3ZV6T5j0uYqqoZiNetIWKJTWBWJoDZTWTyn8FsqmqwnC77X995EIf qvMlUpZg5m4Q7t2ADaOlTPRtCcJoXOzAJkGujkgDoRjwWlC4wZ96Q/OckRLNCh8fRQ3+ qXlgn0czpp8Khu+/nk4A9Wd48/GMWT2fEYOLzNhnCbJxaOQuQu1iEcSaksB+OHvSt4X3 iQpen/wFWd+U2giiT9yS4C/8xnT28NP4Evl/DtErieQQRz7XrNnWdreqbfpK0D+OGLp4 5n4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Q70e/AuK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id u10-20020a056a00098a00b0068fb986fcf3si4416736pfg.377.2023.09.12.04.44.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 04:44:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Q70e/AuK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id A1B6A80A9E39; Tue, 12 Sep 2023 03:35:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234115AbjILKfS (ORCPT + 99 others); Tue, 12 Sep 2023 06:35:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234435AbjILKdQ (ORCPT ); Tue, 12 Sep 2023 06:33:16 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB5C1199C; Tue, 12 Sep 2023 03:33:12 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3DE0C433C8; Tue, 12 Sep 2023 10:33:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694514792; bh=G6tVIRokXJPGvWKTOTzEY6bZMaPMLiU8C0XfnDPSZEo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Q70e/AuK1dlDgyzk41Krdj9+9w+iAK60hbwst/thT3/E+V0KBqHGq1bFVgnz1Y5tE BNcZP8gyWxZmWST7xvNT50QLa1ma63GmiAsqDWy8g7fdExd57pqsnNBpEGG5y1CZZ4 2heJ6mtCFwi67ozo4eMk4t6tHr94WJ0+E7dwbUXTNqGn7j9LaJoii57znlFVGsSLTr CalxdbClCdh/LrVxIBFE7zWni43Mp/BcEIcZiCJ88jtqnZd7S+8SJsueC3Lp4b40+d +fJZjQLcQazODhw0TaBJUbAqaBJzs0VoOyrGVHiL5tqKRbPbbB7mhVtMICse6Raz7p hKI6oYLR2eDCg== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 12 Sep 2023 13:33:07 +0300 Message-Id: From: "Jarkko Sakkinen" To: "Jan Hendrik Farr" , Cc: , , , , , , , , , , "Luca Boccassi" Subject: Re: [PATCH 0/1] x86/kexec: UKI support X-Mailer: aerc 0.14.0 References: <20230909161851.223627-1-kernel@jfarr.cc> <1d974586-1bf7-42e8-9dae-e5e41a3dbc9f@app.fastmail.com> In-Reply-To: <1d974586-1bf7-42e8-9dae-e5e41a3dbc9f@app.fastmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 12 Sep 2023 03:35:32 -0700 (PDT) X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email On Tue Sep 12, 2023 at 1:54 AM EEST, Jan Hendrik Farr wrote: > > What the heck is UKI? > > UKI (Unified Kernel Image) is the kernel image + initrd + cmdline (+ > some other optional stuff) all packaged up together as one EFI > application. > > This EFI application can then be launched directly by the UEFI without > the need for any additional stuff (or by systemd-boot). It's all self > contained. One benefit is that this is a convenient way to distribute > kernels all in one file. Another benefit is that the whole combination > of kernel image, initrd, and cmdline can all be signed together so > only that particular combination can be executed if you are using > secure boot. Is this also for generic purpose distributions? I mean it is not uncommon having to tweak the command-line in a workstation. > The format itself is rather simple. It's just a PE file (as required > by the UEFI spec) that contains a small stub application in the .text, > .data, etc sections that is responsible for invoking the contained > kernel and initrd with the contained cmdline. The kernel image is > placed into a .kernel section, the initrd into a .initrd section, and > the cmdline into a .cmdline section in the PE executable. How does this interact with the existing EFI stub support in linux? > If we want to kexec a UKI we could obviously just have userspace pick > it apart and kexec it like normal. However in lockdown mode this will > only work if you sign the kernel image that is contained inside the > UKI. The problem with that is that anybody can then grab that signed > kernel and launch it with any initrd or cmdline. So instead this patch > makes the kernel do the work instead. The kernel verifies the > signature on the entire UKI and then passes its components on to the > normal kexec bzimage loader. > > Useful Links: > UKI format documentation: https://uapi-group.org/specifications/specs/uni= fied_kernel_image/ > Arch wiki: https://wiki.archlinux.org/title/Unified_kernel_image > Fedora UKI support: https://fedoraproject.org/wiki/Changes/Unified_Kernel= _Support_Phase_1 BR, Jarkko