[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <D5BHBW3NUS5C.293GUI03HMTCF@kernel.org>
Date: Sat, 02 Nov 2024 08:29:52 +0200
From: "Jarkko Sakkinen" <jarkko@...nel.org>
To: "Jarkko Sakkinen" <jarkko@...nel.org>, "Jonathan Corbet"
<corbet@....net>, "Peter Huewe" <peterhuewe@....de>, "Jason Gunthorpe"
<jgg@...pe.ca>
Cc: <James.Bottomley@...senpartnership.com>, <andrew.cooper3@...rix.com>,
<ardb@...nel.org>, <baolu.lu@...ux.intel.com>, <bp@...en8.de>,
<dave.hansen@...ux.intel.com>, <davem@...emloft.net>,
<dpsmith@...rtussolutions.com>, <dwmw2@...radead.org>,
<ebiederm@...ssion.com>, <herbert@...dor.apana.org.au>, <hpa@...or.com>,
<iommu@...ts.linux-foundation.org>, <kanth.ghatraju@...cle.com>,
<kexec@...ts.infradead.org>, <linux-crypto@...r.kernel.org>,
<linux-doc@...r.kernel.org>, <linux-efi@...r.kernel.org>,
<linux-integrity@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<luto@...capital.net>, <mingo@...hat.com>, <mjg59@...f.ucam.org>,
<nivedita@...m.mit.edu>, <ross.philipson@...cle.com>, <tglx@...utronix.de>,
<trenchboot-devel@...glegroups.com>, <x86@...nel.org>
Subject: Re: [RFC PATCH v2 1/2] tpm, tpm_tis: Introduce TPM_IOC_SET_LOCALITY
On Sat Nov 2, 2024 at 8:22 AM EET, Jarkko Sakkinen wrote:
> DRTM needs to be able to set the locality used by kernel. Provide
> TPM_IOC_SET_LOCALITY operation for this purpose. It is enabled only if
> the kernel command-line has 'tpm.set_locality_enabled=1'. The operation
> is one-shot allowed only for tpm_tis for the moment.
>
> Signed-off-by: Jarkko Sakkinen <jarkko@...nel.org>
> ---
> v2:
> - Do not ignore the return value of tpm_ioc_set_locality().
> - if (!(chip->flags & TPM_CHIP_FLAG_SET_LOCALITY_ENABLED))
> - Refined kernel-parameters.txt description.
> - Use __u8 instead of u8 in the uapi.
> - Tested with https://codeberg.org/jarkko/tpm-set-locality-test/src/branch/main/src/main.rs
This version has been also tested (and encountered bugs fixed). I wrote
a small test program to verify that it works linked above.
After the boot, the new ioctl can reset exactly once the locality. Other
benefit is that the feature can be selected per driver (at this point
tpm_tis drivers) and protection of the access with DAC, SELinux etc.
And thanks to the kernel command-line parameter, it is an opt-in
feature like it should because vast majority of users will probably
never use trenchboot. I.e. set 'tpm.set_locality_enable=1' to have
the ioctl available.
I think this is a solution that at least I could live with. It has
somewhat rigid commmon-sense constraints.
BR, Jarkko
Powered by blists - more mailing lists