Commit graph

34 commits

Author SHA1 Message Date
Cole Faust
a963b94cde Make the enabled property configurable
This allows using select statements with it.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I6f3efaaa3d82505e38a91ee4ba0e18e404360191
Merged-In: If355d24506e3f117d27b21442a6c02bca3402dc7
2024-05-02 15:41:24 -07:00
hamzeh
65dd2c379d Fix condition that misses packaging some fuzzers
Fuzzers that are host only were not packaged in the haiku zip.

Bug: 316399445
Test: make haiku
Change-Id: I54f1cd3f446667b940063f16599de4139a7a7ade
2023-12-27 15:27:12 -08:00
Colin Cross
5c1d5fb21b Move test data installation to Soong
To generate module-info.json in Soong for b/309006256 Soong needs to
know the test data paths. Moving test data installation into Soong will
also help later for test suite packaging.

Add ModuleContext.InstallTestData that installs the files listed in a
[]DataPath alongside the test.  The files will also be passed to Make
to allow it to continue packaging them into the test suites for now.

Update the module types that are producing LOCAL_TEST_DATA entries
in their Android.mk files to go through InstallTestData instead.

Bug: 311428265
Test: atest --host toybox-gtests --test-timeout=120000
Change-Id: Ia8b964f86e584ea464667fd86a48d754d118bead
2023-11-30 13:38:49 -08:00
Cory Barker
2490757043 Add new options for defining paths to exclude in report gen
Test: built locally and verified results

Bug: 290337392
Change-Id: I382fe922e74d74b26ebbb2b477877b2a61015b87
2023-07-18 21:19:53 +00:00
David Fu
4ad9bba696 Added fuzz_config field to include targets in presubmits
Change-Id: I2da23288919520807982d177af646669aa740bfb
2023-06-28 21:50:35 +00:00
Mark
f736b924db Add use_platform_libs to fuzz config
BUG: b/279082026
TEST: mma <java_fuzz>
Change-Id: Ia3dba44f66ec18d1076f1b13cc654a35b31c02d4
WANT_LGTM=ccross
2023-06-02 14:46:53 +00:00
Colin Cross
80462dc040 Propagate shared library destination path through FilesToZip
Shared libraries in fuzz zip files may have a different filename than
their source file, for example when the source file is a prebuilt in
the source tree.  Propagate the computed library name through
FilesToZip to soong_zip to use the correct name in the zip file.

Bug: 254867347
Test: builds
Change-Id: Ib0def8decdbec7842b8e1a9056fac373d743bac0
2023-05-09 23:19:31 +00:00
David Fu
44fc9a826b Changed assignee to triage_assignee in fuzzconfig
Change-Id: Ifdf4e8a3d855c414c906d249674411f4f4b88396
2023-04-26 20:29:44 +00:00
David Fu
af4e33bcc8 Added assignee field to FuzzConfig.
Change-Id: Ia8cff7fa0980674ef6ed64922b6895b61c1e41a4
2023-04-18 10:43:24 -07:00
hamzeh
eea256b2e3 Aligning cc_fuzz variable with fuzzer proto
Test: make haiku
Change-Id: I29971cdb043929b87130b4dd7b3c0589ab4b4fee
2023-02-22 16:17:33 -08:00
Jon Bottarini
a0b44cbd1c spelling/grammar fix
Test: Presubmit
Change-Id: I4522ec1c457c7d98adc2820faa457b2bb7cb517a
Merged-In: I4522ec1c457c7d98adc2820faa457b2bb7cb517a
2023-02-21 13:52:21 -08:00
Mark Teffeteller
0342382526 Merge changes Ib951c4f5,Iacdccb8f
* changes:
  Include target_mods field Test: build a module with target_mods populated in cc_fuzz
  Update cc_fuzz rule - add library_path param Test: make haiku
2022-10-10 19:29:29 +00:00
Mark
74c0ad2248 Include target_mods field
Test: build a module with target_mods populated in cc_fuzz

