kernel_optimize_test/arch
Mark Brown a67e7cdbc6 arm64/sve: Use correct size when reinitialising SVE state
commit e35ac9d0b56e9efefaeeb84b635ea26c2839ea86 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-22 12:27:54 +02:00
..
alpha alpha: Send stop IPI to send to online CPUs 2021-08-12 13:22:20 +02:00
arc ARC: Fix CONFIG_STACKDEPOT 2021-09-03 10:09:21 +02:00
arm ARM: tegra: tamonten: Fix UART pad setting 2021-09-18 13:40:28 +02:00
arm64 arm64/sve: Use correct size when reinitialising SVE state 2021-09-22 12:27:54 +02:00
c6x
csky csky: syscache: Fixup duplicate cache flush 2021-07-14 16:56:52 +02:00
h8300 h8300: fix PREEMPTION build, TI_PRE_COUNT undefined 2021-02-17 11:02:28 +01:00
hexagon hexagon: use common DISCARDS macro 2021-07-20 16:05:53 +02:00
ia64 mm/page_alloc: fix memory map initialization for descending nodes 2021-07-25 14:36:18 +02:00
m68k m68knommu: only set CONFIG_ISA_DMA_API for ColdFire sub-arch 2021-09-18 13:40:31 +02:00
microblaze local64.h: make <asm/local64.h> mandatory 2021-01-12 20:18:16 +01:00
mips MIPS: Malta: fix alignment of the devicetree buffer 2021-09-18 13:40:16 +02:00
nds32 nds32: fix up stack guard gap 2021-07-28 14:35:46 +02:00
nios2 nios2: fixed broken sys_clone syscall 2021-03-04 11:38:16 +01:00
openrisc openrisc: don't printk() unconditionally 2021-09-18 13:40:13 +02:00
parisc parisc: fix crash with signals and alloca 2021-09-18 13:40:35 +02:00
powerpc KVM: PPC: Fix clearing never mapped TCEs in realmode 2021-09-18 13:40:16 +02:00
riscv riscv: Fixup patch_text panic in ftrace 2021-09-03 10:09:29 +02:00
s390 s390/pv: fix the forcing of the swiotlb 2021-09-18 13:40:36 +02:00
sh sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
sparc bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2021-08-04 12:46:44 +02:00
um um: fix error return code in winch_tramp() 2021-07-20 16:05:51 +02:00
x86 xen: reset legacy rtc flag for PV domU 2021-09-22 12:27:54 +02:00
xtensa xtensa: ISS: don't panic in rs_init 2021-09-18 13:40:22 +02:00
.gitignore
Kconfig fanotify: Fix sys_fanotify_mark() on native x86-32 2021-01-17 14:16:59 +01:00