[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tpmdd-devel
Subject:    Re: [tpmdd-devel] [PATCH 1/3] TPM: Zero buffer whole after copying
From:       Rajiv Andrade <srajiv () linux ! vnet ! ibm ! com>
Date:       2011-12-20 16:41:20
Message-ID: 4EF0BAB0.2060205 () linux ! vnet ! ibm ! com
[Download RAW message or body]

On 16/12/11 14:15, Kent Yoder wrote:
> Hi Tim,
>
> On Wed, Dec 14, 2011 at 3:08 PM, Tim Gardner<tim.gardner@canonical.com>  wrote:
>> On 12/06/2011 11:29 AM, Tim Gardner wrote:
>>> Commit 3321c07ae5068568cd61ac9f4ba749006a7185c9 correctly clears the TPM
>>> buffer if the user specified read length is>= the TPM buffer length. However,
>>> if the user specified read length is<    the TPM buffer length, then part of the
>>> TPM buffer is left uncleared.
>>>
>>> Reported-by: Seth Forshee<seth.forshee@canonical.com>
>>> Cc: Debora Velarde<debora@linux.vnet.ibm.com>
>>> Cc: Rajiv Andrade<srajiv@linux.vnet.ibm.com>
>>> Cc: Marcel Selhorst<m.selhorst@sirrix.com>
>>> Cc: tpmdd-devel@lists.sourceforge.net
>>> Cc: stable@vger.kernel.org
>>> Signed-off-by: Tim Gardner<tim.gardner@canonical.com>
>>> ---
>>>    drivers/char/tpm/tpm.c |    3 ++-
>>>    1 files changed, 2 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
>>> index 361a1df..b366b34 100644
>>> --- a/drivers/char/tpm/tpm.c
>>> +++ b/drivers/char/tpm/tpm.c
>>> @@ -1115,12 +1115,13 @@ ssize_t tpm_read(struct file *file, char __user *buf,
>>>        ret_size = atomic_read(&chip->data_pending);
>>>        atomic_set(&chip->data_pending, 0);
>>>        if (ret_size>    0) {     /* relay data */
>>> +             ssize_t orig_ret_size = ret_size;
>>>                if (size<    ret_size)
>>>                        ret_size = size;
>>>
>>>                mutex_lock(&chip->buffer_mutex);
>>>                rc = copy_to_user(buf, chip->data_buffer, ret_size);
>>> -             memset(chip->data_buffer, 0, ret_size);
>>> +             memset(chip->data_buffer, 0, orig_ret_size);
>>>                if (rc)
>>>                        ret_size = -EFAULT;
>>>

Looks good, I'll apply together with the other ones when they get reworked,
thanks for the fixes.

>> Is there anyone alive at these addresses ?
>    I know Rajiv had started looking at this patch before he left for
> vacation.  He should be back on Monday.
Thanks Kent, and sorry Tim.

Rajiv
>
> Kent
>
>> --
>> Tim Gardner tim.gardner@canonical.com
>>
>> ------------------------------------------------------------------------------
>> Cloud Computing - Latest Buzzword or a Glimpse of the Future?
>> This paper surveys cloud computing today: What are the benefits?
>> Why are businesses embracing it? What are its payoffs and pitfalls?
>> http://www.accelacomm.com/jaw/sdnl/114/51425149/
>> _______________________________________________
>> tpmdd-devel mailing list
>> tpmdd-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/tpmdd-devel
>
>


------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
tpmdd-devel mailing list
tpmdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic