Module: xenomai-head
Branch: master
Commit: efa97897e0f41458837f96a17ed7d025a90110c5
URL:    
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=efa97897e0f41458837f96a17ed7d025a90110c5

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Thu Jun 30 22:37:52 2011 +0200

nucleus, x86-64: Set canonical default mayday IP

User space may invoke sys_mayday unsolicited (ABI mismatch etc.). If
mayday.eip happens to hold a random non-canonical value, sysret will
crash unexpectedly on Intel CPUs over a user stack, usually causing
double faults up to system lockups. Avoid this by initializing eip to 0.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 include/asm-x86/bits/thread_64.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/bits/thread_64.h b/include/asm-x86/bits/thread_64.h
index a6dc28c..1256798 100644
--- a/include/asm-x86/bits/thread_64.h
+++ b/include/asm-x86/bits/thread_64.h
@@ -33,6 +33,9 @@ static inline void xnarch_init_tcb(xnarchtcb_t * tcb)
        tcb->ripp = &tcb->rip;
        tcb->fpup = &tcb->i387;
        tcb->is_root = 0;
+#ifdef XNARCH_HAVE_MAYDAY
+       tcb->mayday.eip = 0;
+#endif
        /* Must be followed by xnarch_init_thread(). */
 }
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to