Skip to content

Support madvise(MADV_DONTDUMP) when creating core dumps for qemu-user #114

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

Merged
merged 1 commit into from
May 2, 2025

Conversation

WorksButNotTested
Copy link
Contributor

When running applications which make large (sparsely populated) address ranges (e.g. when using address sanitizer with LibAFL) the inability to exclude these regions from any core dump can result in very large files which fill the disk. A coredump is obvously very useful for performing a post-mortem when fuzzing.

Whilst the man pages state that madvise provides only a hint (and hence can be ignored), this patch adds support to handle MADV_DONTDUMP and set a corresponding flag in the page flags, thus allowing QEMU to exclude these regions from the core file.

When running applications which make large (sparsely populated) address ranges
(e.g. when using address sanitizer with LibAFL) the inability to exclude these
regions from any core dump can result in very large files which fill the disk.
A coredump is obvously very useful for performing a post-mortem when fuzzing.

Whilst the man pages state that madvise provides only a hint (and hence can be
ignored), this patch adds support to handle MADV_DONTDUMP and set a
corresponding flag in the page flags, thus allowing QEMU to exclude these
regions from the core file.
@rmalmain rmalmain merged commit d20fb07 into AFLplusplus:main May 2, 2025
1 check passed
@WorksButNotTested WorksButNotTested deleted the dontdump branch May 6, 2025 10:15
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