Apparently the dependencies aren't used at runtime by the
fuzz targets so it seems it should be safe to bring MSAn back.
I'd keep https://github.com/systemd/systemd/issues/20542 open though
(at least until the dependencies are either linked properly or
maybe even removed somehow).
It turns out that the system version of jinja2 is visible to the build
script.
From https://github.com/systemd/systemd/pull/19630#issuecomment-842983177:
> On OSS-Fuzz (and CIFuzz) the latest version of Python is built from
> scratch in the base-builder image. /usr/lib/python3/dist-packages
> (where python3-jinja2 is installed by apt-get) isn't included in
> PYTHONPATH there:
>
> ['', '/usr/local/lib/python38.zip', '/usr/local/lib/python3.8', '/usr/local/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/site-packages']
Apparently the latest version of meson (0.57.0) somehow broke systemd
OSS-Fuzz builds. Since it was released systemd has been failing to compile
with
```
2021-02-14T21:23:53.3854577Z [481/664] clang++ -o fuzz-compress fuzz-compress.p/src_fuzz_fuzz-compress.c.o -L/usr/lib/clang/12.0.0/lib/linux -Wl,--as-needed -Wl,--allow-shlib-undefined '-Wl,-rpath,$ORIGIN/src/shared' -Wl,-rpath-link,/work/build/src/shared -Wl,--start-group src/shared/libsystemd-shared-247.so -lFuzzingEngine -Wl,--end-group
2021-02-14T21:23:53.3856578Z FAILED: fuzz-compress
2021-02-14T21:23:53.3858714Z clang++ -o fuzz-compress fuzz-compress.p/src_fuzz_fuzz-compress.c.o -L/usr/lib/clang/12.0.0/lib/linux -Wl,--as-needed -Wl,--allow-shlib-undefined '-Wl,-rpath,$ORIGIN/src/shared' -Wl,-rpath-link,/work/build/src/shared -Wl,--start-group src/shared/libsystemd-shared-247.so -lFuzzingEngine -Wl,--end-group
2021-02-14T21:23:53.4160985Z /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../libFuzzingEngine.a(FuzzerTracePC.o): In function `size':
2021-02-14T21:23:53.4162332Z /usr/local/bin/../include/c++/v1/set:641: undefined reference to `__asan_report_load8'
2021-02-14T21:23:53.4164959Z /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../libFuzzingEngine.a(FuzzerTracePC.o): In function `fuzzer::TracePC::HandleInline8bitCountersInit(unsigned char*, unsigned char*)':
2021-02-14T21:23:53.4166954Z /src/libfuzzer/FuzzerTracePC.cpp:61: undefined reference to `__asan_report_store1'
2021-02-14T21:23:53.4168493Z /src/libfuzzer/FuzzerTracePC.cpp:59: undefined reference to `__asan_report_store1'
2021-02-14T21:23:53.4170699Z /src/libfuzzer/FuzzerTracePC.cpp:59: undefined reference to `__asan_report_store1'
2021-02-14T21:23:53.4172114Z /src/libfuzzer/FuzzerTracePC.cpp:63: undefined reference to `__asan_report_store1'
2021-02-14T21:23:53.4173550Z /src/libfuzzer/FuzzerTracePC.cpp:63: undefined reference to `__asan_report_store1'
2021-02-14T21:23:53.4174876Z /src/libfuzzer/FuzzerTracePC.cpp:54: undefined reference to `__asan_handle_no_return'
2021-02-14T21:23:53.4176322Z /src/libfuzzer/FuzzerTracePC.cpp:64: undefined reference to `__asan_handle_no_return'
2021-02-14T21:23:53.4177521Z /src/libfuzzer/FuzzerTracePC.cpp:65: undefined reference to `__asan_handle_no_return'
2021-02-14T21:23:53.4178936Z /src/libfuzzer/FuzzerTracePC.cpp:66: undefined reference to `__asan_handle_no_return'
2021-02-14T21:23:53.4180439Z /src/libfuzzer/FuzzerTracePC.cpp:67: undefined reference to `__asan_handle_no_return'
2021-02-14T21:23:53.4182667Z /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../libFuzzingEngine.a(FuzzerTracePC.o):/src/libfuzzer/FuzzerTracePC.cpp:44: more undefined references to `__asan_handle_no_return' follow
2021-02-14T21:23:53.4185448Z /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../libFuzzingEngine.a(FuzzerTracePC.o): In function `fuzzer::TracePC::HandleInline8bitCountersInit(unsigned char*, unsigned char*)':
2021-02-14T21:23:53.4189221Z /src/libfuzzer/FuzzerTracePC.cpp:61: undefined reference to `__asan_report_load8'
2021-02-14T21:23:53.4190419Z /src/libfuzzer/FuzzerTracePC.cpp:61: undefined reference to `__asan_report_store8'
2021-02-14T21:23:53.4191618Z /src/libfuzzer/FuzzerTracePC.cpp:61: undefined reference to `__asan_report_store8'
2021-02-14T21:23:53.4192815Z /src/libfuzzer/FuzzerTracePC.cpp:41: undefined reference to `__asan_report_load8'
2021-02-14T21:23:53.4194218Z /src/libfuzzer/FuzzerTracePC.cpp:46: undefined reference to `__asan_report_store8'
2021-02-14T21:23:53.4195434Z /src/libfuzzer/FuzzerTracePC.cpp:53: undefined reference to `__asan_report_store8'
2021-02-14T21:23:53.4196673Z /src/libfuzzer/FuzzerTracePC.cpp:55: undefined reference to `__asan_report_store8'
2021-02-14T21:23:53.4278293Z /src/libfuzzer/FuzzerTracePC.cpp:61: undefined reference to `__asan_report_store1'
2021-02-14T21:23:53.4279995Z /src/libfuzzer/FuzzerTracePC.cpp:64: undefined reference to `__asan_report_load8'
```
and so on.
Hopefully this should prevent OSS-Fuzz from reporting bugs that
have alread been fixed. Though I'm not sure how stable it's going to be
given that https://github.com/google/oss-fuzz/issues/4083 is still
open. Let's see.
* [presubmit] Enforce language attribute in projectt.yaml to be always set.
* Update documentation, better presubmit check, new project template.
* add docstring to templates.py
* Add example values in the project.yaml template and remove python value for now
* Add "project: c++" to 256 projects
* format
* Add labels and selective_unpack sections to the presubmit check
* fix incorrect auto_ccs format in three projects
* fix nss emails after rebase
Right now systemd declares a requirement on libmount-devel >= 2.30.
But this is only because of fixes in libmount 2.30 that matter at
runtime. For fuzzing (and to build) any libmount version is enough.
https://github.com/systemd/systemd/commit/c0b4b0f8f548c755dee81b
relaxed the version check in systemd. To fix the build we need to
install libmount-dev (and pkg-config, because meson requires that
for pkg-config deps to actually work).
Fixes#1191.
* [systemd] Add initial systemd integration
* Add @keszybz to auto_ccs
* Use ppa:pitti/systemd-semaphore for libmount backport
* Simplify build now that dependencies are disabled
* Update Dockerfile to use upstream repo