summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjdike <jdike>2004-02-16 00:11:44 +0000
committerjdike <jdike>2004-02-16 00:11:44 +0000
commit6f2f61c1f89d3fc57374dae79cbbbddd3f87244b (patch)
tree0d679b812290bc4d778e47da01e5ffae9428bd6c
parent0917a8ace8a6580c710dec56d11f42cad1e9f27f (diff)
downloaduml-history-6f2f61c1f89d3fc57374dae79cbbbddd3f87244b.tar.gz
arch_handle_signal now uses copy_from_user to read the faulting instruction.
-rw-r--r--arch/um/sys-i386/bugs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/um/sys-i386/bugs.c b/arch/um/sys-i386/bugs.c
index b453e2f..d5e0ba9 100644
--- a/arch/um/sys-i386/bugs.c
+++ b/arch/um/sys-i386/bugs.c
@@ -183,15 +183,16 @@ void arch_check_bugs(void)
int arch_handle_signal(int sig, union uml_pt_regs *regs)
{
- unsigned long ip;
+ unsigned char tmp[2];
/* This is testing for a cmov (0x0f 0x4x) instruction causing a
* SIGILL in init.
*/
if((sig != SIGILL) || (TASK_PID(get_current()) != 1)) return(0);
- ip = UPT_IP(regs);
- if((*((char *) ip) != 0x0f) || ((*((char *) (ip + 1)) & 0xf0) != 0x40))
+ if (copy_from_user_proc(tmp, (void *) UPT_IP(regs), 2))
+ panic("SIGILL in init, could not read instructions!\n");
+ if((tmp[0] != 0x0f) || ((tmp[1] & 0xf0) != 0x40))
return(0);
if(host_has_cmov == 0)