Giter Site home page Giter Site logo

Comments (7)

v-p-b avatar v-p-b commented on May 22, 2024

It seems that KF/x doesn't complete the PT decoding before AFL++ quits:

https://github.com/intel/kernel-fuzzer-for-xen-project/blob/master/src/ptcov.c#L166

I thought that this must be a timing issue, so I tried moving afl_report before pt_decode. Interestingly in this case AFL++ dies earlier, again by reading 0 length from the same pipe:

https://github.com/AFLplusplus/AFLplusplus/blob/bd0a23de73011a390714b9f3836a46443054fdd5/src/afl-forkserver.c#L1109

A modified the code further with military grade printf's to see whether afl_wait is called at all. The answer turns out to be: sometimes o.O

Scratch that, afl_wait runs as expected, New Years hangover reduced my vision...

from kernel-fuzzer-for-xen-project.

tklengyel avatar tklengyel commented on May 22, 2024

Moving pt_decode before afl_report is not a good idea - the coverage map only gets updated after pt_decode is done, so if you signal to afl you are done then afl will take the empty/half-baked coverage map.

from kernel-fuzzer-for-xen-project.

v-p-b avatar v-p-b commented on May 22, 2024

Yeah I know, I just wanted to test if it's the decoding delay thas is causing this.

from kernel-fuzzer-for-xen-project.

domenukk avatar domenukk commented on May 22, 2024

I don't think I can help you much here, the read should never return 0 and as far as I can see, this should only happen when the pipe gets closed /EOF - so not timing related.
If you retry the write a few times, does it work for obscure reasons, or will the read it always return 0?

from kernel-fuzzer-for-xen-project.

tklengyel avatar tklengyel commented on May 22, 2024

Would be good to understand where the communication gets stuck. If afl_setup worked and you get data from afl through the read in afl_wait then the pipe is working. Does afl get the PID back that's sent in afl_wait? Then afl_report will write 4 bytes (either 0 or SIGABRT) to signal its done with the data and the coverage map is ready. So is afl returning from their read before that happens? Is there some timeout in afl that bails too early?

from kernel-fuzzer-for-xen-project.

tklengyel avatar tklengyel commented on May 22, 2024

Also, btw, usually when I see "Unable to communicate with fork server" that just means KF/x exited early. Always verify that kfx runs fine first standalone and that it doesn't report a crash. Just replace @@ with the path to one of your seeds and keep all options the same.

from kernel-fuzzer-for-xen-project.

v-p-b avatar v-p-b commented on May 22, 2024

It is a segfault in libxdc :P As I understand writes don't block the sender, so KF/x can send whatever, then by the time AFL++ tries to read the data the fork either crashed or not. It's interesting why this happens non-deterministically (sometimes libxdc can decode all traces, but during most startups it can't).

Closing this for now, thanks for your help!

from kernel-fuzzer-for-xen-project.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.