RESOLVED FIXED279273
[JSC] Remove legacy ASLR implementation from WTF's x86 OSAllocator
https://bugs.webkit.org/show_bug.cgi?id=279273
Summary [JSC] Remove legacy ASLR implementation from WTF's x86 OSAllocator
Marcus Plutowski
Reported 2024-09-06 11:36:49 PDT
rdar://135430256 In OSAllocatorPOSIX.cpp:tryReserveAndCommit, we manually implement ASLR for x86 machines by calling a random number generator to request a location within a subsection of the address space. This has not been necessary for a long time: if you pass mmap a nullptr for the address, it will select a suitably random location for you. Doing it ourselves is bad for multiple reasons: 1) it’s slower, and 2) selecting a specific location in memory is generally suspicious, and I suspect that it might be related to certain other bugs. However, this situation does raise the specter of Chesterton’s Fence: if the OS does this automatically, then why did we implement code to do it ourselves? The answer is that this code is just really old: the first patch adding this to the codebase (34933@main) was committed in April 2009, and the code has not been touched since December 2010 (63979@main). ASLR was only implemented on Mac OS X in version 10.5 (Leopard, released October 2007) and only expanded to cover all applications in 10.7 (Lion, July 2011). So this code was written during a time when we _did_ need to implement it ourselves; as that is no longer the case, we should stop doing so.
Attachments
Marcus Plutowski
Comment 1 2024-09-06 11:41:52 PDT
EWS
Comment 2 2024-09-11 08:56:51 PDT
Committed 283483@main (341e30e628ef): <https://commits.webkit.org/283483@main> Reviewed commits have been landed. Closing PR #33251 and removing active labels.
EWS
Comment 3 2024-09-11 15:17:58 PDT
Committed 283286.20@safari-7620-branch (375ecf6bd97b): <https://commits.webkit.org/283286.20@safari-7620-branch> Reviewed commits have been landed. Closing PR #1733 and removing active labels.
EWS
Comment 4 2024-09-11 18:35:46 PDT
Committed 280938.328@safari-7619-branch (519097f7b454): <https://commits.webkit.org/280938.328@safari-7619-branch> Reviewed commits have been landed. Closing PR #1744 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.