Change-Id: Ib951c4f551db27f67e2cc18717e52763a99907a3
2022-10-06 22:36:33 +00:00
Colin Cross
31d89b4e0c Move fuzzer's CollectAllSharedDependencies into GenerateAndroidBuildActions
Make rust and cc fuzzers collect their shared libraries once in
GenerateAndroidBuildActions and store it for later use by the
packaging singleton.  Also use android.OutputFileForModule to get
the paths.  Together this will fix fuzzers that depend on architecture
specific prebuilt shared libraries that are missing a prebuilt for an
architecture when building with AllowMissingDependencies.

Bug: 250918230
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing
Change-Id: I154a6f3a767c883e9fe7067003615db73ee78e2d
2022-10-04 19:15:45 -07:00
Mark
f0b2254d25 Update cc_fuzz rule - add library_path param
Test: make haiku

Change-Id: Iacdccb8fbc4a0937693a41ddc2107b4584203b94
2022-09-26 21:06:24 +00:00
Cory Barker
9cfcf6d4e9 Revert^2 "Update the way we build AFL++ fuzz binaries"
Test: Built AFL fuzzers individually and built all using haiku command
and built libfuzzers individually and also by using haiku command. Ran
selected fuzzers manually to ensure fuzzing still worked.

Description: Previously we needed to add cc_afl_fuzz to build an afl fuzz binary,
however, to turn current libFuzzers into AFL fuzzers this would required
an update to each Android.bp file which is a lot of work, and would also
require an approval from each Android.bp file owner, which is even more
work.

To get around this (and also to match how AFL fuzzers are built in G3)
we will build AFL++ fuzz binaries by command line option FUZZ_FRAMEWORK.
When FUZZ_FRAMEWORK=AFL is set, all cc_fuzz modules will be built
for AFL rather than libFuzzer. Devs can also specify if a cc_fuzz module
is only for libFuzzer or AFL by using fuzzing_frameworks. If
fuzzing_frameworks is left blank then it will be assumed that the
cc_fuzz module can be built for all available fuzzing frameworks.

Change-Id: If57d3038f05e52775177eaeb26f8ed2bdc73443a
2022-08-08 20:26:09 +00:00
Cory Barker
ba73a0997d Merge "Revert "Updated the way we build AFL++ fuzz binaries"" 2022-08-08 16:37:28 +00:00
Cory Barker
74aea6c5ee Revert "Updated the way we build AFL++ fuzz binaries"
Revert submission 2164482-Build AFL from Command line option

Reason for revert: Unit test fails on MAC builds
Reverted Changes:
Ia7a822462:Updated the way we build AFL++ fuzz binaries
I994bde63b:Updated the way we build AFL++ fuzz binaries
Ie863853b4:Updated the way we build AFL++ fuzz binaries
I577d6ae7b:Updated the way we build AFL++ fuzz binaries
Ic4fd34f8d:Updated the way we build AFL++ fuzz binaries

Change-Id: Ic2cda7733d206d7ed178f1db5e38268bc915e57b
2022-08-08 15:55:12 +00:00
Cory Barker
edadcdb17c Merge "Updated the way we build AFL++ fuzz binaries" 2022-08-08 14:24:16 +00:00
Cory Barker
cecb7546db Updated the way we build AFL++ fuzz binaries
Test: Built AFL fuzzers individually and built all using haiku command
and built libfuzzers individually and also by using haiku command. Ran
selected fuzzers manually to ensure fuzzing still worked.

Description: Previously we needed to add cc_afl_fuzz to build an afl fuzz binary,
however, to turn current libFuzzers into AFL fuzzers this would required
an update to each Android.bp file which is a lot of work, and would also
require an approval from each Android.bp file owner, which is even more
work.

To get around this (and also to match how AFL fuzzers are built in G3)
we will build AFL++ fuzz binaries by command line option FUZZ_FRAMEWORK.
When FUZZ_FRAMEWORK=AFL is set, all cc_fuzz modules will be built
for AFL rather than libFuzzer. Devs can also specify if a cc_fuzz module
is only for libFuzzer or AFL by using fuzzing_frameworks. If
fuzzing_frameworks is left blank then it will be assumed that the
cc_fuzz module can be built for all available fuzzing frameworks.

