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

FROMGIT: arm64/fpsimd: ptrace: Mandate SVE payload for streaming-mode state



When a task has PSTATE.SM==1, reads of NT_ARM_SSVE are required to
always present a header with SVE_PT_REGS_SVE, and register data in SVE
format. Reads of NT_ARM_SSVE must never present register data in FPSIMD
format. Within the kernel, we always expect streaming SVE data to be
stored in SVE format.

Currently a user can write to NT_ARM_SSVE with a header presenting
SVE_PT_REGS_FPSIMD rather than SVE_PT_REGS_SVE, placing the task's
FPSIMD/SVE data into an invalid state.

To fix this we can either:

(a) Forbid such writes.
(b) Accept such writes, and immediately convert data into SVE format.

Take the simple option and forbid such writes.

Fixes: e12310a0 ("arm64/sme: Implement ptrace support for streaming mode SVE registers")
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>
Reviewed-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20250508132644.1395904-19-mark.rutland@arm.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
(cherry picked from commit f916dd32
 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: I89dbc53d7f51b41bc1387327f3f874efccc8662a
parent 1d05f826
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment