summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2011-02-27 05:36:54 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-02-27 05:36:54 +0100
commitaa0c4071694a19b0f7de5fcaca8b1f9918e06fc8 (patch)
tree0d5bad5f1baa77fdda46ecbe476f7d55a51eb214
parenta9ad81b8d42190ff10aa0ce72bdf31bb313408b1 (diff)
Detect interrupt overflow
* i386/i386/locore.S (int_from_instack): Check %esp against _intstack, issue ud2 on stack overflow.
-rw-r--r--i386/i386/locore.S5
1 files changed, 5 insertions, 0 deletions
diff --git a/i386/i386/locore.S b/i386/i386/locore.S
index c1e6448..d2c600a 100644
--- a/i386/i386/locore.S
+++ b/i386/i386/locore.S
@@ -704,6 +704,8 @@ LEXT(return_to_iret) /* ( label for kdb_kintr and hardclock) */
iret /* return to caller */
int_from_intstack:
+ cmpl $EXT(_intstack),%esp /* seemingly looping? */
+ jb stack_overflowed /* if not: */
call EXT(interrupt) /* call interrupt routine */
_return_to_iret_i: /* ( label for kdb_kintr) */
pop %edx /* must have been on kernel segs */
@@ -711,6 +713,9 @@ _return_to_iret_i: /* ( label for kdb_kintr) */
pop %eax /* no ASTs */
iret
+stack_overflowed:
+ ud2
+
/*
* Take an AST from an interrupt.
* On PCB stack.