Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fuzz-introspector: the reachability analysis doesn't seem to be compatible with shared libraries put in $OUT #7598

Closed
evverx opened this issue Apr 21, 2022 · 2 comments
Assignees

Comments

@evverx
Copy link
Contributor

evverx commented Apr 21, 2022

In #7593 the reachability analysis was based on incomplete data (because systemd was most likely built without lto and gold) but the result was the same on April 13: https://storage.googleapis.com/oss-fuzz-introspector/systemd/inspector-report/20220413/fuzz_report.html#functions_cov_hit_10. According to https://oss-fuzz-build-logs.storage.googleapis.com/log-6a04d4cc-752e-45ed-8479-1f6bd6924427.txt both lto and gold were used there. My guess would be that it's just not compatible with shared libraries put in $OUT. systemd installs them to $OUT with

install -Dt "$OUT/src/shared/" \
        "$build"/src/shared/libsystemd-shared-*.so \
        "$build"/src/core/libsystemd-core-*.so
evverx added a commit to evverx/systemd that referenced this issue Apr 21, 2022
fuzz-introspector passes -fuse-ld=gold and -flto using CFLAGS/LDFLAGS and due to
mesonbuild/meson#6377 (comment) and
mesonbuild/meson#6377 it doesn't mix well with meson.
It's possible to build systemd with duct tape there using something like
google/oss-fuzz#7583 (comment) but
apparently even with gold and lto some parts of systemd are missing from
reports (presumably due to google/oss-fuzz#7598).
Let's just fail here for now to make it clear that fuzz-introspector isn't supported.
yuwata pushed a commit to systemd/systemd that referenced this issue Apr 22, 2022
fuzz-introspector passes -fuse-ld=gold and -flto using CFLAGS/LDFLAGS and due to
mesonbuild/meson#6377 (comment) and
mesonbuild/meson#6377 it doesn't mix well with meson.
It's possible to build systemd with duct tape there using something like
google/oss-fuzz#7583 (comment) but
apparently even with gold and lto some parts of systemd are missing from
reports (presumably due to google/oss-fuzz#7598).
Let's just fail here for now to make it clear that fuzz-introspector isn't supported.
@DavidKorczynski DavidKorczynski self-assigned this Apr 22, 2022
@evverx
Copy link
Contributor Author

evverx commented Nov 30, 2022

@DavidKorczynski I don't think systemd will ever link all its fuzz targets statically upstream (partly because it can trigger issues like #7357 and partly because static linking is somewhat discouraged there).

All in all I think this issue can be closed. I'd probably add a paragraph saying that FI isn't compatible with shared libraries to https://github.com/ossf/fuzz-introspector/blob/main/doc/Calltree.md#discrepancies-and-pitfalls though.

@evverx evverx closed this as completed Nov 30, 2022
@evverx
Copy link
Contributor Author

evverx commented Nov 30, 2022

Just to clarify locally I link the fuzz targets statically against those libraries and FI seems to work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants