Contact emails (alphasorted)
bi...@chromium.org, dsc...@chromium.org, hab...@chromium.org, tit...@chromium.org
Explainer
Provide low-level building blocks for pthreads-style shared memory: shared memory between threads, atomics and futexes.
New atomic memory operators, including loads/stores annotated with their atomic ordering property, will follow a model compatible with the C++11 memory model (with some differences), similarly to the PNaCl atomic support and the SharedArrayBuffer support in JavaScript. Even when there are data races, WebAssembly will ensure that the nondeterminism remains limited and local.
There is ongoing work to formalize the memory model used by SharedArrayBuffer. This can be used by WebAssembly threads, since both JavaScript and WebAssembly are intended to be able to communicate through SharedArrayBuffer.
More details can be found in https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md.
Design doc/Spec
Spec issue: https://github.com/WebAssembly/design/issues/1073
Design doc: https://docs.google.com/document/d/1e0Ye-75niAVqdsCDCxJEMYjAh3OC3ezQIsLc4YcFHj4/edit
Tracking issue: https://bugs.chromium.org/p/chromium/issues/detail?id=754910
Link to “Intent to Implement” blink-dev discussion
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/GMZIcOoFFqw
Link to “Intent to Experiment” blink-dev discussion
https://groups.google.com/a/chromium.org/d/msg/blink-dev/41XDSl0-QIU/SuiUjCs4CwAJ
Summary
See explainer section.
Link to Origin Trial feedback summary
Around 40 signups
Actual live usage in e.g. Google Earth and Soundation
The reception around the OT was very positive. The API is sufficient.
Other partners, that were not using the OT but simply used the flag to experiment, mentioned that the asymmetric nature of the main thread vs. web workers can cause difficulties for developers. Toolchains like Emscripten provide some facilities to help.
Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Support on Windows, Mac, Linux, Chrome OS. Android does not support general Site Isolation and thus Threads/SABs/etc. are switched off there.
Demo link
See https://developers.google.com/web/updates/2018/10/wasm-threads for demos and usage examples.
Debuggability
No additional support needed.
Risks
Interoperability and Compatibility
Edge: Public support;
Firefox: In development/done, currently waiting on shipping solutions that enable Site Isolation mechanisms in Firefox e.g. via https://github.com/whatwg/html/issues/4175.
Safari: No signals
Web / Framework developers: Very positive signals, see https://www.youtube.com/watch?v=zgOGZgAPUjQ&list=PLNYkxOF6rcIDjlCx1PcphPpmf43aKOAdF&index=24&t=0s for examples like Soundation
Ergonomics
Are there any other platform APIs this feature will frequently be used in tandem with?
SharedArrayBuffer (already shipped)
BulkMemory support in WebAssembly (shipped together with this)
Web Workers and postMessage support (already shipped)
JS Atomics (already shipped)
Mutable global export (already shipped)
Sign extension ops (already shipped)
Activation
Will it be challenging for developers to take advantage of this feature immediately, as-is?
Would this feature benefit from having polyfills, significant documentation and outreach, and/or libraries built on top of it to make it easier to use?
Emscripten supports POSIX threads emulation
A Web Fundamentals post on how to use Wasm Threads is already live
Is this feature fully tested by web-platform-tests? Link to test suite results from wpt.fyi.
Spec core tests: https://github.com/WebAssembly/threads/blob/master/test/core/atomic.wast
Spec JS tests: https://github.com/WebAssembly/threads/commit/0b80037ebc7825db0e67c2433f556dd8d07118a2
CL for WPT: https://chromium-review.googlesource.com/c/chromium/src/+/1443959
Entry on the feature dashboard
I believe Anne's point is that process isolation is _not_ sufficient to
prevent cross-origin data leaks on its own in the face of
high-resolution clocks, that other mitigations are probably necessary
(including CORB or something along those lines, but that is also not
sufficient), and that enabling high-resolution clocks without those
other mitigations are in place is somewhat irresponsible.
Put another way, even if Firefox were shipping process isolation right
now, we would probably not enable SAB except in cases that have those
other mitigations in place. And right now that would involve opt-in via
the header that Anne mentioned.
You're right that in the end even with lower-res clocks there is
cross-origin leakage possible here, and the end result is that one has
to consider the speed of the leakage compared to the size of the data
being protected, etc. And maybe different browsers want to put
different priorities on preventing such leakage. But if we're going to
be able to converge on a single web platform behavior, we really need to
have this conversation, and that hasn't been happening.
> Finally, Chrome has already committed to shipping high-resolution clocks
> on Desktop where Site Isolation is turned on
Yes, in spite of objections from other browsers who feel that this
creates unacceptable cross-origin leakage, even with process isolation
in place.
What is your exact plan for dealing with the cross-origin information
leakage issues not addressed by CORB and process isolation in the long
term? Last I had checked it was "pretend they don't exist"...
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/c1d4401d-5f01-4ef7-9c9a-c0d438e9cf95%40chromium.org.
I think it would be beneficial to split this thread into two pieces:- The actual intent to ship about the actual API that should ship (Wasm Atomics), which do not add more relevant attack surface to the WP, than what is already available anyway (JS Atomics).- Gating high precision timer potential behind headers or not ... which AFAIK is already happening around https://github.com/whatwg/html/issues/4175 anyway?
I share Artur's concerns. Shipping this without `no-cors` restrictions on some platforms/browsers but not others would lead to bad outcomes on the security front, the compatibility front, or both.Unless we are convinced that other browsers will be able to follow Site Isolation's footsteps and avoid that requirement, I'd be very wary of shipping this without restrictions that other browsers (or even other Chromium platforms) will most likely need to ensure their users' safety.
Thanks for splitting the discussion Chris.On Fri, Feb 1, 2019 at 11:26 AM Yoav Weiss <yo...@yoav.ws> wrote:I share Artur's concerns. Shipping this without `no-cors` restrictions on some platforms/browsers but not others would lead to bad outcomes on the security front, the compatibility front, or both.Unless we are convinced that other browsers will be able to follow Site Isolation's footsteps and avoid that requirement, I'd be very wary of shipping this without restrictions that other browsers (or even other Chromium platforms) will most likely need to ensure their users' safety.In order to make sure your concerns are answered directly: WebAssembly Threads do not provide a bigger surface than the already available SAB+JS Atomics. They are like JS Atomic's twin. It would be surprising for developers to require a special header for Wasm Atomics.
I also wanted to ask for a clarification. Early on Chris Palmer said
"Lots of specifications have implementation-defined behavior, because
it's often necessary." I don't share that experience. Apart from
various resource limits and performance characteristics, web standards
go to great lengths to not have undefined behavior as this is often a
source of issues. Where does the sentiment come from that lots of
specifications nevertheless have implementation-defined behavior?
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADnb78gTMVwxBFxDrVG0GgYDB-wcfbVOQdcNDzEwpp947NDopw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADnb78hmLLyvo9sokvKv_e%3Dpngk8AzxumFGc2Geqg9M0fojOQQ%40mail.gmail.com.
On Fri, Feb 22, 2019 at 5:22 PM Rick Byers <rby...@chromium.org> wrote:
> It sounds to me like there's no good reason to block shipping WASM threads in chromium at this time, so LGTM1 from me.
That's not how I read this at all. All the reasons stated upthread
still apply. In particular, shipping this would make it more difficult
to arrive at a solution that's interoperable cross-browser; e.g.,
isn't different between Chrome and Chrome for Android.
I assume chromium will stick to it's plan to continue to make SAB available on desktop browsers without restriction, while continuing to invest in mitigating the security threats of timing attacks. It sounds like Firefox has no plans to ever make SAB available in such a configuration. That's fine - it sounds like we just need to agree to disagree on the availability of this capability for now (as we have with so many other capabilities). Perhaps chromium will ultimately be convinced by new security threats, or perhaps Mozilla will ultimately be convinced by the utility of the capability and reduced threat from future mitigations (or perhaps neither).
* We're going to need a more catchy name. ;)
LGTM2* We're going to need a more catchy name. ;)NCFSWC just rolls off the tongue :P
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACj%3DBEhLSWhGXmJiwQcaRQjf6jHvWr696TOGuaJxQ4AnD%3DtDpA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAF2MX8iioPr7PgrRAURnA_nu7AJALN026b9EzDu%2BG567oo_k3A%40mail.gmail.com.