fix: allow unsandboxed renderers to request new privileges (7-0-x) (#19999)

* fix: allow unsandboxed renderers to request new privileges

* add test
This commit is contained in:
Eugene
2019-08-29 17:27:18 +02:00
committed by Shelley Vohr
parent 4dea193854
commit bb8c7dfc7e
3 changed files with 44 additions and 0 deletions

View File

@@ -155,6 +155,19 @@ describe('node feature', () => {
})
})
})
describe('child_process.exec', () => {
(process.platform === 'linux' ? it : it.skip)('allows executing a setuid binary from non-sandboxed renderer', () => {
// Chrome uses prctl(2) to set the NO_NEW_PRIVILEGES flag on Linux (see
// https://github.com/torvalds/linux/blob/40fde647cc/Documentation/userspace-api/no_new_privs.rst).
// We disable this for unsandboxed processes, which the remote tests
// are running in. If this test fails with an error like 'effective uid
// is not 0', then it's likely that our patch to prevent the flag from
// being set has become ineffective.
const stdout = ChildProcess.execSync('sudo --help')
expect(stdout).to.not.be.empty()
})
})
})
describe('contexts', () => {