Commit 958a9468 authored by Mark Rutland's avatar Mark Rutland Committed by Will Deacon
Browse files

FROMGIT: arm64/fpsimd: ptrace: Save task state before generating SVE header



As sve_init_header_from_task() consumes the saved value of PSTATE.SM and
the saved fp_type, both must be saved before the header is generated.

When generating a coredump for the current task, sve_get_common() calls
sve_init_header_from_task() before saving the task's state. Consequently
the header may be bogus, and the contents of the regset may be
misleading.

Fix this by saving the task's state before generting the header.

Fixes: e12310a0 ("arm64/sme: Implement ptrace support for streaming mode SVE registers")
Fixes: b017a0ce ("arm64/ptrace: Use saved floating point state type to determine SVE layout")
Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Spickett <david.spickett@arm.com>
Cc: Luis Machado <luis.machado@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20250508132644.1395904-17-mark.rutland@arm.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
(cherry picked from commit 054d627c
 https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git


 for-next/sme-fixes)
Bug: 393087661
Signed-off-by: default avatarWill Deacon <willdeacon@google.com>
Change-Id: Idb971c6a96b45098aedec363b00c202f6560ab44
parent 3baa9071
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment