]> git.ipfire.org Git - thirdparty/hostap.git/commit
trace: Use explicit alignment requirements to avoid misalignment
authorJouni Malinen <j@w1.fi>
Tue, 7 Jul 2015 10:04:08 +0000 (13:04 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 7 Jul 2015 13:25:06 +0000 (16:25 +0300)
commite01281fccc666e121dc5846dad85327bae6e9517
tree6cf213e13f16f7983abf90d02062cad9810672fc
parentf97e3ce473d90bec34a60da5f610c00439b9c84d
trace: Use explicit alignment requirements to avoid misalignment

64-bit builds with CONFIG_WPA_TRACE=y resulted in the wpabuf pointers
getting misaligned (only 32-bit aligned) and that would result in reads
and writes of unaligned size_t values. Avoid this by indicating explicit
alignment requirement for wpabuf_trace to 8 octets (i.e., there will be
extra four octets of padding in case of 64-bit builds).

Similarly, struct os_alloc_trace resulted in some potential misalignment
cases, e.g., when CONFIG_ACS=y uses a 'long double' variable within
struct hostapd_channel_data. Avoid misalignment issues with explicit
alignment indication.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/utils/os_unix.c
src/utils/wpabuf.c