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: <498B0E5A.1020709@linux.vnet.ibm.com>
Date:	Thu, 05 Feb 2009 14:05:46 -0200
From:	Rajiv Andrade <srajiv@...ux.vnet.ibm.com>
To:	"Serge E. Hallyn" <serue@...ibm.com>
CC:	linux-kernel@...r.kernel.org, jmorris@...ei.org,
	akpm@...ux-foundation.org, safford@...son.ibm.com,
	Mimi Zohar <zohar@...ux.vnet.ibm.com>
Subject: Re: [PATCH] TPM: integrity fix

Serge E. Hallyn wrote:
> Quoting Rajiv Andrade (srajiv@...ux.vnet.ibm.com):
>   
>> Fix to function which is called by IMA, now tpm_chip_find_get() considers the case in which the machine doesn't have a TPM or, if it has, its TPM isn't enabled.
>>
>> Signed-off-by: Mimi Zohar <zohar@...ux.vnet.ibm.com>
>> Signed-off-by: Rajiv Andrade <srajiv@...ux.vnet.ibm.com>
>>     
>
> Is this to fix James' problem with IMA on bootup?
>
>   
Yes.
> Acked-by: Serge Hallyn <serue@...ibm.com>
>
>   
>> ---
>>  drivers/char/tpm/tpm.c |    8 +++++---
>>  1 files changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
>> index 0387965..912a473 100644
>> --- a/drivers/char/tpm/tpm.c
>> +++ b/drivers/char/tpm/tpm.c
>> @@ -666,18 +666,20 @@ EXPORT_SYMBOL_GPL(tpm_show_temp_deactivated);
>>   */
>>  static struct tpm_chip *tpm_chip_find_get(int chip_num)
>>  {
>> -	struct tpm_chip *pos;
>> +	struct tpm_chip *pos, *chip = NULL;
>>
>>  	rcu_read_lock();
>>  	list_for_each_entry_rcu(pos, &tpm_chip_list, list) {
>>     
>
> Crap I even paused for a second when I reviewed the original
> patch.  I think the conversation in my head went something like
> "but will pos be NULL at the end of the loop?"  "Oh, it must".  gah.
>
>   
Yeah, I thought the same and let it pass by..

Rajiv
>>  		if (chip_num != TPM_ANY_NUM && chip_num != pos->dev_num)
>>  			continue;
>>
>> -		if (try_module_get(pos->dev->driver->owner))
>> +		if (try_module_get(pos->dev->driver->owner)) {
>> +			chip = pos;
>>  			break;
>> +		}
>>  	}
>>  	rcu_read_unlock();
>> -	return pos;
>> +	return chip;
>>  }
>>
>>  #define TPM_ORDINAL_PCRREAD cpu_to_be32(21)
>> -- 
>> 1.5.6.3
>>     

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