linux-stable/arch/arm64
Mark Brown e35ac9d0b5 arm64/sve: Use correct size when reinitialising SVE state
When we need a buffer for SVE register state we call sve_alloc() to make
sure that one is there. In order to avoid repeated allocations and frees
we keep the buffer around unless we change vector length and just memset()
it to ensure a clean register state. The function that deals with this
takes the task to operate on as an argument, however in the case where we
do a memset() we initialise using the SVE state size for the current task
rather than the task passed as an argument.

This is only an issue in the case where we are setting the register state
for a task via ptrace and the task being configured has a different vector
length to the task tracing it. In the case where the buffer is larger in
the traced process we will leak old state from the traced process to
itself, in the case where the buffer is smaller in the traced process we
will overflow the buffer and corrupt memory.

Fixes: bc0ee47603 ("arm64/sve: Core task context handling")
Cc: <stable@vger.kernel.org> # 4.15.x
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210909165356.10675-1-broonie@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-09-16 17:34:46 +01:00
..
boot This is the bulk of pin control changes for the v5.15 kernel cycle, 2021-09-02 14:22:56 -07:00
configs arm64: defconfig: Enable Qualcomm MSM8996 CPU clock driver 2021-08-04 15:02:54 -05:00
crypto crypto: arm64/sm4-ce - Make dependent on sm4 library instead of sm4-generic 2021-07-30 10:58:30 +08:00
hyperv arm64: hyperv: Initialize hypervisor on boot 2021-08-04 16:54:36 +00:00
include arch: remove compat_alloc_user_space 2021-09-08 15:32:35 -07:00
kernel arm64/sve: Use correct size when reinitialising SVE state 2021-09-16 17:34:46 +01:00
kvm ARM: 2021-09-07 13:40:51 -07:00
lib arch: remove compat_alloc_user_space 2021-09-08 15:32:35 -07:00
mm arm64 fixes: 2021-09-10 11:58:20 -07:00
net bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2021-07-29 00:20:56 +02:00
tools
xen
Kbuild arm64: hyperv: Add Hyper-V hypercall and register access utilities 2021-08-04 16:54:36 +00:00
Kconfig Tracing updates for 5.15: 2021-09-05 11:50:41 -07:00
Kconfig.debug
Kconfig.platforms Merge branch 'arm/fixes' into arm/soc 2021-07-09 10:46:02 -07:00
Makefile arm64 updates for 5.15: 2021-09-01 15:04:29 -07:00