Commit 0b492b0b authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

zdtm: protect random pages in maps04

Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 6ed19e31
......@@ -21,6 +21,7 @@ int main(int argc, char ** argv)
{
void *m;
uint32_t crc;
int i;
test_init(argc, argv);
......@@ -35,9 +36,18 @@ int main(int argc, char ** argv)
crc = ~0;
datagen(m, MEM_SIZE, &crc);
for (i = 0; i < MEM_SIZE / (1<<20); i++)
if (mprotect(m + (lrand48() * PAGE_SIZE % MEM_SIZE), PAGE_SIZE, PROT_NONE)) {
err("mprotect");
return 1;
}
test_daemon();
test_waitsig();
if (mprotect(m, MEM_SIZE, PROT_READ))
err("mprotect");
crc = ~0;
if (datachk(m, MEM_SIZE, &crc))
fail("Mem corrupted");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment