From: Jarkko Sakkinen <jarkko@kernel.org>
To: Daniel Ramos <capitain_jack@yahoo.com>
Cc: "Jhon Taylor Forbes Cañizares" <hermanojhonforbes@hotmail.com>,
"Matthew Garrett" <mjg59@srcf.ucam.org>,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
keyrings@vger.kernel.org, ebiggers@kernel.org, rafael@kernel.org
Subject: Re: [RFC] power/hibernate: TPM2 image encryption to allow hibernation under lockdown
Date: Thu, 8 Oct 2026 21:02:20 +0300 [thread overview]
Message-ID: <asfarOdfsZbThUet@kernel.org> (raw)
In-Reply-To: <179146953927.3470668.11045077335347628577@yahoo.com>
On Thu, Oct 08, 2026 at 11:25:39AM -0300, Daniel Ramos wrote:
> Hi Jhon, hi Matthew,
>
> Jhon, thank you for starting this.
> I build Sparky Stereo OS, a SparkyLinux edition, and we want Secure Boot
> and hibernation together, so we ran your RFC through a small test bench
> on 7.3-rc6: QEMU with OVMF and Secure Boot, swtpm as the TPM 2.0, a
> scripted hibernate and resume, and tamper checks.
> Here is what we measured, in case it helps the next version.
>
> The patch does not apply as posted (git apply reports a corrupt patch at
> line 59; the hunk line counts do not match their bodies), and the
> lockdown hunk breaks the build even with the option off: the enum is
> LOCKDOWN_HIBERNATION, and snapenc_is_active() is declared nowhere.
> With 17 small fixes it builds and boots. Sealing and unsealing could not
> be mapped to the in-tree API (tpm2_seal_trusted() needs a parent key and
> a PolicyPCR digest that nothing in the tree computes), so we stubbed
> them for the run.
> Under lockdown=confidentiality hibernation is then allowed, but on the
> default LZO path the image is written in plaintext while the kernel logs
> that it is encrypted: the hooks are only in save_image() and
> load_image(), the nocompress path.
> With hibernate=nocompress the kernel oopses while saving, because the
> AEAD associated data are not in the scatterlists.
> With those chained, the image is still plaintext (the ciphertext buffer
> is never written), and resume crashes because the decryption context
> exists only in the memory of the kernel being replaced.
> A tampered image is caught only by the existing CRC32 and LZO checks,
> and a change of PCR 23 between the boots is not noticed.
>
> The detailed logs and the fixes are available if they help, and the
> bench can run any later version unchanged, including a design built on
> the requirements Matthew described:
> https://github.com/Sparky-OS/sparky-stereo-os/tree/main/tools/hibernate-bench
> Disclosure: the measurements were made with AI assistance (Claude),
> directed and checked by me.
>
> Daniel Ramos
Can you describe roughly how this is setup in your environment? I cannot
use Spark OS (or any other distro) for kernel testing but a description
would get me up on speed once I have bandwidth.
Just trying to save a bit of my bandwidth, that's all.
Br, Jarkko
prev parent reply other threads:[~2026-10-08 18:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 4:57 [RFC] power/hibernate: TPM2 image encryption to allow hibernation under lockdown Jhon Taylor Forbes Cañizares
2026-03-23 23:39 ` Matthew Garrett
2026-10-08 14:25 ` Daniel Ramos
2026-10-08 18:02 ` Jarkko Sakkinen [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=asfarOdfsZbThUet@kernel.org \
--to=jarkko@kernel.org \
--cc=capitain_jack@yahoo.com \
--cc=ebiggers@kernel.org \
--cc=hermanojhonforbes@hotmail.com \
--cc=keyrings@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
--cc=rafael@kernel.org \
/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