vboot: Fix potential alignment issue reading FWMP
RollbackFwmpRead() assumed that a uint8 array on the stack would be
aligned sufficiently for typecasting to struct RollbackSpaceFwmp and
accessing its members.
This was true on x86 (where unaligned accesses work fine) and probably
harmless on other platforms (since RollbackSpaceFwmp is
__attribute__(packed). But it's cleaner to switch to using a union of
the buffer and struct, since that will provide the proper alignment.
BRANCH=baytrail and newer platforms
TEST=make -j runtests
Signed-off-by: Randall Spangler <email@example.com>
Commit-Ready: Dan Shi <firstname.lastname@example.org>
Reviewed-by: Daisuke Nojiri <email@example.com>
(cherry picked from commit b3a625f8fef1768d78eab4cfaaea270cb3fbd0c3)
1 file changed