seL4/include
Adrian Danis cca128ead9 ia32: Always use IRET instead of sysexit when single stepping
Previous code to return to user level performed
popf
sysexit
The popf was just before the sysexit as there is a one instruction
delay on the trap flag taking effect and ensured we did not attempt
to single step the kernel. Unfortunately there is not a one instruction
delay on enabling the interrupt flag, and as a result an interrupt
can be taken prior to executing the sysexit instruction. It is
possible to exploit this to escalate a user level thread such that
it is running with CPL0
This commit changes the restore paths to perform
sti
sysexit
Which will correctly delay interrupts until the completion of sysexit.
As the popf is now being done earlier to prevent single stepping the
kernel we return via an iret, instead of sysexit, for threads that
have single stepping enabled. To achieve this we
* When loading debug state if we enable the Trap flag we also manipulate
  the register state such that the iret return path will be picked
* As fastpath_restore does not have an iret return path we forbid
  the fastpath from switching to threads that have single stepping
  enabled
2017-01-05 16:49:19 +11:00
..
32/mode SELFOUR-413: refactor libsel4 fault API 2016-11-25 12:29:07 +11:00
64/mode SELFOUR-413: refactor libsel4 fault API 2016-11-25 12:29:07 +11:00
api SELFOUR-567: use seL4_CapRights_t from libsel4 2016-11-25 12:29:07 +11:00
arch ia32: Always use IRET instead of sysexit when single stepping 2017-01-05 16:49:19 +11:00
benchmark Refactor includes so trace point support builds 2016-11-23 14:29:00 +11:00
fastpath x64: Always set the high bits of certain pointers in the fastpath 2016-11-30 11:25:05 +11:00
kernel SELFOUR-413: refactor libsel4 fault API 2016-11-25 12:29:07 +11:00
machine Remove many MODIFIES annotations. 2016-12-12 17:30:51 +11:00
model Remove unneeded usages of VISIBLE 2016-11-24 14:46:01 +11:00
object x64: Efficiently pack objects for fastpath 2016-11-25 16:26:24 +11:00
plat Remove many MODIFIES annotations. 2016-12-12 17:30:51 +11:00
api.h Release snapshot 2014-07-18 05:03:59 +10:00
assert.h Always have compile_assert enabled 2015-11-11 11:09:24 +11:00
basic_types.h Rename uint32_t -> word_t in any relevant places 2015-12-10 10:45:20 +11:00
bootinfo.h SELFOUR-114: remove bootinfo.h duplication 2016-03-01 17:25:22 +11:00
compound_types.h unsigned int -> word_t 2015-12-10 10:45:21 +11:00
config.h SELFOUR-444: Preemptible zeroing for retype. 2016-11-01 17:05:36 +11:00
machine.h SELFOUR-607: inline remaining irq path functions 2016-08-09 16:18:34 +10:00
Makefile SELFOUR-413: refactor libsel4 fault API 2016-11-25 12:29:07 +11:00
object.h SELFOUR-317: rename async endpoint to notification object, and other 2015-11-09 17:18:43 +11:00
stdarg.h Release snapshot 2014-07-18 05:03:59 +10:00
stdint.h conversion: fixed unnecessary word_t change 2015-12-10 10:45:22 +11:00
string.h Correct separation of printing and debug builds 2016-05-17 15:10:08 +10:00
types.h ia32: added the option to disable prefetchers 2015-04-15 14:38:55 +10:00
util.h Mark halt as no-inline and no-return. 2016-12-12 17:30:50 +11:00