linux-stable/arch
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
..
alpha Merge branch 'expand-stack' 2023-06-28 20:35:21 -07:00
arc asm-generic updates for 6.5 2023-07-06 10:06:04 -07:00
arm asm-generic updates for 6.5 2023-07-06 10:06:04 -07:00
arm64 arm64/sme: Set new vector length before reallocating 2023-07-26 18:34:00 +01:00
csky arch/csky patches for 6.5 2023-07-01 21:12:32 -07:00
hexagon Merge branch 'expand-stack' 2023-06-28 20:35:21 -07:00
ia64 Kbuild updates for v6.5 2023-07-01 09:24:31 -07:00
loongarch asm-generic updates for 6.5 2023-07-06 10:06:04 -07:00
m68k asm-generic updates for 6.5 2023-07-06 10:06:04 -07:00
microblaze slab updates for 6.5 2023-06-29 16:34:12 -07:00
mips - fixes for KVM 2023-07-09 10:02:49 -07:00
nios2 slab updates for 6.5 2023-06-29 16:34:12 -07:00
openrisc Merge branch 'expand-stack' 2023-06-28 20:35:21 -07:00
parisc parisc: syscalls: Avoid compiler warnings with W=1 2023-07-03 18:56:03 +02:00
powerpc powerpc fixes for 6.5 #2 2023-07-07 10:00:30 -07:00
riscv RISC-V Patches for the 6.5 Merge Window, Part 2 2023-07-07 10:07:19 -07:00
s390 s390 updates for 6.5 merge window part 2 2023-07-06 13:18:30 -07:00
sh sh updates for v6.5 2023-07-05 21:45:32 -07:00
sparc drm fixes for 6.5-rc1 2023-07-06 22:42:54 -07:00
um Kbuild updates for v6.5 2023-07-01 09:24:31 -07:00
x86 - Do FPU AP initialization on Xen PV too which got missed by the recent 2023-07-09 10:13:32 -07:00
xtensa powerpc updates for 6.5 2023-06-30 09:20:08 -07:00
.gitignore
Kconfig - Arnd Bergmann has fixed a bunch of -Wmissing-prototypes in 2023-06-28 10:59:38 -07:00