[SLOF] [PATCH 07/16] Perform some initial measurements

Thomas Huth thuth at redhat.com
Tue Nov 10 05:23:18 AEDT 2015


On 09/11/15 10:22, Nikunj A Dadhania wrote:
> Stefan Berger <stefanb at linux.vnet.ibm.com> writes:
> 
>> This patch puts an 'event' separator into the log that can
>> then be seen in Linux's /sys/kernel/security/tpm0/ascii_bios_measurements.
>> More low-level C functions are added for measuring and logging of disk
>> related data, along with their FORTH-level counterparts. These functions
>> will be called in subsequent patches.
>>
>> Logging follows the specifications found on the following page:
>>
>> http://www.trustedcomputinggroup.org/resources/pc_client_work_group_specific_implementation_specification_for_conventional_bios
>>
>> Signed-off-by: Stefan Berger <stefanb at linux.vnet.ibm.com>
>> ---
...
>> +/*
>> + * Add a measurement to the log. Creates two log entries
>> + *
>> + * Input parameter:
>> + *  bootcd : 0: MBR of hdd, 1: boot image, 2: boot catalog of El Torito
>> + *  addr   : address where the IP data are located
>> + *  length : IP data length in bytes
>> + */
>> +uint32_t tpm_ipl(enum ipltype bootcd, const uint8_t *addr, uint32_t length)
>> +{
>> +	uint32_t rc;
>> +	const char *string;
>> +
>> +	dprintf("tpm_ipl: bootcd = %d, addr = %p, length = 0x%x\n",
>> +		bootcd, addr, length);
>> +
>> +	if (!has_working_tpm())
>> +		return TCGBIOS_GENERAL_ERROR;
>> +
>> +	switch (bootcd) {
>> +	case IPL_EL_TORITO_1:
>> +		/* specs: see section 'El Torito' */
>> +		string = "EL TORITO IPL";
>> +		rc = tpm_add_measurement_to_log(4, EV_IPL,
>> +						string, strlen(string),
>> +						addr, length);
>> +	break;
>> +
>> +	case IPL_EL_TORITO_2:
>> +		/* specs: see section 'El Torito' */
>> +		string = "BOOT CATALOG";
>> +		rc = tpm_add_measurement_to_log(5, EV_IPL_PARTITION_DATA,
>> +						string, strlen(string),
>> +						addr, length);
>> +	break;
>> +
> 
> Is EL_TORITO_X part of ISO9660 cdrom spec?

As far as I know, El Torito booting is not used on powerpc - we use
CHRP/PAPR bootinfo.txt style booting instead.

 Thomas



More information about the SLOF mailing list