Bug 241386 - Set protections on MAP_ALIGNED platforms too for WTF::OSAllocator::tryReserveUncommittedAligned
Summary: Set protections on MAP_ALIGNED platforms too for WTF::OSAllocator::tryReserve...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: All Other
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-06-07 15:37 PDT by Leonardo Taccari
Modified: 2022-06-08 09:32 PDT (History)
7 users (show)

See Also:


Attachments
REGRESSION(247105@main): Set protections on MAP_ALIGNED platforms too (1.71 KB, patch)
2022-06-07 15:39 PDT, Leonardo Taccari
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Leonardo Taccari 2022-06-07 15:37:39 PDT
Since 247105@main when tryReserveUncommittedAligned() on Unix-like platforms that supports MAP_ALIGNED (except macOS and Linux) pages are initially mmap-ed via PROT_NONE but then the protections are never readjusted.

At least in NetBSD running jsc, e.g. via `jsc -e 0', it ends up in a SIGSEGV.
Comment 1 Leonardo Taccari 2022-06-07 15:39:13 PDT
Created attachment 460075 [details]
REGRESSION(247105@main): Set protections on MAP_ALIGNED platforms too

Since the introduction of tryReserveUncommittedAligned() on platforms
that have MAP_ALIGNED via 247105@main, reserved pages via that
function never had the protections adjusted and will likely ends
up in SIGSEGV.
Comment 2 Leonardo Taccari 2022-06-07 15:43:59 PDT
After this patch and https://bugs.webkit.org/show_bug.cgi?id=241386 is applied jsc should build and runs on NetBSD too without any further patches.
Comment 3 Leonardo Taccari 2022-06-07 15:44:45 PDT
Comment on attachment 460075 [details]
REGRESSION(247105@main): Set protections on MAP_ALIGNED platforms too

Mark it as ready for review.
Comment 4 Yusuke Suzuki 2022-06-08 08:02:22 PDT
@Leonardo Also I recommend joining WebKit slack from https://webkit.org/getting-started/
And joining #jsc / #reviews channel. There are JSC reviewers you can ask for reviews :)
Comment 5 Leonardo Taccari 2022-06-08 08:17:15 PDT
Great suggestion! I'm there too now! :)

Thank you very much Yusuke!
Comment 6 Yusuke Suzuki 2022-06-08 08:42:49 PDT
Comment on attachment 460075 [details]
REGRESSION(247105@main): Set protections on MAP_ALIGNED platforms too

r=me
Comment 7 EWS 2022-06-08 09:31:30 PDT
Committed r295382 (251390@main): <https://commits.webkit.org/251390@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 460075 [details].
Comment 8 Radar WebKit Bug Importer 2022-06-08 09:32:13 PDT
<rdar://problem/94641219>