[go: up one dir, main page]

Menu

#215 Core dump caused by misaligned pointer in tcs get_tpm_metrics()

Bug
open
nobody
None
5
2017-08-08
2017-08-08
No

Core dump caused by misaligned pointer access of tpm_properties->manufacturer in tcs get_tpm_metrics().
The problem may or may not occur depending on how memory is aligned in structures.
On Oracle Solaris, character arrays are not aligned, so causes a memory fault on SPARC hardware.
The following Solaris downstream patch tcs_tcs_caps.c.patch fixes the problem and is suitable for all operating systems and compilers:

--- src/tcs/tcs_caps.c.old Wed Jun 9 13:20:44 2010
+++ src/tcs/tcs_caps.c Fri Jul 1 16:26:51 2011
@@ -149,6 +149,7 @@
{
TSS_RESULT result;
UINT32 subCap, rv = 0;
+ UINT32 manuf;

if ((result = get_current_version(&p->version)))
    goto err;

@@ -181,8 +182,9 @@

UINT32ToArray(TPM_CAP_PROP_MANUFACTURER, (BYTE *)&subCap);
if ((result = get_cap_uint32(TCPA_CAP_PROPERTY, (BYTE *)&subCap, sizeof(UINT32),
  • (UINT32 *)&p->manufacturer)))
  • (UINT32 *)&manuf)))
    goto err;
  • (void) memcpy(p->manufacturer, &manuf, sizeof (UINT32));

    result = get_max_auths(&(p->num_auths));

Originally fixed with Oracle Solaris bug 15722951 (Sun Microsystems bug 7056071) enable tcsd failed in Solaris 11.

Discussion


Log in to post a comment.