Skip to content
Snippets Groups Projects
  1. Sep 13, 2024
  2. Sep 11, 2024
    • B. Scott Michel's avatar
      Minor bug fixes · fcea4e93
      B. Scott Michel authored
      - Fix downcasts with debug-casting.h macros
      - Fix signed/unsigned mismatches.
      - Fix warnings.
      fcea4e93
    • B. Scott Michel's avatar
      Consolidated work-in-progress · 416a193e
      B. Scott Michel authored
      Consolidate work-in-progress, bug fixes and improvements. Lots of
      warning reductions and various cleanups.
      416a193e
    • B. Scott Michel's avatar
      minimal glib support · f44bf047
      B. Scott Michel authored
      - Add BUILDING_SLIRP to the static library
      - Ensure SLIRP_EXPORT is consistently used when defining an exported
        funcion
      - Add some ISO C safety calls, e.g., strerror_s.
      - Rabin-Karp string search algorithm for g_strstr_len. Needs a test
        harness to ensure that it works properly (hint: it does.)
      - Add "WALL" option to CMakeLists.txt
      - Add string operations test harness, strops_test.c
      - Move tests under a tests/ subdirectory.
      - Find and fix errata.
      - Add <io.h> for Win32 POSIX-compatible functions, such as open(), close()
      - Add slirp_os_socket typedef to abstract the network socket type.
        Unixen use int and Win32 uses SOCKET.
      - inet_pton for non-Win32.
      f44bf047
  3. Aug 04, 2024
  4. Jul 30, 2024
  5. Jun 02, 2024
  6. Jun 01, 2024
    • Biswapriyo Nath's avatar
      windows: allow static linking with LIBSLIRP_STATIC macro · 84361923
      Biswapriyo Nath authored
      When the macro is defined it will help to link with libslirp statically.
      Otherwise, dllimport attribute is added with function symbols and linker
      errors are shown as following for static linking.
      
      undefined reference to `__imp_slirp_input'
      undefined reference to `__imp_slirp_cleanup'
      undefined reference to `__imp_slirp_remove_hostfwd'
      etc.
      84361923
  7. May 12, 2024
  8. May 09, 2024
  9. May 06, 2024
  10. Apr 26, 2024
  11. Apr 25, 2024
  12. Apr 24, 2024
    • Samuel Thibault's avatar
      Add fuzzing CI · ea785a27
      Samuel Thibault authored
      ea785a27
    • Samuel Thibault's avatar
      fuzz: Add ip filtering · 6f28e96e
      Samuel Thibault authored
      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.
      6f28e96e
    • Marc-André Lureau's avatar
      tcp: hack syn/ack · f045cdc9
      Marc-André Lureau authored and Samuel Thibault's avatar Samuel Thibault committed
      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
      f045cdc9
    • Maelie CHAN PENG's avatar
      fuzzing: Increase coverage · 884d39ee
      Maelie CHAN PENG authored and Samuel Thibault's avatar Samuel Thibault committed
      
      - 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: default avatarJC <luffy33820@gmail.com>
      Also-by: default avatarAlisee Lafontaine <alisee.lafontaine@u-bordeaux.fr>
      884d39ee
    • jeremy marchand's avatar
      First attempt at fuzzing with libFuzzer based on @elmarco work · 0e9b0ad4
      jeremy marchand authored and Samuel Thibault's avatar Samuel Thibault committed
      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.
      0e9b0ad4
    • Marc-André Lureau's avatar
      Start some fuzzing test · b5f4b774
      Marc-André Lureau authored and Samuel Thibault's avatar Samuel Thibault committed
      
      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: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      b5f4b774
    • Samuel Thibault's avatar
      tcp: Fix testing for last fragment · bdba265d
      Samuel Thibault authored
      Spotted thanks to ASAN & fuzzing.
      bdba265d
    • Samuel Thibault's avatar
      icmp: Fix msg duplication for debugging · 0ad461c2
      Samuel Thibault authored
      In case of socket error, we are not consuming the package. So duplicate
      it after socket operations, once we are sure that we will consume the
      packet.
      0ad461c2
    • Samuel Thibault's avatar
      tcp: Fix allocating room · b39edde0
      Samuel Thibault authored
      For reassembly, tcpiphdr2qlink needs an additional struct qlink before the
      tcpiphdr
      b39edde0
    • Samuel Thibault's avatar
      mbuf: Be extra careful with freed pointer · 41b92e27
      Samuel Thibault authored
      As coverity reports, we are not supposed to do anything with a freed
      pointer, not even assigning it to m. So break the loop before doing so.
      41b92e27
Loading