Skip to content

x86/fpu: copyout_from_xsaves & copyin_to_xsaves fixes

[email protected] lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2x86/fpu: move copyout_from_xsaves bounds check before the copyarch/x86/kernel/fpu/xstate.c+3 -32 replies
2/2x86/fpu: copy MXCSR & MXCSR_FLAGS with SSE/YMM statearch/x86/kernel/fpu/xstate.c+38 -15 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] x86/fpu: copyout_from_xsaves & copyin_to_xsaves fixes

There are two issues with copyout_from_xsaves and copyin_to_xsaves.

The first is a simple bounds checking issue, where the code could potentially clobber memory outside of a userspace buffer before it stops copying data.

The second is more subtle. SSE and YMM XRSTOR depend on two fields inside the legacy FP area. However, if xfeatures XFEATURE_MASK_FP is clear, those fields do not get copied around at all. Fix that.

Thanks to Dave Hansen for helping track down that second bug.