Re: [RFC][Patch 2/5]integrity: TPM internel kernel interface

From: Harvey Harrison
Date: Wed May 28 2008 - 12:12:27 EST


On Wed, 2008-05-28 at 00:17 -0700, Andrew Morton wrote:
> On Fri, 23 May 2008 11:03:41 -0400 Mimi Zohar <zohar@xxxxxxxxxxxxxxxxxx> wrote:
> > + index = cpu_to_be32(pcr_idx);
> > + memcpy(data + 10, &index, 4);
> > + rc = tpm_transmit(chip, data, sizeof(data));
> > + if (rc > 0)
> > + rc = be32_to_cpu(*((u32 *) (data + 6)));
>
> An unaligned access. What architectures is this hardware available on?
>
> Harvey might be able to suggest a neater and better way of doing this?
> At least a get_unaligned(), I think?
>

rc = get_unaligned_be32((__be32 *)(data + 6));

If it was aligned:

rc = be32_to_cpup((__be32 *)(data + 6));

Cheers,

Harvey



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/