PKUOS - Pintos
Pintos source browser for PKU Operating System course
|
Go to the source code of this file.
Functions | |
static char dst[8192] | __attribute__ ((section(".testEndmem,\"aw\",@nobits#"))) |
Utility function for tests that try to break system calls by passing them data that crosses from one virtual page to another. More... | |
void * | get_boundary_area (void) |
Returns the beginning of a page. More... | |
char * | copy_string_across_boundary (const char *src) |
Returns a copy of SRC split across the boundary between two pages. More... | |
void * | get_bad_boundary (void) |
Returns an address that is invalid, but the preceding bytes are all valid (the highest address in the bss segment). More... | |
|
static |
Utility function for tests that try to break system calls by passing them data that crosses from one virtual page to another.
Together with statements in src/lib/user/user.lds, arranges for the following array to be at the very end of the .bss segment (needed for get_bad_boundary below).
char * copy_string_across_boundary | ( | const char * | src | ) |
Returns a copy of SRC split across the boundary between two pages.
Definition at line 29 of file boundary.c.
References get_boundary_area(), strlcpy(), and strlen().
Referenced by test_main().
void * get_bad_boundary | ( | void | ) |
Returns an address that is invalid, but the preceding bytes are all valid (the highest address in the bss segment).
Used to position information such that the first byte of the information is valid, but not all the information is valid.
Definition at line 42 of file boundary.c.
References ROUND_UP.
Referenced by test_main().
void * get_boundary_area | ( | void | ) |
Returns the beginning of a page.
There are at least 2048 modifiable bytes on either side of the pointer returned.
Definition at line 18 of file boundary.c.
References ROUND_UP.
Referenced by copy_string_across_boundary(), and test_main().