This repository has been archived by the owner on Mar 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test and support forced unwinding of guests stopped from stack overflows
- Loading branch information
1 parent
6557e8e
commit 6421730
Showing
9 changed files
with
237 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 14 additions & 4 deletions
18
lucet-runtime/lucet-runtime-tests/guests/host/fault_unwind.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
#include <assert.h> | ||
#include <stdint.h> | ||
|
||
extern void fault_unwind(void (*)(void)); | ||
extern void bad_access_unwind(void (*)(void)); | ||
extern void stack_overflow_unwind(void (*)(void)); | ||
|
||
void callback(void) | ||
void do_bad_access(void) | ||
{ | ||
*(uint64_t *) 0xFFFFFFFF = 420; | ||
return; | ||
} | ||
|
||
void entrypoint(void) | ||
void bad_access(void) | ||
{ | ||
return fault_unwind(callback); | ||
return bad_access_unwind(do_bad_access); | ||
} | ||
|
||
void do_stack_overflow(void) { | ||
do_stack_overflow(); | ||
} | ||
|
||
void stack_overflow(void) | ||
{ | ||
return stack_overflow_unwind(do_stack_overflow); | ||
} |
Oops, something went wrong.