Opened 2 years ago

Last modified 2 years ago

#17895 closed bug

mprotect ineffective after fork — at Version 1

Reported by: korli Owned by: nobody
Priority: normal Milestone: R1/beta4
Component: System/Kernel Version: R1/beta3
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by korli)

I took a few tests from libhugetlbfs, combined them in fork-mprotect-cow to check the page protection after fork. this actually succeeds on Linux and fails on Haiku.

Test output on Linux

Starting testcase "./fork-mprotect-cow", pid 15944
Mapping synchronization area..done
Mapping hugepage area...mapped at 0x7f59034f2000
Parent writes pre-fork...1234abcd
mprotect()ing to prot=0
Parent reading..SIGSEGV at 0x7f59034f2000 (sig_expected=0x7f59034f2000)
-1
Child starts..
Child reading..SIGSEGV at 0x7f59034f2000 (sig_expected=0x7f59034f2000)
-1
Child exits...
PASS

Change History (4)

by korli, 2 years ago

Attachment: fork-mprotect-cow.c added

by korli, 2 years ago

Attachment: testutils.c added

by korli, 2 years ago

Attachment: hugetests.h added

comment:1 by korli, 2 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.