Home
last modified time | relevance | path

Searched hist:"21 a77e08921a13ac4adc523a136d829333a854f1" (Results 1 – 1 of 1) sorted by relevance

/rk3399_ARM-atf/drivers/partition/
H A Dpartition.c21a77e08921a13ac4adc523a136d829333a854f1 Thu Jul 04 11:33:15 UTC 2024 Chris Webb <chris@arachsys.com> fix(guid-partition): fix unaligned access in load_mbr_header()

load_mbr_header() casts an unaligned pointer to (mbr_entry_t *) then
dereferences struct members with non-trivial alignment requirements.

This causes a bl2 with BOOT_DEVICE=emmc to hang when compiled with clang
18.1.5, although it works when compiled with gcc 14.1.0. Presumably gcc's
-mstrict-align papers over the undefined behaviour whereas clang's doesn't.

Replace the unaligned cast with a safe memcpy() into an mbr_entry_t.

Signed-off-by: Chris Webb <chris@arachsys.com>
Change-Id: Iefd4dac7e390ddf369b8dacdbaf14e599118f91d