]> git.itanic.dy.fi Git - linux-stable/commit
arm64/ptrace: Use saved floating point state type to determine SVE layout
authorMark Brown <broonie@kernel.org>
Mon, 25 Mar 2024 16:35:21 +0000 (16:35 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:38:19 +0000 (16:38 +0200)
commitb3412bb8682ac1c7dd8e4f696c5e1b2ac92d154d
treef1b2d060892a294c68190e4c5b626839a1652f29
parent5b16d904e910183181b9d90efa957c787a8ac91b
arm64/ptrace: Use saved floating point state type to determine SVE layout

commit b017a0cea627fcbe158fc2c214fe893e18c4d0c4 upstream.

The SVE register sets have two different formats, one of which is a wrapped
version of the standard FPSIMD register set and another with actual SVE
register data. At present we check TIF_SVE to see if full SVE register
state should be provided when reading the SVE regset but if we were in a
syscall we may have saved only floating point registers even though that is
set.

Fix this and simplify the logic by checking and using the format which we
recorded when deciding if we should use FPSIMD or SVE format.

Fixes: 8c845e273104 ("arm64/sve: Leave SVE enabled on syscall if we don't context switch")
Cc: <stable@vger.kernel.org> # 6.2.x
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240325-arm64-ptrace-fp-type-v1-1-8dc846caf11f@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/ptrace.c