fix a potential kernel crash
add a regression test for it
This commit is contained in:
parent
57e40a0204
commit
402e7b5605
2 changed files with 17 additions and 1 deletions
|
@ -1908,6 +1908,18 @@ stacktest(char *s)
|
|||
exit(xstatus);
|
||||
}
|
||||
|
||||
// copyinstr() used to cast the virtual page address to uint,
|
||||
// which (with certain wild system call arguments) could
|
||||
// result in a kernel page fault.
|
||||
void
|
||||
pgbug(char *s)
|
||||
{
|
||||
char *argv[1];
|
||||
argv[0] = 0;
|
||||
exec((char*)0xeaeb0b5b00002f5e, argv);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// run each test in its own process. run returns 1 if child's exit()
|
||||
// indicates success.
|
||||
int
|
||||
|
@ -1945,6 +1957,7 @@ main(int argc, char *argv[])
|
|||
void (*f)(char *);
|
||||
char *s;
|
||||
} tests[] = {
|
||||
{pgbug, "pgbug" },
|
||||
{reparent, "reparent" },
|
||||
{twochildren, "twochildren"},
|
||||
{forkfork, "forkfork"},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue