[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <D5BQGY5425TQ.3U6N698H2KYWO@kernel.org>
Date: Sat, 02 Nov 2024 15:39:38 +0200
From: "Jarkko Sakkinen" <jarkko@...nel.org>
To: "Ard Biesheuvel" <ardb@...nel.org>
Cc: "Jonathan Corbet" <corbet@....net>, "Peter Huewe" <peterhuewe@....de>,
"Jason Gunthorpe" <jgg@...pe.ca>, <James.Bottomley@...senpartnership.com>,
<andrew.cooper3@...rix.com>, <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 12:52 PM EET, Ard Biesheuvel wrote:
> > Short answer: I have no idea. I would not mind that but neither
> > the commit message for TPM give a clue on this. Actually, I *do
> > not care* if it is RO and RW but I'm neither good at guessing
> > random shit.
> >
>
> You were cc'ed on the rest of the series, no?
Yeah, but that does not make sysfs attribute having store operation less
confusing. At minimum 2/2 should replace the current sysfs patch, if
store operation is not required.
> Shall we clarify this first, before proposing patches that introduce
> new ioctls() and kernel command line parameters to a security
> sensitive subsystem?
>
> My reading of 19/20 is that the secure launch module sets the default
> locality, and given that it can be built as a module, setting the
> default locality needs to be exported to modules (but as I indicated,
> this should probably be in a TPM internal module namespace)
>
> If setting the default locality from user space is a requirement down
> the road, we can discuss it then. For now, let's not go off into the
> weeds and derail this series even more.
If sysfs store is not required after all, and only thing that touches
the locality is slmodule, tweaking 17/20's set operation to this would
be good enough for me:
int tpm_chip_set_locality(struct tpm_chip *chip, u8 locality)
{
int ret;
if (locality >= TPM_MAX_LOCALITY)
return false;
ret = tpm_try_get_ops(chip);
if (ret)
return ret;
chip->default_locality = locality;
tpm_put_ops(chip);
return 0;
}
EXPORT_SYMBOL_GPL(tpm_chip_set_locality);
Now that I've worked on this issue I think also 15/20 and 16/20 are
pretty clear I can suggest some tweaks to the commit messages later to
make then more self-explatonery.
BR, Jarkko
Powered by blists - more mailing lists