deps,build: disable V8 untrusted code mitigations#19222
deps,build: disable V8 untrusted code mitigations#19222targos wants to merge 2 commits intonodejs:masterfrom
Conversation
|
Can we add documentation for users on how to undo the effects of this at runtime? |
|
Sure, where should I write it? In BUILDING.md? |
|
Refs: nodejs/node-v8#40 |
|
Sorry I didn't read the "runtime" part. I guess we can add it to |
|
Also, does this affect WebAssembly? I might be wrong but I was under the impression that that actually does provide a reliable, full sandbox within Node now.
I guess that depends – I read the linked issue, but I’m not sure whether |
|
/cc @hashseed and @bmeurer.
|
|
@addaleax see my previous message. The wasm compiler is affected. |
|
Let me give some information so that you can make an educated decision on this.
Spectre affects WebAssembly just as much as JavaScript. Both are "sandboxed". But that doesn't protect you from leaking information if CPUs do that at a machine instruction level.
V8 runs mksnapshot at build time to produce the startup snapshot, which includes code objects to implement builtins and bytecode handlers. The latter are affected by the flag. We are essentially looking at four combinations of enabling / disabling the flag at build time / runtime: Disabled at build time and disabled at runtime Disabled at build time and enabled at runtime Enabled at build time and disabled at runtime Enabled at build time and enabled at runtime Personally I would just disable altogether, and discourage people from enabling at runtime via command line flag. So this change looks good to me. |
|
Please also have a look at https://github.com/v8/v8/wiki/Untrusted-code-mitigations |
|
I also strongly recommend to not offer any of these mitigations at all by default in Node. They don't make sense. If someone needs a Node with these on, they should build their own version, and better know exactly what they are doing and why. I think we might otherwise risk sending people down into false sense of security, because just passing |
|
Is it an idea to add a regression test that checks that |
deps/v8/gypfiles/features.gypi
Outdated
There was a problem hiding this comment.
is this overridden by common.gypi?
There was a problem hiding this comment.
Yes. It's the 2nd commit in this PR.
Add a GYP flag similar to the one defined in BUILD.gn.
507c9dd to
df2a907
Compare
|
@bnoordhuis I added a test. |
Add a GYP flag similar to the one defined in BUILD.gn. PR-URL: #19222 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Refs: https://github.com/v8/v8/wiki/Untrusted-code-mitigations PR-URL: #19222 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes@nodejs/v8