On Wed, Oct 01, 2025 at 11:02:03PM +0200, Ard Biesheuvel wrote:
However, dropping that flag allows the compiler to use FPU and SIMD registers in other ways too, and for this reason, arm64 only permits doing so in strictly controlled contexts, i.e., isolated compilation units that get called from inside a kernel_neon_begin() and kernel_neon_end() pair.
The users of the generic kernel mode FPU API lack such strict checks, and this may result in userland FP/SIMD state to get corrupted, given that touching FP/SIMD registers outside of a kernel_neon_begin/end pair does not fault, but silently operates on the userland state without preserving it.
Oh dear, that's nasty - I didn't see the patch when it was going in:
Reviewed-by: Mark Brown broonie@kernel.org