Changes
Started by upstream project gerrit-osmo-pcu #852
Started 7 hr 11 min ago
Queued 11 sec
Took 10 sec
on build4-deb12build-ansible
llc: fix misaligned MetaInfo access in msgb headroom
struct MetaInfo (two struct timespec) requires 8-byte alignment on
some ABIs (e.g. 32-bit ARM with a 64-bit time_t), but msgb->head is
only guaranteed byte alignment: struct msgb's own size before the
flexible _data[] member is not a multiple of 8, so storing MetaInfo
directly at msg->head can misalign it, triggering UBSan
-fsanitize=alignment reports wherever recv_time/expire_time
are subsequently dereferenced.
Reserve extra headroom for worst-case alignment padding and
store/retrieve MetaInfo via the next 8-byte-aligned address within
that headroom instead of assuming msg->head itself is suitably
aligned.
Change-Id: I39abce68c5678704eea2ad1e330419f645aa4cfd
Related: OS#6858
struct MetaInfo (two struct timespec) requires 8-byte alignment on
some ABIs (e.g. 32-bit ARM with a 64-bit time_t), but msgb->head is
only guaranteed byte alignment: struct msgb's own size before the
flexible _data[] member is not a multiple of 8, so storing MetaInfo
directly at msg->head can misalign it, triggering UBSan
-fsanitize=alignment reports wherever recv_time/expire_time
are subsequently dereferenced.
Reserve extra headroom for worst-case alignment padding and
store/retrieve MetaInfo via the next 8-byte-aligned address within
that headroom instead of assuming msg->head itself is suitably
aligned.
Change-Id: I39abce68c5678704eea2ad1e330419f645aa4cfd
Related: OS#6858