Commit 13636080 authored by Mark Brown's avatar Mark Brown Committed by yanhaitao
Browse files

arm64/fpsimd: Clear SME state in the target task when setting the VL

mainline inclusion
from mainline-v6.5-rc5
commit c9bb40b7
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8E73O
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c9bb40b7f786662e33d71afe236442b0b61f0446



-------------------------------------------------

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: e12310a0 ("arm64/sme: Implement ptrace support for streaming mode SVE registers")
Reported-by: default avatarDavid Spickett <David.Spickett@arm.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-tif-sme-v1-1-88312fd6fbfd@kernel.org


Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarWang ShaoBo <bobo.shaobowang@huawei.com>
parent a811101d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment