Skip to content

Add optional handling of Nyx InvalidWriteToPayload event #2027

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
Apr 13, 2024

Conversation

choller
Copy link
Contributor

@choller choller commented Mar 6, 2024

This adds AFL_NYX_HANDLE_INVALID_WRITE to allow AFL++ to ignore the InvalidWriteToPayload event. If such events occur sporadically, it is most likely due to OOM in the guest where the kernel is reclaiming memory and therefore touching the payload buffer. I decided to count these as crashes, hoping that they remain visible with this approach (but with a zero-size log). However, this happens quite rarely in my local setup so it is difficult to test.

Without this variable set, AFL++ will just die and leave qemu running in the background. Long term, we might want to change the default behavior here as well.

@vanhauser-thc
Copy link
Member

Without this variable set, AFL++ will just die and leave qemu running in the background. Long term, we might want to change the default behavior here as well.

but it is wrong to keep it like this. this should kill the target (qemu). can you please add this?

@@ -1840,6 +1840,8 @@ afl_fsrv_run_target(afl_forkserver_t *fsrv, u32 timeout,
case Timeout:
return FSRV_RUN_TMOUT;
case InvalidWriteToPayload:
if (!!getenv("AFL_NYX_HANDLE_INVALID_WRITE")) { return FSRV_RUN_CRASH; }

/* ??? */
FATAL("FixMe: Nyx InvalidWriteToPayload handler is missing");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you switch FATAL to NYX_PRE_FATAL it should be enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'm testing this right now locally.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, ping when you have a result :)

@choller
Copy link
Contributor Author

choller commented Mar 6, 2024

Fwiw, I just managed to reproduce with the new code (and the env var set). The log will contain something like:

Payload buffer write attempt at RIP: ffffffff8dc26847

So that's even nicer.

@vanhauser-thc
Copy link
Member

@choller @schumilo any idea how to solve this gracefully?

@vanhauser-thc
Copy link
Member

@choller @schumilo please continue to look for a fix ... merging now.

@vanhauser-thc vanhauser-thc merged commit 1582aa9 into AFLplusplus:dev Apr 13, 2024
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy