Re: [PATCH 3/4] driver: provide sysfs interfaces to access TXT log

From: Matthew Garrett
Date: Wed May 08 2013 - 01:16:57 EST


On Tue, 2013-05-07 at 22:55 +0800, Qiaowei Ren wrote:

> +What: /sys/devices/platform/intel_txt/log/log_header
> +Date: May 2013
> +KernelVersion: 3.9

How different are these logs to the TPM measurements exported via
securityfs?

> +What: /sys/devices/platform/intel_txt/log/block_index
> +Date: May 2013
> +KernelVersion: 3.9
> +Contact: "Qiaowei Ren" <qiaowei.ren@xxxxxxxxx>
> +Description: The "block_index" property allows you to set the block
> + index for output.

So I write a value here and then I see different chunks of log? This
doesn't seem like an optimal interface. What do these logs actually
contain? How do I know which block I should be reading?

> +static int are_uuids_equal(const struct uuid *uuid1,
> + const struct uuid *uuid2)
> +{
> + return (memcmp(uuid1, uuid2, sizeof(*uuid1)) == 0) ? 1 : 0;
> +}

Use one of the uuidcmp functions from uuid.h?

> +EXPORT_SYMBOL_GPL(sysfs_create_log);
> +
> +MODULE_LICENSE("GPL");

Same as for the previous patch - you don't need these.

> +struct uuid {
> + uint32_t data1;
> + uint16_t data2;
> + uint16_t data3;
> + uint16_t data4;
> + uint8_t data5[6];
> +} __packed;

There's already UUID structures in uuid.h

> +#define TBOOT_LOG_UUID {0xc0192526, 0x6b30, 0x4db4, 0x844c, \
> + {0xa3, 0xe9, 0x53, 0xb8, 0x81, 0x74} }

uuid.h again.

--
Matthew Garrett | mjg59@xxxxxxxxxxxxx
èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébëæìr¸›zX§»®w¥Š{ayºÊÚë,j­¢f£¢·hš‹àz¹®w¥¢¸ ¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾«‘êçzZ+ƒùšŽŠÝj"ú!¶iO•æ¬z·švØ^¶m§ÿðà nÆàþY&—