Bug 197620 - Wasm should cage the memory base pointers in structs
Summary: Wasm should cage the memory base pointers in structs
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebAssembly (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Miller
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-05-06 12:05 PDT by Keith Miller
Modified: 2019-05-16 19:22 PDT (History)
10 users (show)

See Also:


Attachments
Patch (24.52 KB, patch)
2019-05-16 13:56 PDT, Keith Miller
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Miller 2019-05-06 12:05:07 PDT
...
Comment 1 Keith Miller 2019-05-16 13:56:51 PDT
Created attachment 370065 [details]
Patch
Comment 2 Saam Barati 2019-05-16 18:34:45 PDT
Comment on attachment 370065 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=370065&action=review

r=me

> Source/JavaScriptCore/ChangeLog:11
> +        Currently, we use cageConditionally; this only matters for API
> +        users since the web content process cannot disable primitive
> +        gigacage. This patch also adds a set helper for union/intersection
> +        of RegisterSets.

Do we have tests where Gigacage is disabled with Wasm enabled in JSC?

> Source/JavaScriptCore/wasm/WasmBinding.cpp:48
> +    GPRReg scratch = wasmCallingConventionAir().prologueScratch(0);

👍🏼

> Source/JavaScriptCore/wasm/WasmMemory.cpp:-442
> -        m_memory.resize(m_size, desiredSize);

Seems like this was a bug? Do we have a test?
Comment 3 Keith Miller 2019-05-16 18:54:11 PDT
Comment on attachment 370065 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=370065&action=review

>> Source/JavaScriptCore/ChangeLog:11
>> +        of RegisterSets.
> 
> Do we have tests where Gigacage is disabled with Wasm enabled in JSC?

I don’t believe so. I’m not sure how important it is since wasn’t memory is always allocated out of the cage anyway.

>> Source/JavaScriptCore/wasm/WasmMemory.cpp:-442
>> -        m_memory.resize(m_size, desiredSize);
> 
> Seems like this was a bug? Do we have a test?

It’s not a bug. I changed the type of the container so I had to change the name of the method. There’s definitely theses that grow (I recall hitting this in the og patch).
Comment 4 WebKit Commit Bot 2019-05-16 19:21:57 PDT
Comment on attachment 370065 [details]
Patch

Clearing flags on attachment: 370065

Committed r245432: <https://trac.webkit.org/changeset/245432>
Comment 5 WebKit Commit Bot 2019-05-16 19:21:59 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2019-05-16 19:22:15 PDT
<rdar://problem/50878478>