https://crrev.com/c/4123919 caused -Werror,-Wmacro-redefined, due to
./configure passing -DHAVE_FUZZER=0 when not configured with
--enable-fuzzer.
To fix that:
1. Use ./configure --enable-fuzzer instead of -DHAVE_FUZZER to avoid
multiple definitions of the macro.
2. The default make rule would try to build the fuzzer itself. So
instead we selectively build just the cras binary, which is enough to
produce libcrasserver.a and libcras_rust.a.
3. The build dependency of cras_dbus_bindings.h in the Makefile is not
properly specified, so we build it manually first.
Fixes https://crbug.com/oss-fuzz/54641.
* CRAS: Use CARGO_BUILD_TARGET="x86_64-unknown-linux-gnu"
In oss-fuzz, to build with MemorySanitizer, Rust part needs to use
```
CARGO_BUILD_TARGET="x86_64-unknown-linux-gnu"
```
to resolve libc `MemorySanitizer: use-of-uninitialized-value` error
according to https://github.com/google/oss-fuzz/issues/3469.
* CRAS: Add new member to auto_ccs
Co-authored-by: paulhsia <paulhsia@google.com>
When running fuzzers with local source tree,
```
python3 infra/helper.py build_fuzzers --sanitizer address cras
<source_tree>
```
will generate lots of root permission artifacts to local source tree.
Change to out-of-tree build, then
```
python3 infra/helper.py build_fuzzers --clean --sanitizer address cras
<source_tree>
```
could always start from a clean build.
Co-authored-by: paulhsia <paulhsia@google.com>
Fix build failures:
```
error: /out/src/rate_estimator.rs: No such file or directory
warning: The file '/src/rate_estimator.rs' isn't covered.
error: /out/src/rate_estimator_bindings.rs: No such file or directory
warning: The file '/src/rate_estimator_bindings.rs' isn't covered.
```
Bug: crbug/oss-fuzz/31910
Test: {build_fuzzer, coverage} commands in infra/helper.py for cras
* [CRAS] Fix build error and build new fuzzer
- Fix build error by installing 1.8.x gtest and using `make install` to
install gtest pc file for pkg-config
- Build and add new fuzzer `cras_hfp_slc`
BUG=oss-fuzz:24744
* fix the copyright
* fix the copyright
* Update Dockerfile
Co-authored-by: Max Moroz <mmoroz@chromium.org>
Pull the corpus that exists in the cras repository and use it.
This corpus was generated by dumping incoming messages while going
through audio use cases on a chromebook.
Signed-off-by: Dylan Reid <dgreid@chromium.org>
cras is the audio server that runs on ChromeOS.
The first cras fuzzer tests the client's message interface.
Signed-off-by: Dylan Reid <dgreid@chromium.org>