@@ -123,17 +123,22 @@ java_fuzz_target_test(
123123 target_class = "com.example.ExampleValueProfileFuzzer" ,
124124)
125125
126- java_fuzz_target_test (
127- name = "MazeFuzzer" ,
126+ [ java_fuzz_target_test (
127+ name = "MazeFuzzer_" + mode ,
128128 srcs = [
129129 "src/main/java/com/example/MazeFuzzer.java" ,
130130 ],
131131 allowed_findings = ["com.example.MazeFuzzer$$TreasureFoundException" ],
132+ env = {"JAZZER_MUTATOR_FRAMEWORK" : "false" } if mode == "classic" else {},
132133 target_class = "com.example.MazeFuzzer" ,
133- )
134-
135- java_fuzz_target_test (
136- name = "ExampleOutOfMemoryFuzzer" ,
134+ verify_crash_reproducer = True if mode == "classic" else False ,
135+ ) for mode in [
136+ "classic" ,
137+ "mutationFramework" ,
138+ ]]
139+
140+ [java_fuzz_target_test (
141+ name = "ExampleOutOfMemoryFuzzer_" + mode ,
137142 timeout = "short" ,
138143 srcs = [
139144 "src/main/java/com/example/ExampleOutOfMemoryFuzzer.java" ,
@@ -142,23 +147,33 @@ java_fuzz_target_test(
142147 "com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow" ,
143148 "java.lang.OutOfMemoryError" ,
144149 ],
150+ env = {"JAZZER_MUTATOR_FRAMEWORK" : "false" } if mode == "classic" else {},
145151 fuzzer_args = ["--jvm_args=-Xmx512m" ],
146152 target_class = "com.example.ExampleOutOfMemoryFuzzer" ,
147- )
148-
149- java_fuzz_target_test (
150- name = "ExampleStackOverflowFuzzer" ,
153+ verify_crash_reproducer = True if mode == "classic" else False ,
154+ ) for mode in [
155+ "classic" ,
156+ "mutationFramework" ,
157+ ]]
158+
159+ [java_fuzz_target_test (
160+ name = "ExampleStackOverflowFuzzer_" + mode ,
151161 srcs = [
152162 "src/main/java/com/example/ExampleStackOverflowFuzzer.java" ,
153163 ],
154164 allowed_findings = [
155165 "com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow" ,
156166 "java.lang.StackOverflowError" ,
157167 ],
168+ env = {"JAZZER_MUTATOR_FRAMEWORK" : "false" } if mode == "classic" else {},
158169 target_class = "com.example.ExampleStackOverflowFuzzer" ,
159170 # Crashes with a segfault before any stack trace printing is reached.
160171 target_compatible_with = SKIP_ON_MACOS ,
161- )
172+ verify_crash_reproducer = True if mode == "classic" else False ,
173+ ) for mode in [
174+ "classic" ,
175+ "mutationFramework" ,
176+ ]]
162177
163178# WARNING: This fuzz target uses a vulnerable version of log4j, which could result in the execution
164179# of arbitrary code during fuzzing if executed with an older JDK. Use at your own risk.
@@ -207,27 +222,32 @@ java_fuzz_target_test(
207222 ],
208223)
209224
210- java_fuzz_target_test (
211- name = "JpegImageParserFuzzer" ,
225+ [ java_fuzz_target_test (
226+ name = "JpegImageParserFuzzer_" + mode ,
212227 size = "enormous" ,
213228 srcs = [
214229 "src/main/java/com/example/JpegImageParserFuzzer.java" ,
215230 ],
216231 allowed_findings = ["java.lang.NegativeArraySizeException" ],
232+ env = {"JAZZER_MUTATOR_FRAMEWORK" : "false" } if mode == "classic" else {},
217233 fuzzer_args = [
218234 "-fork=2" ,
219235 ],
220236 tags = ["exclusive-if-local" ],
221237 target_class = "com.example.JpegImageParserFuzzer" ,
222238 # The exit codes of the forked libFuzzer processes are not picked up correctly.
223239 target_compatible_with = SKIP_ON_MACOS ,
240+ verify_crash_reproducer = True if mode == "classic" else False ,
224241 deps = [
225242 "@maven//:org_apache_commons_commons_imaging" ,
226243 ],
227- )
244+ ) for mode in [
245+ "classic" ,
246+ "mutationFramework" ,
247+ ]]
228248
229- java_fuzz_target_test (
230- name = "GifImageParserFuzzer" ,
249+ [ java_fuzz_target_test (
250+ name = "GifImageParserFuzzer_" + mode ,
231251 srcs = [
232252 "src/main/java/com/example/GifImageParserFuzzer.java" ,
233253 ],
@@ -236,11 +256,16 @@ java_fuzz_target_test(
236256 "java.lang.IllegalArgumentException" ,
237257 "java.lang.OutOfMemoryError" ,
238258 ],
259+ env = {"JAZZER_MUTATOR_FRAMEWORK" : "false" } if mode == "classic" else {},
239260 target_class = "com.example.GifImageParserFuzzer" ,
261+ verify_crash_reproducer = True if mode == "classic" else False ,
240262 deps = [
241263 "@maven//:org_apache_commons_commons_imaging" ,
242264 ],
243- )
265+ ) for mode in [
266+ "classic" ,
267+ "mutationFramework" ,
268+ ]]
244269
245270java_fuzz_target_test (
246271 name = "TiffImageParserFuzzer" ,
@@ -355,19 +380,24 @@ java_fuzz_target_test(
355380 ],
356381)
357382
358- java_fuzz_target_test (
359- name = "JacksonCborFuzzer" ,
383+ [ java_fuzz_target_test (
384+ name = "JacksonCborFuzzer_" + mode ,
360385 srcs = [
361386 "src/main/java/com/example/JacksonCborFuzzer.java" ,
362387 ],
363388 allowed_findings = ["java.lang.NullPointerException" ],
389+ env = {"JAZZER_MUTATOR_FRAMEWORK" : "false" } if mode == "classic" else {},
364390 target_class = "com.example.JacksonCborFuzzer" ,
391+ verify_crash_reproducer = True if mode == "classic" else False ,
365392 deps = [
366393 "@maven//:com_fasterxml_jackson_core_jackson_core" ,
367394 "@maven//:com_fasterxml_jackson_core_jackson_databind" ,
368395 "@maven//:com_fasterxml_jackson_dataformat_jackson_dataformat_cbor" ,
369396 ],
370- )
397+ ) for mode in [
398+ "classic" ,
399+ "mutationFramework" ,
400+ ]]
371401
372402java_fuzz_target_test (
373403 name = "FastJsonFuzzer" ,
@@ -499,7 +529,8 @@ java_binary(
499529 ":ExampleFuzzer_target_deploy.jar" ,
500530 ":ExampleValueProfileFuzzer_target_deploy.jar" ,
501531 ":FastJsonFuzzer_target_deploy.jar" ,
502- ":JacksonCborFuzzer_target_deploy.jar" ,
532+ ":JacksonCborFuzzer_classic_target_deploy.jar" ,
533+ ":JacksonCborFuzzer_mutationFramework_target_deploy.jar" ,
503534 ":JpegImageParserFuzzer_target_deploy.jar" ,
504535 ":JsonSanitizerDenylistFuzzer_target_deploy.jar" ,
505536 ],
0 commit comments