Skip to content

Commit 0b8532a

Browse files
committed
raidz_test: Restore rand_data protection
It feels dirty to modify protection of a memory allocated via libc, but at least we should try to restore it before freeing. Signed-off-by: Alexander Motin <[email protected]>
1 parent a902ee7 commit 0b8532a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmd/raidz_test/raidz_test.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,8 @@ main(int argc, char **argv)
848848
err = run_test(NULL);
849849
}
850850

851+
mprotect(rand_data, SPA_MAXBLOCKSIZE, PROT_READ | PROT_WRITE);
852+
851853
umem_free(rand_data, SPA_MAXBLOCKSIZE);
852854
kernel_fini();
853855

0 commit comments

Comments
 (0)