From cd992858dd47cf865b2a64b8419ce5ceda4c6b05 Mon Sep 17 00:00:00 2001 From: Curtis Malainey Date: Tue, 27 Oct 2020 16:45:23 -0700 Subject: [PATCH] trace: enforce mailbox size If we are fuzzing we can get the trace system into a state where it tries flush dma and overshoot the mailbox boundary. Signed-off-by: Curtis Malainey --- src/trace/dma-trace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/trace/dma-trace.c b/src/trace/dma-trace.c index 61c5acff0147..6fa9d2d02529 100644 --- a/src/trace/dma-trace.c +++ b/src/trace/dma-trace.c @@ -385,6 +385,8 @@ void dma_trace_flush(void *t) (char *)buffer->addr; } + size = MIN(size, MAILBOX_TRACE_SIZE); + /* invalidate trace data */ dcache_invalidate_region((void *)t, size);