Permalink
Browse files

build: disable V8 untrusted code mitigations

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>
  • Loading branch information...
targos committed Mar 8, 2018
1 parent cac4da0 commit c6ae8a28109fc19ea30a5d785b2215345564c0bb
Showing with 22 additions and 0 deletions.
  1. +4 −0 common.gypi
  2. +18 −0 test/parallel/test-v8-untrusted-code-mitigations.js
View
@@ -35,6 +35,10 @@
# Don't bake anything extra into the snapshot.
'v8_use_external_startup_data%': 0,
# Disable V8 untrusted code mitigations.
# See https://github.com/v8/v8/wiki/Untrusted-code-mitigations
'v8_untrusted_code_mitigations': 'false',
# Some STL containers (e.g. std::vector) do not preserve ABI compatibility
# between debug and non-debug mode.
'disable_glibcxx_debug': 1,
@@ -0,0 +1,18 @@
'use strict';
require('../common');
const assert = require('assert');
const { execFileSync } = require('child_process');
// This test checks that untrusted code mitigations in V8 are disabled
// by default.
const v8Options = execFileSync(process.execPath, ['--v8-options']).toString();
const untrustedFlag = v8Options.indexOf('--untrusted-code-mitigations');
assert.notStrictEqual(untrustedFlag, -1);
const nextFlag = v8Options.indexOf('--', untrustedFlag + 2);
const slice = v8Options.substring(untrustedFlag, nextFlag);
assert(slice.match(/type: bool default: false/));

0 comments on commit c6ae8a2

Please sign in to comment.