aboutsummaryrefslogtreecommitdiff
path: root/fuzzing
AgeCommit message (Collapse)AuthorFilesLines
2025-01-30Windows target build fixesB. Scott Michel1-1/+1
Meson (meson.build): - Add "target_winver" (default: "") option to support Windows versions earlier Windows 7 (0x0601, the same as glib.) This sets a compiler command-line define "-DTARGET_WINVER=${target_winver}", which unconditionally sets WINVER and _WIN32_WINNT to select the requested target Windows API. Ref: https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt - Clean up building the static library. - Build the static library when "-Dstatic=true" is present on the command line, not just when doing fuzz testing. - Add the "*_STATIC_COMPILATION" defines to the compiler's command line. For Windows, ensure that libiconv is an explicit dependency since "pkg-config --libs --static" fails to add it as a dependency library.
2024-10-09Restore SlirpAddPollCb, {,un}register_poll_fdSamuel Thibault1-17/+25
as they were before 72f85005a230 ("socket abstraction: slirp_os_socket"): that broke the ABI. Better introduce SlirpAddPollCbSocket, {,un}register_poll_socket that people can use instead, and wrappers for the old API, for a smooth API/ABI upgrade.
2024-10-01fuzz: Fix memory leak inside fuzz-mainAlexander Kuznetsov2-1/+2
Found by ALT Linux Team. Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org> Fixes #80
2024-04-26icmp6: Add echo request forwarding supportSamuel Thibault2-0/+1
2024-04-26fuzz: Fix icmp6 matching and checksum computationSamuel Thibault1-4/+16
2024-04-26fuzz: Drop debuggingSamuel Thibault2-6/+0
2024-04-26fuzz: Drop debuggingSamuel Thibault1-3/+0
2024-04-25fuzz: Add ARP and NDP casesSamuel Thibault6-2/+98
2024-04-25fuzz: Add IPv6 casesSamuel Thibault27-9/+1057
2024-04-25oss-fuzz: Fix udp-h and tcp-h corpusesSamuel Thibault1-1/+2
2024-04-25fuzz: comment coherencySamuel Thibault2-4/+4
2024-04-25fuzz: Simplify TCP checksum codeSamuel Thibault4-30/+22
2024-04-25fuzz: Fix tftp fuzz actually receiving a fileSamuel Thibault3-1/+1
2024-04-25fuzz: Add ip filteringSamuel Thibault9-67/+143
It's no use sending to the slirp stack the trace packets which are supposed to be generated by the stack. Also no use fuzzing them, then.
2024-04-25tcp: hack syn/ackMarc-André Lureau1-0/+2
We don't know in advance what the trace will have received as sequence number, so when fuzzing tcp, just align on what the trace says
2024-04-25fuzzing: Increase coverageMaelie CHAN PENG46-802/+1167
- by adding trace examples - by separating fuzzing different headers / data - by adding an echo TCP server forward - also factorizing code along the way Also-by: JC <luffy33820@gmail.com> Also-by: Alisee Lafontaine <alisee.lafontaine@u-bordeaux.fr>
2024-04-25First attempt at fuzzing with libFuzzer based on @elmarco workjeremy marchand12-43/+888
The slirp_fuzz_ip_header harness should be working and is a basic example of a custom mutator focusing on part of the input. The slirp_fuzz_udp harness needs a bit of work to calculate the checksum properly. The code can be built using `meson build` followed by `ninja -C build`, the current meson.build file is not suitable with a general usage. To run the fuzzing code just run `build/fuzzing/fuzz-ip-header fuzzing/IN -detect_leaks=0`, crash will be sent to current folder and new input will go directly in the `IN` folder. The main point to focus on to improve the fuzzing should be generating a better corpus.
2024-04-25Start some fuzzing testMarc-André Lureau8-0/+333
You can run the tests over the corpus with a "regular" build, then $ fuzzing/fuzz-input ../fuzzing/IN/* Or building with fuzzing enabled, and running: $ CFLAGS="-fsanitize=fuzzer" CC=clang CXX=clang++ meson -Db_lundef=false $ fuzzing/fuzz-input ../fuzzing/IN I have an initial corpus which was generated by running fuzz-input for a few hours starting with qemu.pkt, which is the first packet sent by qemu. Sadly, it only covers 25%... I tried to increase the coverage manually, see for example tftp-get-blah.pkt, but that's not so simple, as multiple packets may be required to setup a session etc. Neverthess, the fuzzing already found a few issues, so it might be worth to add it in this current form. fuzzing/oss-fuzz.sh is used by oss-fuzz, for Google fuzzing. (see documentation if you want to reproduce the build locally) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-04-23tcp-input: inline TCP_REASSMarc-André Lureau1-0/+0
The macro just makes things more difficult to debug, inline it. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>