Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796387722; b=yY0L+3sIKO0ds9vClN/F8JzkZ22LWcsVGorNQxMnRSjW18ot0x0wCUFOcHarDUm6b/mG gtSgq4LiGPstfsLXNjMF7IfePkeJFVU5DVo+fPQY1T2tlYmjZIHwZyQOyDypFFoxqusK8 DamiUSTy9i/3wnd+wEWwApBBqqKdbcwuuq0aEEYHLMNw6phpj4coaOywQj8/N4bcNNY76 S0gztTZVlKzU6t0sFfZ71WbSuIwEi/qxwmZhgdyjTftp6ViCAgeU8iBQxkcW7CwBkF6q8 UwZ8lS7zuXfzUS42bIqziLdhbh8WkdGJTk0kPEIUFsMgl3SKJhlur/8H0nuTOvl98vA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387722; 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:Message-ID:Date:MIME-Version:User-Agent:Subject: From:To:Cc:References:Content-Language:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=8W9Jcs1iAIr4TAgLnS5jGHiTsmiIMqVSCKWrhbqktrc=; b=EdvVJD/WRQrcpsw66ianMcqz5UjVMjf5Q6ca6cYiT29ukQf0iLr0Ro0OTYmFUl2E1KbH sl+R+d4tjjKiDUCiQtBoJtSHgWUkcSC7Tr374fQx0Qzn/yyOi51CuOdcdVf1/CP6na6eD 2ZEQuL7H6x9RBBqFnTtYppW8QDIA2/vG3H7BXl5++gECB//TxkctwKASWnqI/vdeQblLr fB3A6Y7hhxfld8Ou5/ZZc3IFRVa51MtK4hguJicse0QFnB9I7Ve4JMuno9EzohdXXOxdq 54imUj13twWx43Srf/2MiNajGbrR6yJVA+UdGEPegjBw1K6fOjymuAFhtpNx3LxXlVw== 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="Mvqmdlk/"; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=plpbwqUv; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 A7056606A322 for ; Fri, 4 Dec 2026 12:35:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A7056606A322 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=Mvqmdlk/; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=plpbwqUv DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796387720; 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=8W9Jcs1iAIr4TAgLnS5jGHiTsmiIMqVSCKWrhbqktrc=; b=Mvqmdlk/rt3F69Y4gI9xmoS0nJGWahBKQWie+53hyYNUPmGWWWSIzOGuhaTV1WHtSjUsz0 WO8PCh6ATxLvGGkuMHCD1eKaP2e5pLtMmiJQ1MHrqUW7wKr8rxcXCbHNlOs99anrjjQyEF jg5gm/+ki8m7iSqHEUOqQ8gEk3JmU0o= Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-331-T-DgM7P6PVS7mBQMgdB0eA-1; Fri, 4 Dec 2026 12:35:17 +0000 X-MC-Unique: T-DgM7P6PVS7mBQMgdB0eA-1 X-Mimecast-MFC-AGG-ID: T-DgM7P6PVS7mBQMgdB0eA_1796387717 Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-8b7614e9762so635120b3a.2 for ; Fri, 04 Dec 2026 04:35:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1796387717; x=1796992517; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=8W9Jcs1iAIr4TAgLnS5jGHiTsmiIMqVSCKWrhbqktrc=; b=plpbwqUvbMnlRUsPdfe5aHN48WjZnMDQ51mAha9MBNVszWeOH7uHB5lTerW08FscKA 5dPUbxJm6/z5D0/0b6ceMryzrFrau2WAQx973NMNYeAITRLnRtalBi8NSPCGwnzCrUFl td3tOKotAkB4z/FZ3F3FNVz0YxrZubqjGsIa0FcDPH/BKwIau+N7DURMscunr/vMtfQA toLGfUz159ZL6T9bDd7NyUpITCOAJGH5nqiWa8np5wF2AIN380z1Sgf97Tb7rAuWoe4Y ytLD1lhFZC2naAiufvZOC0ZPWbGh/+xXOHiIloNLDSPzlWMETFr/FYm5ch76gVWa4bXz 8G7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796387717; x=1796992517; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=8W9Jcs1iAIr4TAgLnS5jGHiTsmiIMqVSCKWrhbqktrc=; b=ek+oC3MHKMpW9Y7o3ri78zEhVmteulXbdGzg5p6ZF7v0dQA0mvcvgIgJ4deeoluHku GxIqFw4vi9StG4ivcwtwFwG08e8BOP0qYvoX8v28gaWB8fVded+NEpXZhlrCNPJ25WZv BAC2tAjuwY3zL5YLfFXLZHlCLALvczolWsSa0UXMZ7Kr9txVk6fdkdFBBv7ZAS+Z9PVj QeJ/YbjQkVE86YfjhAcwuGkxn2P+jyyVnoINi8RPyqWkfqGvCA5Nov9ewXZ1G6k1PnTv loKvGYmPQrZL+KKDLFIhezzG6TJ1u3Kz+BgNArjnS2HOacPrbp3jjytwn4hZf0FFcZNQ B0hg== X-Forwarded-Encrypted: i=1; AL+hErEW3JyNAjlZS/GJhxKviOM2kSgDjMqZLD6FpdjJmHdDHfyyEhWsL4UGmijJZeTa3hdtHyk=@vger.kernel.org X-Gm-Message-State: AB4q+uHXonfkr4zH9euY/ErqXVLQKktKevQ0MU4qIcD6hmwmQxBVeQAg Z+w6E3XT2RQtIvOSH13+1BhnQ/jDYl7zafau+/6t497C5k2D8922rPZJ/5HSL8xLrTlI1TrRxl7 V6MZwm60YHhFyhwk3t6WIqSujpjLgygEPEtr5uia8AvieVlDFg8jCBw== X-Gm-Gg: AZFdTZfpoH5/C+EpQz8YYqgWjdYTp4Zt9RL7+sR56CSErN1rq52/TU3o+az/vRkLEey YFZR6Lr90vwDBGVz7s9ILywBglJYp30y5ycejWZ0M2p6utkgvK9vV6M3d3utMyWjB5H/xeoeIEA TsMZEB3YVACBWcdSnKCWR696nHCGwFVTA1gI8gKaI+OGdl94qmppXC1nCkjrNUUCXKXqq/vrWHr GtITj7Z86o90s6R+sxkgXAUs1y5B+8aGzS8/PcPHZB+RfbwNfoEaEETuGlvpX3Uglx52x9Jfzk2 PXR/fjMXv1hZAPdqQz6hcPHkSPNbg8Afq94a7acIXmmDc8xw4BMHLhlagiw59MJq1HamrqvTouy Ir2OFienT+Z4iDyaeBYfvoyc0J/7sgQU2/UiV6QbdwchZaJ1ggqraywRow8AiiQG99vPZwDa4KU dcngc8t9pTFO3oo/rpO/d7ynpiZC6pC3w55X35wYyl/Vw= X-Received: by 2002:a17:90b:4d0b:b0:3ac:adce:60ad with SMTP id 98e67ed59e1d1-3b5e0600d9cmr1360677a91.22.1796387716537; Fri, 04 Dec 2026 04:35:16 -0800 (PST) X-Received: by 2002:a17:90b:4d0b:b0:3ac:adce:60ad with SMTP id 98e67ed59e1d1-3b5e0600d9cmr1360648a91.22.1796387716029; Fri, 04 Dec 2026 04:35:16 -0800 (PST) Received: from ?IPV6:2401:4900:1f29:b56e:4079:c15a:a28d:6bbe? ([2401:4900:1f29:b56e:4079:c15a:a28d:6bbe]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5c7843862sm9200012a91.2.2026.12.04.04.35.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2026 04:35:15 -0800 (PST) Message-ID: Date: Fri, 4 Dec 2026 18:05:06 +0530 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCHv7 00/13] kexec: Use BPF lskel to enable kexec to load PE format boot image From: Mukesh Pilaniya To: Jason Gunthorpe 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 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> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 04/12/26 4:27 pm, MUKESH KUMAR PILANIYA wrote: > 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=efiloader-kexec) > and I'm preparing crash/kdump support on top of it. Here's where things stand > in case it’s 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 <=48-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 <=48-bit PA configurations > arm64: kexec_efi: Implement crash (kdump) kernel loading > arm64: kexec_efi: Support crashkernel=,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 — 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). I've run the same full kdump cycle for the UKI formats too, and both work. So the end-to-end coverage is now all four PE formats, each producing a valid /proc/vmcore: - bare Image via the raw Image loader - zboot (vmlinuz.efi) via the EFI loader - UKI (uki.efi) via the EFI loader - UKI with zboot inside 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 — 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 — it's solving a real gap for UKI/zboot kexec. > > Thanks > Mukesh Pilaniya > >> On 21 Oct 2026, at 12:06 AM, Jason Gunthorpe wrote: >> >> On Tue, Oct 20, 2026 at 07:47:19PM +0200, Philipp Rudo wrote: >> >>> 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. >> >> 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. >> >> 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. >> >>> But that still leaves the "unintentional malicious" case. Meaning, >>> that someone tries to be "smart" and does weird stuff in the EFI stub >> >> 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? >> >> Regardles, Ard's suggestion to move the execution from a kthread to a >> user thread could provide enough isolation to mititgate even this.. >> >>> Two more comments with my distro head on. >>> >>> First, kdump is extremely important to us. So the final solution needs >>> to be able to load a crash kernel as well. >> >> And you want this to be a UKI too? >> >> I'm not sure it is so good for crash robustness to have so much more >> complexity in the boot path.. >> >> 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. >> >> Jason >> > -- Regards, Mukesh Pilaniya