[PATCH v11 00/16] Remove nested TPM operations

Stefan Berger stefanb at linux.ibm.com
Fri Feb 8 12:22:48 UTC 2019


On 2/8/19 6:50 AM, Jarkko Sakkinen wrote:
> On Thu, Feb 07, 2019 at 09:14:54PM -0500, Stefan Berger wrote:
>
>>       chip->ops = NULL;
>>       up_write(&chip->ops_sem);
>>   }
>> diff --git a/drivers/char/tpm/tpm-interface.c
>> b/drivers/char/tpm/tpm-interface.c
>> index 02e8cffd1163..fcd845ad8c3c 100644
>> --- a/drivers/char/tpm/tpm-interface.c
>> +++ b/drivers/char/tpm/tpm-interface.c
>> @@ -124,6 +124,8 @@ static ssize_t tpm_try_transmit(struct tpm_chip *chip,
>> void *buf, size_t bufsiz)
>>           dev_err(&chip->dev, "tpm_transmit: tpm_recv: error %d\n", rc);
>>       } else if (len < TPM_HEADER_SIZE || len != be32_to_cpu(header->length))
>>           rc = -EFAULT;
>> +    else
>> +        rc = 0;
> Why is this needed?

Because it holds a non-zero value, which is wrong at this point. Below 
it is:

return rc ? rc : len;

It will always return that rc and never 'len'.

It's not just needed for bisecting. I still need it with your latest 
tree. That's the only change I need with my current testing of 
tpm_vtpm_proxy, TIS + TPM 1.2 , TIS + TPM 2.0 , and CRB + TPM 2.0 (with 
QEMU :-) ).

    Stefan




More information about the Linux-security-module-archive mailing list