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

Link *san_with_fuzzer.so with -ldl #18

Merged
merged 1 commit into from
Jul 5, 2021
Merged

Conversation

fmeum
Copy link
Contributor

@fmeum fmeum commented Jul 5, 2021

The *san_with_fuzzer.so dynamic libraries include libFuzzer, which requires libdl.so. However, in merge_libfuzzer_sanitizer.sh, the libraries are not linked with -ldl, which means that they can only be preloaded into a binary that itself links in libdl.so. While python itself does this, shells might not, which can lead to errors when the preload is applied to e.g. a wrapper script that unpacks a packaged Python application and only then invokes python itself.

This is fixed by linking *san_with_fuzzer.so with -ldl.

The `*san_with_fuzzer.so` dynamic libraries include libFuzzer, which requires `libdl.so`. However, in `merge_libfuzzer_sanitizer.sh`, the libraries are not linked with `-ldl`, which means that they can only be preloaded into a binary that itself links in `libdl.so`. While `python` itself does this, shells might not, which can lead to errors when the preload is applied to e.g. a wrapper script that unpacks a packaged Python application and only then invokes `python` itself.

This is fixed by linking `*san_with_fuzzer.so` with `-ldl`.
@TheShiftedBit TheShiftedBit merged commit 32c3341 into google:master Jul 5, 2021
@fmeum fmeum deleted the patch-2 branch July 5, 2021 11:53
@fmeum
Copy link
Contributor Author

fmeum commented Jul 5, 2021

@IanPudney Could this change be included in a PyPI release? I'm currently working on adding Atheris to Bazel's rules_fuzzing and this would help implementing the OSS-Fuzz support.

@TheShiftedBit
Copy link
Contributor

That's in progress :)

@TheShiftedBit
Copy link
Contributor

The reason for the delay: the Mac build is built manually, and I recently got a new machine, which means rebuilding Clang and its dependencies. Yay.

@TheShiftedBit
Copy link
Contributor

Linux and source-code builds are pushed. Mac incoming soon.

@TheShiftedBit
Copy link
Contributor

Mac is done.

TheShiftedBit added a commit that referenced this pull request Jul 28, 2021
Link `*san_with_fuzzer.so` with `-ldl`
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

Successfully merging this pull request may close these issues.

2 participants