Skip to content

Changes

Started by upstream project gerrit-osmo-pcu #852
Started 13 hr ago
Queued 8.4 sec
Took 5 min 16 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
Vadim Yanitskiy at