From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@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: Tue, 9 Feb 2016 10:33:44 -0700 [thread overview]
Message-ID: <20160209173344.GA13615@obsidianresearch.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:
> 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
This should be a fixes line, see Documentation/
> 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>
> 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
> +++ 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]);
Looks reasonable otherwise.
Reviewed-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Jason
------------------------------------------------------------------------------
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
next parent reply other threads:[~2016-02-09 17:33 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 ` Jason Gunthorpe [this message]
2016-02-10 3:54 ` [PATCH] tpm_eventlog.c: fix binary_bios_measurements Jarkko Sakkinen
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=20160209173344.GA13615@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).