This is a note to let you know that I've just added the patch titled arm64/fpsimd: Clear SME state in the target task when setting the VL to the 6.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arm64-fpsimd-clear-sme-state-in-the-target-task-when-setting-the-vl.patch and it can be found in the queue-6.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From c9bb40b7f786662e33d71afe236442b0b61f0446 Mon Sep 17 00:00:00 2001 From: Mark Brown <broonie@xxxxxxxxxx> Date: Thu, 3 Aug 2023 00:46:39 +0100 Subject: arm64/fpsimd: Clear SME state in the target task when setting the VL From: Mark Brown <broonie@xxxxxxxxxx> commit c9bb40b7f786662e33d71afe236442b0b61f0446 upstream. When setting SME vector lengths we clear TIF_SME to reenable SME traps, doing a reallocation of the backing storage on next use. We do this using clear_thread_flag() which operates on the current thread, meaning that when setting the vector length via ptrace we may both not force traps for the target task and force a spurious flush of any SME state that the tracing task may have. Clear the flag in the target task. Fixes: e12310a0d30f ("arm64/sme: Implement ptrace support for streaming mode SVE registers") Reported-by: David Spickett <David.Spickett@xxxxxxx> Signed-off-by: Mark Brown <broonie@xxxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-tif-sme-v1-1-88312fd6fbfd@xxxxxxxxxx Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/arm64/kernel/fpsimd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -910,7 +910,7 @@ int vec_set_vector_length(struct task_st */ task->thread.svcr &= ~(SVCR_SM_MASK | SVCR_ZA_MASK); - clear_thread_flag(TIF_SME); + clear_tsk_thread_flag(task, TIF_SME); free_sme = true; } } Patches currently in stable-queue which might be from broonie@xxxxxxxxxx are queue-6.4/net-netsec-ignore-phy-mode-on-synquacer-in-dt-mode.patch queue-6.4/arm64-ptrace-flush-fp-state-when-setting-zt0.patch queue-6.4/arm64-fpsimd-sync-fpsimd-state-with-sve-for-sme-only-systems.patch queue-6.4/arm64-fpsimd-clear-sme-state-in-the-target-task-when-setting-the-vl.patch queue-6.4/arm64-ptrace-don-t-enable-sve-when-setting-streaming-sve.patch queue-6.4/arm64-fpsimd-sync-and-zero-pad-fpsimd-state-for-streaming-sve.patch