From ba6ba9883de9483ebab4ea2a3ac6ad8262b78375 Mon Sep 17 00:00:00 2001 From: htuch Date: Mon, 27 Aug 2018 10:47:13 -0400 Subject: [PATCH] fuzz: make runtime root hermetic in server_fuzz_test. (#4258) It's kind of scary allowing this to point to arbitrary locations, we will see performance and correctness issues as fuzz tests and the container filesystem interact. Fixes oss-fuzz issue https://oss-fuzz.com/v2/testcase-detail/5730612661452800. Risk level: Low Testing: Corpus entry added. Signed-off-by: Harvey Tuch --- ...case-minimized-server_fuzz_test-5730612661452800 | 13 +++++++++++++ test/server/server_fuzz_test.cc | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 test/server/server_corpus/clusterfuzz-testcase-minimized-server_fuzz_test-5730612661452800 diff --git a/test/server/server_corpus/clusterfuzz-testcase-minimized-server_fuzz_test-5730612661452800 b/test/server/server_corpus/clusterfuzz-testcase-minimized-server_fuzz_test-5730612661452800 new file mode 100644 index 000000000000..c9d6288a6a1a --- /dev/null +++ b/test/server/server_corpus/clusterfuzz-testcase-minimized-server_fuzz_test-5730612661452800 @@ -0,0 +1,13 @@ +runtime { + symlink_root: "/" + subdirectory: "tmp" + override_subdirectory: "out" +} +admin { + access_log_path: "/" + address { + pipe { + path: "WW" + } + } +} diff --git a/test/server/server_fuzz_test.cc b/test/server/server_fuzz_test.cc index ff68f39a1814..40426d1ea0b5 100644 --- a/test/server/server_fuzz_test.cc +++ b/test/server/server_fuzz_test.cc @@ -36,6 +36,9 @@ makeHermeticPathsAndPorts(Fuzz::PerTestEnvironment& test_env, if (output.admin().has_address()) { makePortHermetic(*output.mutable_admin()->mutable_address()); } + if (output.has_runtime()) { + output.mutable_runtime()->set_symlink_root(test_env.temporaryPath("")); + } for (auto& listener : *output.mutable_static_resources()->mutable_listeners()) { if (listener.has_address()) { makePortHermetic(*listener.mutable_address());