set PROT_NONE when mmap fails in regions_quarantine_deallocate_pages#332
set PROT_NONE when mmap fails in regions_quarantine_deallocate_pages#332rdevshp wants to merge 1 commit into
Conversation
|
There's little point in doing this because |
|
Perhaps hardened_malloc should simply call fatal_error when mmap fails in this case to make sure that the pages aren't RW after free then? |
It definitely shouldn't do that. |
There are already multiple instances of hardened_malloc calling fatal_error after mprotect fails in the code. It is undesirable to leave the pages RW after free. |
|
Calling it during initialization is extremely different from calling it later. It's absolutely not acceptable to abort the process after initialization on out-of-memory errors and there should be no case of that happening. |
bd92965 to
e2549dd
Compare
|
I've removed the call to fatal_error. Even if the mprotect call is likely to fail in this case, it is simply a last resort measure that would not normally have any performance impacts. |
|
The point of the |
regions_quarantine_deallocate_pages in latest main commit 9a44297 keeps the pages writable when mmap fails. This PR fixes this issue.