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 <cujomalainey@chromium.org>
This commit is contained in:
Curtis Malainey 2020-10-27 16:45:23 -07:00 committed by Liam Girdwood
parent 60dfaa7ee3
commit 221189d3f7
1 changed files with 2 additions and 0 deletions

View File

@ -401,6 +401,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);