On 19 April 2017 at 12:29, 'priyesh bansal' via afl-users
You can check out the setup that we used for Linux filesystem fuzzing,
in fact we already have a networking fuzzer which sends frames on a
tun/tap (virtual ethernet) interface as if the frames were coming from
the network:
https://github.com/oracle/kernel-fuzzing/blob/master/fuzzers/net/net.cc
This method probably requires that you also compile a kernel with
profiling enabled so that you can see where you hit dead ends
(checkums, etc.) and fix it up to let your packets reach further -- we
did that and did manage to get packets to reach some manner of IP
packet processing.
IIRC we ran into a problem with deferred processing where e.g. the
frame/packet/whatever is placed on a queue and then processed
asynchronously by a different thread/workqueue/softirq/tasklet (and
thus won't contribute to the instrumentation feedback to AFL). I don't
remember the specific problem well enough to say definitely how to
solve it, but one approach I've tried for syzkaller in the meantime is
to move various asynchronous processing to the syscall exit path to
make it deterministic. It's not particularly easy and requires some
fairly specific kernel knowledge to get it right.
Getting the whole thing set up is quite involved as you'll have to
apply a patch to AFL to work with the kernel, you'll have to apply
patches to the kernel to implement the AFL driver, and some more
patches to the kernel to generate the config (general instructions at
<
https://github.com/oracle/kernel-fuzzing/blob/master/README.md>).
We'll maybe try to make it easier at some point in the future.
As Hanno said, it's probably worth getting started with an easier
project (using vanilla AFL) first :-)
Vegard