From 6fd4dc353c8c92c1ddc76af34269c9b9a5f47df5 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Thu, 14 Aug 2025 10:47:34 -0700 Subject: [PATCH] elk/algebraic: Protect SHUFFLE from OOB indices Akin to b67230de635 ("intel/fs: Protect opt_algebraic from OOB BROADCAST indices"), we need to protect SHUFFLE as well. Reviewed-by: Sagar Ghuge Part-of: --- src/intel/compiler/elk/elk_fs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/intel/compiler/elk/elk_fs.cpp b/src/intel/compiler/elk/elk_fs.cpp index 772f5c43673..2645a7963c7 100644 --- a/src/intel/compiler/elk/elk_fs.cpp +++ b/src/intel/compiler/elk/elk_fs.cpp @@ -2530,9 +2530,9 @@ elk_fs_visitor::opt_algebraic() inst->sources = 1; progress = true; } else if (inst->src[1].file == IMM) { + const unsigned comp = inst->src[1].ud & (inst->exec_size - 1); inst->opcode = ELK_OPCODE_MOV; - inst->src[0] = component(inst->src[0], - inst->src[1].ud); + inst->src[0] = component(inst->src[0], comp); inst->sources = 1; progress = true; }