From 28fcc0be32b0b7d7f27282610cde360bfaba0084 Mon Sep 17 00:00:00 2001 From: Sahil Shakil Malpekar Date: Thu, 22 Oct 2026 21:54:20 +0530 Subject: [PATCH] fix(exerciser): correct DMA buffer sizes in e026 Allocate and initialize buffers using MAX_LEN to prevent out-of-bounds accesses with one or two exercisers. Signed-off-by: Sahil Shakil Malpekar Change-Id: I149ae1609bf1fe782ba01ecfd30b4c2e9c9ff94d --- test_pool/exerciser/e026.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test_pool/exerciser/e026.c b/test_pool/exerciser/e026.c index 3b904fbb..271a877e 100644 --- a/test_pool/exerciser/e026.c +++ b/test_pool/exerciser/e026.c @@ -84,14 +84,14 @@ payload(void *arg) * pgt_base_array = array of data on which memeory operations will be performed * pgt_base = array of data against which we will verify the final values */ - pgt_base_array = val_aligned_alloc(MEM_ALIGN_4K, sizeof(uint64_t) * num_exercisers); + pgt_base_array = val_aligned_alloc(MEM_ALIGN_4K, MAX_LEN); if (!pgt_base_array) { val_print(ERROR, "\n mem alloc failure for pgt_base_array"); val_set_status(pe_index, RESULT_FAIL(01)); return; } - pgt_base = val_aligned_alloc(MEM_ALIGN_4K, sizeof(uint64_t) * num_exercisers); + pgt_base = val_aligned_alloc(MEM_ALIGN_4K, MAX_LEN); if (!pgt_base) { val_print(ERROR, "\n mem alloc failure for pgt_base"); val_set_status(pe_index, RESULT_FAIL(02)); @@ -99,8 +99,8 @@ payload(void *arg) return; } - val_memory_set(pgt_base_array, sizeof(uint64_t) * num_exercisers, 0); - val_memory_set(pgt_base, sizeof(uint64_t) * num_exercisers, 0); + val_memory_set(pgt_base_array, MAX_LEN, 0); + val_memory_set(pgt_base, MAX_LEN, 0); for (instance = 0; instance < num_exercisers; ++instance) {