]> www.infradead.org Git - users/jedix/linux-maple.git/commit
arm64/fpsimd: ptrace: Save task state before generating SVE header
authorMark Rutland <mark.rutland@arm.com>
Thu, 8 May 2025 13:26:36 +0000 (14:26 +0100)
committerWill Deacon <will@kernel.org>
Thu, 8 May 2025 14:29:11 +0000 (15:29 +0100)
commit054d627c5554bdd38228174b275d62113124e3ad
tree9a12a82dabe1fc92f075570c96ff1cf540cf4763
parentb87c8c4aca1163ae4791507089007863e9c3ca1b
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: e12310a0d30f ("arm64/sme: Implement ptrace support for streaming mode SVE registers")
Fixes: b017a0cea627 ("arm64/ptrace: Use saved floating point state type to determine SVE layout")
Signed-off-by: Mark 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: Will Deacon <will@kernel.org>
arch/arm64/kernel/ptrace.c