From: Al Viro <viro@ftp.linux.org.uk>
To: richard@nod.at
Cc: user-mode-linux-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Subject: [PATCH 09/91] um: don't rely on sc.fpstate not having been reassigned prior to rt_sigreturn()
Date: Thu, 18 Aug 2011 20:00:29 +0100 [thread overview]
Message-ID: <E1Qu7pN-0007Th-6h@ZenIV.linux.org.uk> (raw)
native rt_sigreturn() doesn't...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
arch/um/sys-x86_64/signal.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c
index 581b64d..ccfa554 100644
--- a/arch/um/sys-x86_64/signal.c
+++ b/arch/um/sys-x86_64/signal.c
@@ -44,10 +44,10 @@ void copy_sc(struct uml_pt_regs *regs, void *from)
}
static int copy_sc_from_user(struct pt_regs *regs,
- struct sigcontext __user *from,
- struct _fpstate __user *fpp)
+ struct sigcontext __user *from)
{
struct user_i387_struct fp;
+ void __user *buf;
int err = 0;
#define GETREG(regs, regno, sc, regname) \
@@ -78,7 +78,11 @@ static int copy_sc_from_user(struct pt_regs *regs,
#undef GETREG
- err = copy_from_user(&fp, fpp, sizeof(struct user_i387_struct));
+ err = __get_user(buf, &from->fpstate);
+ if (err)
+ return 1;
+
+ err = copy_from_user(&fp, buf, sizeof(struct user_i387_struct));
if (err)
return 1;
@@ -272,8 +276,7 @@ long sys_rt_sigreturn(struct pt_regs *regs)
sigdelsetmask(&set, ~_BLOCKABLE);
set_current_blocked(&set);
- if (copy_sc_from_user(¤t->thread.regs, &uc->uc_mcontext,
- &frame->fpstate))
+ if (copy_sc_from_user(¤t->thread.regs, &uc->uc_mcontext))
goto segfault;
/* Avoid ERESTART handling */
--
1.7.2.5
reply other threads:[~2011-08-18 19:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=E1Qu7pN-0007Th-6h@ZenIV.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=richard@nod.at \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®