lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <195241fa-64c1-4c8a-974d-69313e2d0eb3@oracle.com>
Date: Tue, 15 Apr 2025 14:04:36 -0700
From: ross.philipson@...cle.com
To: ALOK TIWARI <alok.a.tiwari@...cle.com>, linux-kernel@...r.kernel.org,
        x86@...nel.org, linux-integrity@...r.kernel.org,
        linux-doc@...r.kernel.org, linux-crypto@...r.kernel.org,
        kexec@...ts.infradead.org, linux-efi@...r.kernel.org,
        iommu@...ts.linux.dev
Cc: dpsmith@...rtussolutions.com, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, hpa@...or.com, dave.hansen@...ux.intel.com,
        ardb@...nel.org, mjg59@...f.ucam.org,
        James.Bottomley@...senpartnership.com, peterhuewe@....de,
        jarkko@...nel.org, jgg@...pe.ca, luto@...capital.net,
        nivedita@...m.mit.edu, herbert@...dor.apana.org.au,
        davem@...emloft.net, corbet@....net, ebiederm@...ssion.com,
        dwmw2@...radead.org, baolu.lu@...ux.intel.com,
        kanth.ghatraju@...cle.com, andrew.cooper3@...rix.com,
        trenchboot-devel@...glegroups.com
Subject: Re: [PATCH v13 16/19] tpm, tpm_tis: Allow locality to be set to a
 different value

On 4/12/25 12:15 PM, ALOK TIWARI wrote:
> 
> 
> On 11-04-2025 02:11, Ross Philipson wrote:
>> DRTM needs to be able to set the locality used by kernel. Provide
>> a one-shot function tpm_chip_set_locality() for the purpose.
>>
>> Signed-off-by: Ross Philipson <ross.philipson@...cle.com>
>> Signed-off-by: Jarkko Sakkinen <jarkko@...nel.org>
>> ---
>>   drivers/char/tpm/tpm-chip.c     | 33 ++++++++++++++++++++++++++++++++-
>>   drivers/char/tpm/tpm_tis_core.c |  2 ++
>>   include/linux/tpm.h             |  4 ++++
>>   3 files changed, 38 insertions(+), 1 deletion(-)
>>
>> +/**
>> + * tpm_chip_set_locality() - Set the TPM locality kernel uses
>> + * @chip:    &tpm_chip instance
>> + * @locality:   new locality
>> + *
>> + * This a one-shot function. Returns zero or POSIX error on failure.
>> + */
>> +int tpm_chip_set_locality(struct tpm_chip *chip, u8 locality)
>> +{
>> +    int ret;
>> +
>> +    if (locality < 0 || locality >= TPM_MAX_LOCALITY)
>> +        return -EINVAL;
>> +
>> +    ret = tpm_try_get_ops(chip);
>> +    if (ret)
>> +        return ret;
>> +
>> +    if (!(chip->flags & TPM_CHIP_FLAG_SET_LOCALITY_ENABLED)) {
>> +        tpm_put_ops(chip);
>> +        return -EINVAL;
>> +    }
>> +
>> +    chip->kernel_locality = locality;
>> +    chip->flags &= ~TPM_CHIP_FLAG_SET_LOCALITY_ENABLED;
>> +    tpm_put_ops(chip);
>> +    return 0;
> 
> a '\n' before return is customary

Can do, thanks

> 
>> +}
>> +EXPORT_SYMBOL_GPL(tpm_chip_set_locality);
>> diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/ 
>> tpm_tis_core.c
> 
> 
> Thanks,
> Alok


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