From f864504d11cb9b48d5db233ad5a0d1c2ef10ec23 Mon Sep 17 00:00:00 2001 From: Curtis Malainey Date: Tue, 3 Sep 2024 16:44:35 -0700 Subject: [PATCH] posix: align mailboxes Using unaligned mailboxes with UBSAN causes fuzzing failures with aligned data structures Signed-off-by: Curtis Malainey --- src/platform/posix/posix.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform/posix/posix.c b/src/platform/posix/posix.c index f8024cb0dcca..50ca47510a30 100644 --- a/src/platform/posix/posix.c +++ b/src/platform/posix/posix.c @@ -9,10 +9,10 @@ #include #include -uint8_t posix_hostbox[MAILBOX_HOSTBOX_SIZE]; -uint8_t posix_dspbox[MAILBOX_DSPBOX_SIZE]; -uint8_t posix_stream[MAILBOX_STREAM_SIZE]; -uint8_t posix_trace[MAILBOX_TRACE_SIZE]; +uint8_t posix_hostbox[MAILBOX_HOSTBOX_SIZE] __aligned(8); +uint8_t posix_dspbox[MAILBOX_DSPBOX_SIZE] __aligned(8); +uint8_t posix_stream[MAILBOX_STREAM_SIZE] __aligned(8); +uint8_t posix_trace[MAILBOX_TRACE_SIZE] __aligned(8); /* This seems like a vestige. Existing Zephyr platforms are emitting * these markers in their linker scripts, and wrapper.c code iterates