X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=blobdiff_plain;f=src%2Ftests%2Fuserprog%2Fexec-bound-3.c;fp=src%2Ftests%2Fuserprog%2Fexec-bound-3.c;h=67937c8ff0c8d94f70fa9052839fa60b419d6e78;hp=0000000000000000000000000000000000000000;hb=16c7d34d02045bc7e6165a13c549a7968e074d4b;hpb=bffccc54acc0560186b8c38bc4a66897de5158eb diff --git a/src/tests/userprog/exec-bound-3.c b/src/tests/userprog/exec-bound-3.c new file mode 100644 index 0000000..67937c8 --- /dev/null +++ b/src/tests/userprog/exec-bound-3.c @@ -0,0 +1,18 @@ +/* Invokes an exec system call with the exec string straddling a + page boundary such that the first byte of the string is valid + but the remainder of the string is in invalid memory. Must + kill process. */ + +#include +#include "tests/userprog/boundary.h" +#include "tests/lib.h" +#include "tests/main.h" + +void +test_main (void) +{ + char *p = get_bad_boundary () - 1; + *p = 'a'; + exec(p); + fail ("should have killed process"); +}