lkml.org 
[lkml]   [2019]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 17/24] x86/fpu: Always store the registers in copy_fpstate_to_sigframe()
On Thu, 21 Mar 2019, Sebastian Andrzej Siewior wrote:
> @@ -169,9 +155,15 @@ int copy_fpstate_to_sigframe(void __user *buf, void __user *buf_fx, int size)
> sizeof(struct user_i387_ia32_struct), NULL,
> (struct _fpstate_32 __user *) buf) ? -1 : 1;
>
> - /* Save the live register state to the user directly. */
> - if (copy_fpregs_to_sigframe(buf_fx))
> - return -1;
> + copy_fpregs_to_fpstate(fpu);
> +
> + if (using_compacted_format()) {
> + copy_xstate_to_user(buf_fx, xsave, 0, size);

This needs to check the return value.

> + } else {
> + fpstate_sanitize_xstate(fpu);
> + if (__copy_to_user(buf_fx, xsave, fpu_user_xstate_size))
> + return -1;
> + }

Thanks,

tglx

\
 
 \ /
  Last update: 2019-03-31 18:55    [W:0.144 / U:11.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site