From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796381870; b=TaEshScR96h+/GG4I+Xw3LvM7b40bAprIZsRzFSiTUMr681GE/oxE2aeo/COKl851AtO RbFUqh9a7Sxgll0sv/3fHW+DnDiYJ3TE6cPQ9feG30fDXrJzCoXHA88WXi0+RY2wtd8wg KQ6hkqwRGlCW+gwDQ5uocL61vVp7ZG3JbXdje8hL460NoicasD9uFAilHrnGicnhhl3dM A16wbjYHbnAAihtZdI6fOlonpUPdpv4zMbbpA0eth69pDIfSqRuMnqipXDvZ+DMvetiub UszRbFhG54lqAWv6BnZ5P2HvUe0wsUqdMhtbJPku5zENoCHukYUQbBtgkTM9f2PpR0Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381870; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received: X-Received:Received:Content-Type:Mime-Version:Subject:From: In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References: To:X-Mailer; bh=LFCaUqRn+PZax7MsjN0m/hyWUoXwCycy7bIcmoxCkUI=; b=R+1qZgTV2pk/pVLl79J6YVNAvG46PO3cyvsE+6v7USGwwhijGP9h2o1xdCrvoZFdBGNe yzT7MSlEfLyHKWbeGTeb9hyhv1uTy5hpxwndA8L3m6m5DjP/OfStE2HEun6zNp/zHhVCB JpbEPCDo7sLdyzfmqwZ/9hOiVOmk9IvKUlA2wadICcKHjn2LC4qgYQ1XzTHmoKDWEYgTU wExbdlBsNUNxDRL+offgCn822AjyuqYtl+3ux/7Xz/xqcp6krsoOQUgJ1fq17ieLW9KRF 9B7tp+KLeidOjcxcD3PiBBjD00hc30AqWqZXn8g/dRyo+GfhKd1nPA1VDjlcnxjttqQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=KaWKdYi6; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=mBVLW7L7; arc=none smtp.remote-ip=170.10.133.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 F34B7606A335 for ; Fri, 4 Dec 2026 10:57:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F34B7606A335 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=KaWKdYi6; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=mBVLW7L7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796381869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LFCaUqRn+PZax7MsjN0m/hyWUoXwCycy7bIcmoxCkUI=; b=KaWKdYi6/iTINZIuYQi6BJeC4mbK1rE1H1/ZlTJIA2nkpAzAIf9luq4fPOsbIc4xY0FYS0 VNu8MP81Y2t8LeooKDAn17VuPjXFyZX1okf5KoXbEeEWtwCOpgn0ygBJk23EztMHLR9Xac CcatFnJs8N7X9+edau15uUdwt4IYeUU= Received: from mail-dl1-f72.google.com (mail-dl1-f72.google.com [74.125.82.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-588-7XGDYC6ANY-H7b1bcIetQw-1; Fri, 4 Dec 2026 10:57:47 +0000 X-MC-Unique: 7XGDYC6ANY-H7b1bcIetQw-1 X-Mimecast-MFC-AGG-ID: 7XGDYC6ANY-H7b1bcIetQw_1796381866 Received: by mail-dl1-f72.google.com with SMTP id a92af1059eb24-1b5b37993ecso3700773c88.0 for ; Fri, 04 Dec 2026 02:57:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1796381866; x=1796986666; darn=vger.kernel.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:from:to:cc :subject:date:message-id:reply-to:content-type; bh=LFCaUqRn+PZax7MsjN0m/hyWUoXwCycy7bIcmoxCkUI=; b=mBVLW7L7/ng6mCYLY/XLAK+HwEFv+RRitsM+CtVBiW1SWRqDM5kAro3dgWPdPYsoQ+ VHtk+Wmlz2e5faeFp6O09cSw2gNZHrzNSZvFOfDn9YOrWxzU50LvzZW9EeYeujmANuhV ZQ8tP/3pbokDW5xG61IWaNx0NT1jhFaGL6VZRxpSGiuPRLKC0mOH73jDTwv9mmCA8bLA lMhh5WwCRItXjsxnqfEzP0nbnMvGAaNuearzjRO+GG+0NDvYcNgfRDFkMVMTTi6Uerqh iOL8tJwbOmJ2Np+GDAd76/yhgzCStujDocOLniQdNZk5l8s2Fa5TxIPzMkatIkTt1rzE c79w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796381866; x=1796986666; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=LFCaUqRn+PZax7MsjN0m/hyWUoXwCycy7bIcmoxCkUI=; b=OEWLLShI5fc6UiiqiwLY5DoTi/nPAyjVOlz/O7HyLRtHTr2duCbQK/eVcOXmpnISOs PuhxY1o1O3SkLPds+TsbxUilZsEpn3WsFYMfOOS72oqsKd5dLbZ6ILD1AhRtiQpK2K5f KoSstpH7H2iWsFpvU0vcHWbzWKE/Dwi6GZ+eC0LU6qIxt20mFjpCISlaxAqxGtJ2sUZ4 FUqGuWeKn2B/AGidfLenByAmkUyd9JzVpeK/rK9k2Jnc+0RFk37JoRT+eu0uxjDOYpI+ NZZngMso5UHAKP8uNH+jzZyndKGDwwX4qbT+NwUv3wdqNJVXb+0jnzHy+AjJuyYjPSEH 8hHA== X-Forwarded-Encrypted: i=1; AL+hErFzQKw98nYdD9CCLmfpaaSeFmuFnKRNjhohgw5WSQBPaP8o1rwH9175QC43m1UFD6xRY4eghkvqiIFGrpI=@vger.kernel.org X-Gm-Message-State: APuU4Z8ywliX+vQZbrY4IZcvFzw7N8NXb3B/3FPkth7h+k5BY4Mpz/ce VrzLuqo7P7ZfQQqt03y2m8FjknJqM9bSzbrwHpv2+1s33HRWDU1CxwWzmljbDeSB0NGt3uLAG2a 67UQn4WWo7z1btJkB5E7U6gq4Jj/XJCO7ECHS3UCmZ/wgiz7je+ACIIwry8iO+IH2Lw== X-Gm-Gg: AZFdTZeh7fmHPIIZDXIg94DB/OZYID1DxWxnp5cjeuVt5YO5O0QM1bUHlOj61oH+RSn QcZtv7omqx71G4R06SSLmPbqfwAO7k7QRgthWlZIggW2Fn8vEvwE9zXlSo2am6YkZxCOoHfWfXD GvT+7WIUZfYFsy7cqaSFyiI8V//t44NmbPu5Vi4+6B5O+eAL2rGFfuHvxuexO+pwgmklGAB+8p3 iNderiVW2TFuC275W3qQ2VyQTr0o9ReTjBYT2LuH1q7rYZj9Gt9Zi69EdkTBULnPw8O9O2foNG3 MSEgImqYzRrsm18Zv02JX803zZ+2FDO+ds9j1r1x/AjSzOBvGAzrIFTyUQBoM5P2AjCCj0EzJBc MicbTG/YdqPcIPZyBnPyK3jFZ6k5w9ayUo62aFGcDN/Gwv8JI11OUfUrbwkX7OhEKWvlOYB0U+p wo+kQ= X-Received: by 2002:a05:7022:b160:20b0:1ab:aaf3:389d with SMTP id a92af1059eb24-1b5d705507fmr1607449c88.1.1796381865541; Fri, 04 Dec 2026 02:57:45 -0800 (PST) X-Received: by 2002:a05:7022:b160:20b0:1ab:aaf3:389d with SMTP id a92af1059eb24-1b5d705507fmr1607410c88.1.1796381865016; Fri, 04 Dec 2026 02:57:45 -0800 (PST) Received: from smtpclient.apple ([2401:4900:1f29:b56e:4079:c15a:a28d:6bbe]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38751f0f658sm7883578eec.0.2026.12.04.02.57.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Dec 2026 02:57:44 -0800 (PST) Content-Type: text/plain; charset=utf-8 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.700.51.1.4\)) Subject: Re: [PATCHv7 00/13] kexec: Use BPF lskel to enable kexec to load PE format boot image From: MUKESH KUMAR PILANIYA In-Reply-To: <20261020183609.GI3008132@nvidia.com> Date: Fri, 4 Dec 2026 16:27:22 +0530 Cc: Philipp Rudo , Ard Biesheuvel , Pingfan Liu , Mark Rutland , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , Jeremy Linton , Catalin Marinas , Will Deacon , Simon Horman , Gerd Hoffmann , Vitaly Kuznetsov , Viktor Malik , Jan Hendrik Farr , Baoquan He , Andrew Morton , kexec@lists.infradead.org, bpf@vger.kernel.org, systemd-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dave Young Content-Transfer-Encoding: quoted-printable Message-Id: References: <20260322014402.8815-1-piliu@redhat.com> <20261011201325.GA918242@nvidia.com> <722bd9d8-5620-498a-a6c2-d9a1f498e0b7@app.fastmail.com> <20261020194719.4fbd4e4a@rotkaeppchen> <20261020183609.GI3008132@nvidia.com> To: Jason Gunthorpe X-Mailer: Apple Mail (2.3864.700.51.1.4) Hi Ard, Hi Jason, I've been testing and extending your efiloader-kexec branch = (https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=3De= filoader-kexec) and I'm preparing crash/kdump support on top of it. Here's where things = stand in case it=E2=80=99s useful. Your branch's base had drifted behind mainline, so I rebased my local copy of your commits onto current origin/master (3f963696da44). The = three efi:/efi-libstub prep commits that have since merged dropped out on = their own; the remaining six applied with zero conflicts. With that in place, I built the branch unmodified (rustc 1.99) and confirmed all four PE formats load via kexec_file_load(): bare Image, zboot, UKI, and UKI-with-zboot-inside. Each one ran its real EFI stub = and suspended at ExitBootServices(), as expected. Along the way I hit a couple of build issues worth flagging. = PTE_ADDR_HIGH was undeclared on 4K + 48-bit PA in kexec_efi.c; I define it (and its shift) as 0 for <=3D48-bit PA in pgtable-hwdef.h, and the branch now = builds under both PA_BITS_52 and 4K + PA_BITS_48. RESUME_SCTLR_EL2 also still referenced ENDIAN_SET_EL2, which mainline removed in eab76a8e1880, so I dropped it to get things compiling on current mainline. The kdump work is five commits on top of your series: https://github.com/mukeshpilaniya/linux/commits/kexec-efi-kdump/ arm64: kexec_efi: Drop ENDIAN_SET_EL2 from RESUME_SCTLR_EL2 arm64/mm: Define PTE_ADDR_HIGH for <=3D48-bit PA configurations arm64: kexec_efi: Implement crash (kdump) kernel loading arm64: kexec_efi: Support crashkernel=3D,high and CMA for crash = kernels arm64: kexec: Enable the EFI loader for crash kernels The idea is to carve the loader's working region out of crashk_res instead of alloc_contig_pages, and let a crash-specific EFI memory map confine the capture kernel to crashk_res =E2=80=94 the memmap is the = confinement. elfcorehdr is placed in-region and handed over via the cmdline and DT, = and resume just reuses the existing cpu_soft_restart path at panic. On the probe side, crash kernels keep preferring the raw Image loader (cheaper, and it doesn't need EFI), and only fall back to the EFI loader for the PE-only images (UKI, zboot) that the raw loader turns down. I've taken this through a full kdump cycle end to end and get a valid /proc/vmcore for both a bare Image crash kernel (via the raw loader) and = a zboot crash kernel (via the EFI loader). A few things I haven't verified myself: the DRTM boot-CPU affinity = (which Abhishek has already covered on real hardware), deprivileged execution, and the taint flag =E2=80=94 those are still on my list. One limitation to note: dm-crypt keys aren't delivered to crash kernels loaded through the EFI loader, so that path doesn't support encrypted dumps yet. Right now this discussion is still hanging off the old eBPF-approach = thread; I think it'd be cleaner to start a fresh thread for the efiloader work = so it's easier to follow. And I'd like to understand how you're planning to get this series merged, so I can line up the kdump patches to fit in = with that. Thanks for the work on this =E2=80=94 it's solving a real gap for = UKI/zboot kexec. Thanks Mukesh Pilaniya > On 21 Oct 2026, at 12:06=E2=80=AFAM, Jason Gunthorpe = wrote: >=20 > On Tue, Oct 20, 2026 at 07:47:19PM +0200, Philipp Rudo wrote: >=20 >> The reason why I and Pingfan abandoned this approach and went for = eBPF >> instead was due to security concerns. Our premise is/was that the EFI >> stub must not be able to harm the running kernel. Be it intentional = or >> not. That's a guarantee eBPF with its verifier can give but a simple >> file signature can't. >=20 > This seems too much to me, I think the approach of signature > verification is sufficient. If you can load a module then you don't > need to fiddle with some covoluted EFI attack. Distros should include > their EFI signing key in the kernel keyring so a standard UKI passes > the test. >=20 > The eBPF approach fails from my perspective because it never actually > runs the stub code or using the EFI entry point. My interest is to > actually use the EFI entry point, not just treat it as some convoluted > zip file. >=20 >> But that still leaves the "unintentional malicious" case. Meaning, >> that someone tries to be "smart" and does weird stuff in the EFI stub >=20 > Buggy modules exist too, it is up the signer to take a position on > that, IMHO. How can you have an "out of tree stub" if the only things > loaded are signed by the kernel builder? >=20 > Regardles, Ard's suggestion to move the execution from a kthread to a > user thread could provide enough isolation to mititgate even this.. >=20 >> Two more comments with my distro head on. >>=20 >> First, kdump is extremely important to us. So the final solution = needs >> to be able to load a crash kernel as well. >=20 > And you want this to be a UKI too? >=20 > I'm not sure it is so good for crash robustness to have so much more > complexity in the boot path.. >=20 > Though I wonder if you can run the EFI flow when initially loading and > staging the crash kernel? Then stop at the exit boot services and wait > for a crash before jumping back into the flow. >=20 > Jason >=20