From: Richard Weinberger <richard@nod.at>
To: Eli Cooper <elicooper@gmx.com>,
user-mode-linux-devel@lists.sourceforge.net
Cc: Jeff Dike <jdike@addtoit.com>
Subject: Re: [uml-devel] [PATCH] um: fix FPU register double-restore after sigreturn
Date: Fri, 18 Mar 2016 09:20:49 +0100 [thread overview]
Message-ID: <56EBBA61.4090405@nod.at> (raw)
In-Reply-To: <56EB5CC9.1030601@gmx.com>
Eli,
Am 18.03.2016 um 02:41 schrieb Eli Cooper:
> Hi Richard,
>
> On 2016/3/18 6:21, Richard Weinberger wrote:
>> Where exactly are the FPU regs restored in the sigregturn case?
>> Not sure if I fully understand the error scenario.
>
> Well, sys_sigreturn() or sys_rt_sigreturn() calls copy_sc_from_user(),
> and the latter copies fpstate, which is the saved FPU state before the
> signal handler was invoked, from sigframe and restores it.
> That is correct: after returning from the signal handler, the process is
> in the same FPU state before it was invoked.
>
> However, userspace() saves the FPU state before a system call and
> restores it after. In the sigreturn case, after sys_sigreturn() returns,
> which has already made FPU in the right state, userspace() overwrites it
> by making it in the state prior to the sigreturn was called (i.e., the
> signal handler's state). That leaves the process in question a corrupted
> FPU state.
Okay. That's what I thought/feared.
I wonder how other architectures handle this case?
Ideally I'd like to avoid as much extra code as possible in userspace().
Thanks,
//richard
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next prev parent reply other threads:[~2016-03-18 8:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-16 1:25 [uml-devel] [PATCH] um: fix FPU register double-restore after sigreturn Eli Cooper
2016-03-17 22:21 ` Richard Weinberger
2016-03-18 1:41 ` Eli Cooper
2016-03-18 8:20 ` Richard Weinberger [this message]
2016-03-18 16:13 ` Eli Cooper
2016-03-18 16:42 ` Jeff Dike
2016-03-18 20:12 ` Richard Weinberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56EBBA61.4090405@nod.at \
--to=richard@nod.at \
--cc=elicooper@gmx.com \
--cc=jdike@addtoit.com \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.