All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] tpm_eventlog.c: fix binary_bios_measurements
Date: Wed, 10 Feb 2016 05:54:04 +0200	[thread overview]
Message-ID: <20160210035404.GA7161@intel.com> (raw)
In-Reply-To: <56B9C234.5050402-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On Tue, Feb 09, 2016 at 11:40:52AM +0100, Harald Hoyer wrote:
> Find attached a patch for the tpm kernel driver, which is fixing
> /sys/kernel/security/tpm0/binary_bios_measurements
> 
> Thanks!
> 
> Harald Hoyer
> 

> From 57558a66cfadd329cdf63570af7ad1d0fd61010f Mon Sep 17 00:00:00 2001
> From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Date: Sat, 6 Feb 2016 15:44:42 +0100
> Subject: [PATCH] tpm_eventlog.c: fix binary_bios_measurements
> 
> commit 0cc698af36ff22295dce2f5e46b0cfe605789fa4 copied the event, but
> without the event data, did an endian conversion on the size and tried
> to output the event data from the copied version, which has only have
> one byte of the data, resulting in garbage event data.
> 
> Signed-off-by: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>

PS. Don't send a new patch. I can put the "Fixes:" tag in place.

/Jarkko

> ---
>  drivers/char/tpm/tpm_eventlog.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/char/tpm/tpm_eventlog.c b/drivers/char/tpm/tpm_eventlog.c
> index bd72fb0..a21624f 100644
> --- a/drivers/char/tpm/tpm_eventlog.c
> +++ b/drivers/char/tpm/tpm_eventlog.c
> @@ -244,7 +244,12 @@ static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v)
>  
>  	tempPtr = (char *)&temp_event;
>  
> -	for (i = 0; i < sizeof(struct tcpa_event) + temp_event.event_size; i++)
> +	for (i = 0; i < sizeof(struct tcpa_event)-1 ; i++)
> +		seq_putc(m, tempPtr[i]);
> +
> +	tempPtr = (char *)v;
> +
> +	for (i = sizeof(struct tcpa_event)-1; i < sizeof(struct tcpa_event) + temp_event.event_size; i++)
>  		seq_putc(m, tempPtr[i]);
>  
>  	return 0;
> -- 
> 2.7.0
> 


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140

      parent reply	other threads:[~2016-02-10  3:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <56B9C234.5050402@redhat.com>
     [not found] ` <56B9C234.5050402-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-02-09 17:33   ` [PATCH] tpm_eventlog.c: fix binary_bios_measurements Jason Gunthorpe
2016-02-10  3:54   ` Jarkko Sakkinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160210035404.GA7161@intel.com \
    --to=jarkko.sakkinen-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.