From: Kylene Jo Hall <kjhall@us.ibm.com>
To: Seiji Munetoh <seiji.munetoh@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>, akpm@osdl.org
Subject: Re: [PATCH 1/2] tpm: bios log parsing fixes
Date: Fri, 26 May 2006 09:43:38 -0500 [thread overview]
Message-ID: <1148654618.5317.204.camel@localhost.localdomain> (raw)
In-Reply-To: <1148654605.20195.39.camel@localhost.localdomain>
ACK'ed-by: Kylene Hall <kjhall@us.ibm.com>
On Fri, 2006-05-26 at 23:43 +0900, Seiji Munetoh wrote:
> This patch fixes "tcpa_pc_event" misalignment between enum, strings and
> TCG PC spec and output of the event which contains a hash data.
>
> Signed-off-by: Seiji Munetoh <seiji.munetoh@gmail.com>
> ---
>
> --- linux-2.6.17-rc4/drivers/char/tpm/tpm_bios.c 2006-05-16
> 09:33:06.000000000 +0900
> +++ linux-2.6.17-rc4-tpm/drivers/char/tpm/tpm_bios.c 2006-05-24
> 07:11:44.000000000 +0900
> @@ -105,6 +105,12 @@ static const char* tcpa_event_type_strin
> "Non-Host Info"
> };
>
> +struct tcpa_pc_event {
> + u32 event_id;
> + u32 event_size;
> + u8 event_data[0];
> +};
> +
> enum tcpa_pc_event_ids {
> SMBIOS = 1,
> BIS_CERT,
> @@ -114,14 +120,15 @@ enum tcpa_pc_event_ids {
> NVRAM,
> OPTION_ROM_EXEC,
> OPTION_ROM_CONFIG,
> - OPTION_ROM_MICROCODE,
> + OPTION_ROM_MICROCODE = 10,
> S_CRTM_VERSION,
> S_CRTM_CONTENTS,
> POST_CONTENTS,
> + HOST_TABLE_OF_DEVICES,
> };
>
> static const char* tcpa_pc_event_id_strings[] = {
> - ""
> + "",
> "SMBIOS",
> "BIS Certificate",
> "POST BIOS ",
> @@ -130,11 +137,12 @@ static const char* tcpa_pc_event_id_stri
> "NVRAM",
> "Option ROM",
> "Option ROM config",
> - "Option ROM microcode",
> + "",
> + "Option ROM microcode ",
> "S-CRTM Version",
> - "S-CRTM Contents",
> - "S-CRTM POST Contents",
> - "POST Contents",
> + "S-CRTM Contents ",
> + "POST Contents ",
> + "Table of Devices",
> };
>
> /* returns pointer to start of pos. entry of tcg log */
> @@ -206,7 +214,7 @@ static int get_event_name(char *dest, st
> const char *name = "";
> char data[40] = "";
> int i, n_len = 0, d_len = 0;
> - u32 event_id;
> + struct tcpa_pc_event *pc_event;
>
> switch(event->event_type) {
> case PREBOOT:
> @@ -235,31 +243,32 @@ static int get_event_name(char *dest, st
> }
> break;
> case EVENT_TAG:
> - event_id = be32_to_cpu(*((u32 *)event_entry));
> + pc_event = (struct tcpa_pc_event *)event_entry;
>
> /* ToDo Row data -> Base64 */
>
> - switch (event_id) {
> + switch (pc_event->event_id) {
> case SMBIOS:
> case BIS_CERT:
> case CMOS:
> case NVRAM:
> case OPTION_ROM_EXEC:
> case OPTION_ROM_CONFIG:
> - case OPTION_ROM_MICROCODE:
> case S_CRTM_VERSION:
> - case S_CRTM_CONTENTS:
> - case POST_CONTENTS:
> - name = tcpa_pc_event_id_strings[event_id];
> + name = tcpa_pc_event_id_strings[pc_event->event_id];
> n_len = strlen(name);
> break;
> + /* hash data */
> case POST_BIOS_ROM:
> case ESCD:
> - name = tcpa_pc_event_id_strings[event_id];
> + case OPTION_ROM_MICROCODE:
> + case S_CRTM_CONTENTS:
> + case POST_CONTENTS:
> + name = tcpa_pc_event_id_strings[pc_event->event_id];
> n_len = strlen(name);
> for (i = 0; i < 20; i++)
> - d_len += sprintf(data, "%02x",
> - event_entry[8 + i]);
> + d_len += sprintf(&data[2*i], "%02x",
> + pc_event->event_data[i]);
> break;
> default:
> break;
>
>
next prev parent reply other threads:[~2006-05-26 14:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-26 14:43 Seiji Munetoh
2006-05-26 14:43 ` Kylene Jo Hall [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-05-18 23:27 Seiji Munetoh
2006-05-18 23:54 ` Alexey Dobriyan
2006-05-22 1:11 ` Seiji Munetoh
2006-05-19 1:19 ` Kylene Jo Hall
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=1148654618.5317.204.camel@localhost.localdomain \
--to=kjhall@us.ibm.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=seiji.munetoh@gmail.com \
/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
all inboxes | Powered by JetHome®