Re: [PATCH 21/24] x86/fpu: Let __fpu__restore_sig() restore the !32bit+fxsr frame from kernel memory

From: Sebastian Andrzej Siewior
Date: Fri Mar 22 2019 - 10:55:10 EST


On 2019-03-21 21:26:29 [+0100], To linux-kernel@xxxxxxxxxxxxxxx wrote:
> diff --git a/arch/x86/kernel/fpu/signal.c b/arch/x86/kernel/fpu/signal.c
> index 5a467a381245c..052a16c96218f 100644
> --- a/arch/x86/kernel/fpu/signal.c
> +++ b/arch/x86/kernel/fpu/signal.c
> @@ -297,28 +298,63 @@ static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size)
â
> + } else {
> + ret = __copy_from_user(&state->fsave, buf_fx, state_size);
> + if (ret)
> + goto err_out;
> + ret = copy_users_to_fregs(buf_fx);

This needs to become
ret = copy_users_to_fregs(&fpu->state.fsave);

here and in the follow up patch (fixing locally)

> + }

Sebastian