linux-stable/arch/arm64
Mark Brown 99255a2b68 arm64/ptrace: Don't enable SVE when setting streaming SVE
commit 045aecdfcb upstream.

Systems which implement SME without also implementing SVE are
architecturally valid but were not initially supported by the kernel,
unfortunately we missed one issue in the ptrace code.

The SVE register setting code is shared between SVE and streaming mode
SVE. When we set full SVE register state we currently enable TIF_SVE
unconditionally, in the case where streaming SVE is being configured on a
system that supports vanilla SVE this is not an issue since we always
initialise enough state for both vector lengths but on a system which only
support SME it will result in us attempting to restore the SVE vector
length after having set streaming SVE registers.

Fix this by making the enabling of SVE conditional on setting SVE vector
state. If we set streaming SVE state and SVE was not already enabled this
will result in a SVE access trap on next use of normal SVE, this will cause
us to flush our register state but this is fine since the only way to
trigger a SVE access trap would be to exit streaming mode which will cause
the in register state to be flushed anyway.

Fixes: e12310a0d3 ("arm64/sme: Implement ptrace support for streaming mode SVE registers")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-ssve-no-sve-v1-1-49df214bfb3e@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
[Fix up backport -- broonie]
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 12:08:26 +02:00
..
boot arm64: dts: stratix10: fix incorrect I2C property for SCL signal 2023-08-11 12:08:20 +02:00
configs This update includes the following changes: 2022-10-10 13:04:25 -07:00
crypto crypto: arm64/aes-neonbs - fix crash with CFI enabled 2023-05-11 23:03:02 +09:00
hyperv hyperv: simplify and rename generate_guest_id 2022-09-28 13:36:56 +00:00
include arm64: sme: Use STR P to clear FFR context field in streaming SVE mode 2023-07-19 16:21:45 +02:00
kernel arm64/ptrace: Don't enable SVE when setting streaming SVE 2023-08-11 12:08:26 +02:00
kvm arm64: errata: Mitigate Ampere1 erratum AC03_CPU_38 at stage-2 2023-08-03 10:23:54 +02:00
lib Networking changes for 6.0. 2022-08-03 16:29:08 -07:00
mm arm64/mm: Convert to using lock_mm_and_find_vma() 2023-07-01 13:16:24 +02:00
net bpf, arm64: Fix BTI type used for freplace attached functions 2023-07-27 08:50:44 +02:00
tools arm64: errata: Mitigate Ampere1 erratum AC03_CPU_38 at stage-2 2023-08-03 10:23:54 +02:00
xen
Kbuild
Kconfig arm64: errata: Mitigate Ampere1 erratum AC03_CPU_38 at stage-2 2023-08-03 10:23:54 +02:00
Kconfig.debug
Kconfig.platforms ARM: SoC code changes for 6.1 2022-10-06 11:22:25 -07:00
Makefile Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00