Change-Id: Ia7a8224627f2de61606b410d1d1a56d7bdc0955f
2022-08-05 21:46:26 +00:00
hamzeh
3c983d2ba6 Fixing issue with boolean params in cc_fuzz
Test: m example_fuzzer
Change-Id: I2661d9915949d4150876db6527b865e63d356e5e
2022-07-26 14:19:22 -07:00
Cory Barker
b1c8940be1 Merge "Adding support for building AFLpp Test: Build AFL fuzzers locally and ran them" 2022-07-14 16:26:41 +00:00
Treehugger Robot
ee81400fbb Merge "Fix name of new param in cc_fuzz" 2022-07-13 01:18:53 +00:00
hamzeh
46ab891c1d Fix name of new param in cc_fuzz
Test: m example_fuzzer
Change-Id: I900a0eaf061ed22a0452eba06cd83b52003a3ea9
2022-07-12 16:06:50 -07:00
Cory Barker
a1da26fa9b Adding support for building AFLpp
Test: Build AFL fuzzers locally and ran them

Change-Id: Ie4fbd258c87663cf81d7d64d575b3da1d5febc17
2022-07-12 21:31:47 +00:00
Cory Barker
14058f2c4a Merge "Revert "Adding support for building AFLpp Test: Build AFL fuzzer..."" 2022-07-12 20:20:00 +00:00
Cory Barker
7bc91232d1 Revert "Adding support for building AFLpp Test: Build AFL fuzzer..."
Revert submission 2124256-AFLpp support in Soong

Reason for revert: It is breaking the build
Reverted Changes:
Ie07ec3368:Adding support for building AFLpp Test: Build AFL ...
I5bd6d1e9b:Adding support for building AFLpp Test: Built AFL ...

Change-Id: Id2eec1060f7532fec46293d0c207be800e6eaa03
2022-07-12 18:04:17 +00:00
Cory Barker
7e0b4bae8a Merge "Adding support for building AFLpp Test: Build AFL fuzzers locally and ran them" 2022-07-12 17:21:05 +00:00
Cory Barker
f4b1c3a7a7 Adding support for building AFLpp
Test: Build AFL fuzzers locally and ran them

Change-Id: Ie07ec336892649192a844a4d0d231196673e34a0
2022-07-12 01:20:17 +00:00
hamzeh
e8a1bfa39f Add ISE requested params to soong bp
The newly added params will be used to help automatically assign bugs
found by fuzzers.

Test: m example_fuzzer
Bug: 236732888
Change-Id: I80e38fae171f8a5798a1495d057bfa6942857c4a
2022-07-07 17:50:57 -07:00
Muhammad Haseeb Ahmad
7e74405b2d Add jni support to java_fuzz_host
Bug: 219782880
Test: m example_java_fuzzer_with_native_lib, go test -run TestJavaFuzz
Change-Id: I1d05fb449e5378a27a0096869d9c12ca0a1245c6
2022-04-26 18:49:02 +00:00
Muhammad Haseeb Ahmad
e380310a9e Add java_fuzz_packaging
java_fuzz_package is a prelude to a haiku-java build target.

Test: m example_java_fuzzer
Change-Id: I78caa53d7687e24f7180c7e16013b668991d6fe6
2022-01-12 18:48:39 +00:00
Ivan Lozano
39b0bf0326 rust: Package shared libraries with fuzzer zips
Rust fuzzers were not packaging up their CC shared dependencies.
This would lead to fuzzers using the shared libraries included on
system, which may not be sanitized, leading to incorrect behavior.

This refactors the relevant code from CC and calls it from the Rust
build logic.

Bug: 202282599
Test: output rust fuzzer zip file includes shared dependencies.
Change-Id: I92196eb0141733797a67eae24f8e9aedea94c3bc
2021-10-14 15:31:47 -04:00
hamzeh
c0a671fc80 Moving common fuzzing code to fuzz package
Test: make haiku and make haiku-rust
Change-Id: Ife80cc10672f51bd6afbae7061cc9373a2a15e7d
2021-08-11 23:54:15 +00:00