[SLOF] [PATCH v3 11/17] Measure the static core root of trust for measurements

Hon c Lo lo1 at us.ibm.com
Fri Mar 4 14:46:18 AEDT 2016


Hi Stefan,

>  }
>
> +uint32_t tpm_measure_scrtm(void)
> +{
> +   uint32_t rc;
> +
> +   extern long print_version, print_version_end;
> +   extern long _slof_data, _slof_data_end;
> +
How are we getting the storage of all these variables declared?  Base on
the C codes alone, there is no memory allocated with the 'extern' keywords
used here and I expected compiler errors on the following 4 lines of code
for referencing them.


> +   char *version_start = (char *)&print_version;
> +   uint32_t version_length = (long)&print_version_end -
(long)&print_version;
> +
> +   char *slof_start = (char *)&_slof_data;
> +   uint32_t slof_length = (long)&_slof_data_end - (long)&_slof_data;
> +
> +   const char *scrtm = "S-CRTM Contents";
> +
> +   dprintf("Measure S-CRTM Version: addr = %p, length = %d\n",
> +      version_start, version_length);
> +
> +   rc = tpm_add_measurement_to_log(0, EV_S_CRTM_VERSION,
> +               version_start, version_length,
> +               (uint8_t *)version_start,
> +               version_length);
> +
> +   if (rc)
> +      return rc;
> +
> +   dprintf("Measure S-CRTM Content: start = %p, length = %d\n",
> +      &slof_start, slof_length);
> +
> +   rc = tpm_add_measurement_to_log(0, EV_S_CRTM_CONTENTS,
> +               scrtm, strlen(scrtm),
> +               (uint8_t *)slof_start, slof_length);
> +
> +   return rc;
> +}
> +

Regards,
Vicky

Hon Ching (Vicky) Lo
Linux Security Development
Notes:  lo1 at us.ibm.com
Office:  845-435-8946 (T/L: 295-8946)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/slof/attachments/20160303/2e9c1029/attachment.html>


More information about the SLOF mailing list