#17895 closed bug (fixed)
mprotect ineffective after fork
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 )
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
Test output on Haiku
Starting testcase "./fork-mprotect-cow", pid 585 Mapping synchronization area..done Mapping hugepage area...mapped at 0x6e1872f000 Parent writes pre-fork...1234abcd mprotect()ing to prot=0 Parent reading..Read back 305441741 0 Child starts.. Child reading..SIGSEGV at 0x6e1872f000 (sig_expected=0x6e1872f000) -1 Child exits... FAIL Parent read succeeded on mmap(prot=0)
Attachments (3)
Change History (9)
by , 2 years ago
Attachment: | fork-mprotect-cow.c added |
---|
by , 2 years ago
Attachment: | testutils.c added |
---|
by , 2 years ago
Attachment: | hugetests.h added |
---|
comment:1 by , 2 years ago
Description: | modified (diff) |
---|
comment:2 by , 2 years ago
Description: | modified (diff) |
---|
comment:3 by , 2 years ago
comment:4 by , 2 years ago
Milestone: | Unscheduled → R1/beta4 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fix merged in hrev56392. Should we add this testcase to the tree, perhaps?
comment:5 by , 2 years ago
Thanks, the testcase licensing is LGPL, I wasn't sure it can be added to the tree.
comment:6 by , 2 years ago
I think it's fine for testcases to be LGPL, we mostly care about things actually distributed to not be GPL.
Note:
See TracTickets
for help on using tickets.
https://review.haiku-os.org/c/haiku/+/5601