Commit 082ada05 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[fuzzing] Don't expose OS methods when fuzzing

Fuzzers might randomly call OS methods to create or remove
directories. This leads to spurious results when doing differential
fuzzing, but it could be potentially harmful to the system during
normal fuzzing.

This drops OS methods in d8 on fuzzers.

Bug: chromium:1138594
Change-Id: Ia3a8c4e3d06c76ccdc50ead1d361338e13ddf1bb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2474790Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70566}
parent ee17d001
......@@ -2145,7 +2145,10 @@ Local<ObjectTemplate> Shell::CreateGlobalTemplate(Isolate* isolate) {
global_template->Set(isolate, "performance",
Shell::CreatePerformanceTemplate(isolate));
global_template->Set(isolate, "Worker", Shell::CreateWorkerTemplate(isolate));
global_template->Set(isolate, "os", Shell::CreateOSTemplate(isolate));
// Prevent fuzzers from creating side effects.
if (!i::FLAG_fuzzing) {
global_template->Set(isolate, "os", Shell::CreateOSTemplate(isolate));
}
global_template->Set(isolate, "d8", Shell::CreateD8Template(isolate));
#ifdef V8_FUZZILLI
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment