linux/arch/arm64
Mark Brown 05d881b85b arm64/sme: Set new vector length before reallocating
As part of fixing the allocation of the buffer for SVE state when changing
SME vector length we introduced an immediate reallocation of the SVE state,
this is also done when changing the SVE vector length for consistency.
Unfortunately this reallocation is done prior to writing the new vector
length to the task struct, meaning the allocation is done with the old
vector length and can lead to memory corruption due to an undersized buffer
being used.

Move the update of the vector length before the allocation to ensure that
the new vector length is taken into account.

For some reason this isn't triggering any problems when running tests on
the arm64 fixes branch (even after repeated tries) but is triggering
issues very often after merge into mainline.

Fixes: d4d5be94a8 ("arm64/fpsimd: Ensure SME storage is allocated after SVE VL changes")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20230726-arm64-fix-sme-fix-v1-1-7752ec58af27@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2023-07-26 18:34:00 +01:00
..
boot ARM: New SoC support for 6.5 2023-06-29 15:11:17 -07:00
configs ARM: SoC defconfig changes for 6.5 2023-06-29 15:26:45 -07:00
crypto crypto: arm64/sha256-glue - Include module.h 2023-05-19 20:56:59 +08:00
hyperv arm64/hyperv: Use CPUHP_AP_HYPERV_ONLINE state to fix CPU online sequencing 2023-06-17 23:09:47 +00:00
include asm-generic updates for 6.5 2023-07-06 10:06:04 -07:00
kernel arm64/sme: Set new vector length before reallocating 2023-07-26 18:34:00 +01:00
kvm ARM64: 2023-07-03 15:32:22 -07:00
lib arm64: xor-neon: mark xor_arm64_neon_*() static 2023-05-25 17:44:01 +01:00
mm arm64: mm: Make hibernation aware of KFENCE 2023-07-20 11:44:50 +01:00
net bpf, arm64: Support struct arguments in the BPF trampoline 2023-05-15 21:17:22 +02:00
tools arm64: Fix HFGxTR_EL2 field naming 2023-07-13 10:15:38 +01:00
xen
Kbuild
Kconfig ARM64: 2023-07-03 15:32:22 -07:00
Kconfig.debug
Kconfig.platforms STM32 STM32MP25 for v6.5, round 1 2023-06-20 22:28:44 +02:00
Makefile arm64 updates for 6.3: 2023-02-21 15:27:48 -08:00