Re: [PATCH] hwrng: tpm: Do not enable by default

Jarkko Sakkinen
2025-10-27T19:51:23Z

On Tue, Oct 21, 2025 at 02:46:15PM +0200, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> As seen with optee_ftpm, which uses ms-tpm-20-ref [1], a TPM may write
> the current time epoch to its NV storage every 4 seconds if there are
> commands sent to it. The 60 seconds periodic update of the entropy pool
> that the hwrng kthread does triggers this, causing about 4 writes per
> requests. Makes 2 millions per year for a 24/7 device, and that is a lot
> for its backing NV storage.
>
> It is therefore better to make the user intentionally enable this,
> providing a chance to read the warning.
>
> [1] https://github.com/Microsoft/ms-tpm-20-ref
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Looking at DRBG_* from [1] I don't see anything you describe. If OPTEE
writes NVRAM, then the implementation is broken.

Also AFAIK, it is pre-seeded per power cycle. There's nothing that even
distantly relates on using NVRAM.

[1] https://trustedcomputinggroup.org/wp-content/uploads/TPM-2.0-1.83-Part-4-Supporting-Routines-Code.pdf

BR, Jarkko