Commit c0f549f
committed
fix(guest): prefault exception handler counter
A guest exception handler runs on the IST1 stack. If the handler writes
a copy-on-write page, the first write faults. The page fault also uses
IST1, so the CPU resets RSP to the top of IST1 and writes the fault
frame over the live handler frame. The handler returns to a bad address
and the guest aborts.
The test exception handler increments a counter that starts on a
copy-on-write page. Write the counter once in install_handler so its
page copies into scratch before the handler runs. The handler then
increments a writable page and does not fault.
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>1 parent 8ba7725 commit c0f549f
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
| |||
0 commit comments