Skip to content

Commit 4705206

Browse files
committed
fix wireshark?
1 parent 1dbd0f7 commit 4705206

File tree

3 files changed

+43
-43
lines changed

3 files changed

+43
-43
lines changed
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 Google Inc.
1+
# Copyright 2017 Google Inc.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -14,18 +14,14 @@
1414
#
1515
################################################################################
1616

17-
FROM gcr.io/oss-fuzz-base/base-builder@sha256:87ca1e9e19235e731fac8de8d1892ebe8d55caf18e7aa131346fc582a2034fdd
17+
FROM gcr.io/oss-fuzz-base/base-builder@sha256:fb1a9a49752c9e504687448d1f1a048ec1e062e2e40f7e8a23e86b63ff3dad7c
1818

19-
RUN apt-get update && \
20-
apt-get install -y \
21-
libstdc++-9-dev libstdc++-9-dev:i386 nasm subversion \
22-
gnupg lsb-release software-properties-common pkg-config \
23-
python3-pip libgtk-3-dev unzip pax-utils file cpio ninja-build cmake \
24-
libgcrypt20-dev libc-ares-dev libpcre2-dev flex inotify-tools \
25-
libboost-dev
19+
RUN apt-get update && apt-get install -y ninja-build cmake \
20+
flex libc-ares-dev \
21+
libglib2.0-dev libgcrypt20-dev
2622

27-
RUN git clone \
28-
https://gitlab.com/wireshark/wireshark
23+
RUN git clone --depth=1 https://gitlab.com/wireshark/wireshark.git
24+
RUN git clone --depth=1 https://bitbucket.org/jwzawadzki/wireshark-fuzzdb.git
2925

3026
WORKDIR wireshark
3127
COPY build.sh $SRC/
Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,4 @@
1-
commit: 36a9f4231b3ee82bd4efee53ed8a1004ff90102d
2-
commit_date: 2023-11-11T01:07:51+00:00
3-
fuzz_target: fuzzshark
1+
commit: 238cc3beabc2b7bc4bd7e41bd0c410b21e680a06
2+
commit_date: 2025-03-24 07:43:57+00:00
3+
fuzz_target: fuzzshark_ip
44
project: wireshark
5-
unsupported_fuzzers:
6-
- aflcc
7-
- afl_qemu
8-
- aflplusplus_qemu
9-
- aflplusplus_qemu_tracepc
10-
- aflplusplus_frida
11-
- honggfuzz_qemu
12-
- klee
13-
- lafintel
14-
- weizz_qemu
15-
- aflplusplus_cmplog_double
16-
- symcc_aflplusplus_single
17-
- eclipser_aflplusplus
18-
- aflplusplus_qemu_double
19-
- fuzzolic_aflplusplus_z3
20-
- symqemu_aflplusplus
21-
- fuzzolic_aflplusplus_fuzzy
22-
- fuzzolic_aflplusplus_z3dict
23-
- tortoisefuzz

benchmarks/wireshark_fuzzshark/build.sh

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash -eu
2-
# Copyright 2018 Google Inc.
2+
# Copyright 2017 Google Inc.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -15,15 +15,33 @@
1515
#
1616
################################################################################
1717

18+
WIRESHARK_BUILD_PATH="$WORK/build"
19+
mkdir -p "$WIRESHARK_BUILD_PATH"
1820

19-
mkdir seeds
20-
find . -name "*.pcap" -exec cp {} seeds \;
21-
cp -r seeds $OUT/
21+
# Prepare Samples directory
22+
export SAMPLES_DIR="$WORK/samples"
23+
mkdir -p "$SAMPLES_DIR"
24+
cp -a $SRC/wireshark-fuzzdb/samples/* "$SAMPLES_DIR"
2225

23-
mkdir build
24-
cd build
26+
# Make sure we build fuzzshark.
27+
CMAKE_DEFINES="-DBUILD_fuzzshark=ON"
2528

26-
cmake -G Ninja .. \
29+
# compile static version of libs
30+
# XXX, with static wireshark linking each fuzzer binary is ~346 MB (just libwireshark.a is 761 MB).
31+
# XXX, wireshark is not ready for including static plugins into binaries.
32+
CMAKE_DEFINES="$CMAKE_DEFINES -DENABLE_STATIC=ON -DENABLE_PLUGINS=OFF"
33+
34+
# disable optional dependencies
35+
CMAKE_DEFINES="$CMAKE_DEFINES -DENABLE_PCAP=OFF -DENABLE_GNUTLS=OFF"
36+
37+
# There is no need to manually disable programs via BUILD_xxx=OFF since the
38+
# all-fuzzers targets builds the minimum required binaries. However we do have
39+
# to disable the Qt GUI and sharkd or else the cmake step will fail.
40+
CMAKE_DEFINES="$CMAKE_DEFINES -DBUILD_wireshark=OFF -DBUILD_logray=OFF -DBUILD_sharkd=OFF"
41+
42+
cd "$WIRESHARK_BUILD_PATH"
43+
44+
cmake -G Ninja \
2745
-DENABLE_STATIC=ON \
2846
-DOSS_FUZZ=ON \
2947
-DINSTRUMENT_DISSECTORS_ONLY=ON \
@@ -51,9 +69,14 @@ cmake -G Ninja .. \
5169
-DENABLE_ILBC=OFF \
5270
-DENABLE_LIBXML2=OFF \
5371
-DENABLE_OPUS=OFF \
54-
-DENABLE_SINSP=OFF
72+
-DENABLE_SINSP=OFF $SRC/wireshark/
73+
74+
# cmake -GNinja \
75+
# -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX \
76+
# -DCMAKE_C_FLAGS="-Wno-error=fortify-source -Wno-error=missing-field-initializers $CFLAGS" -DCMAKE_CXX_FLAGS="-Wno-error=fortify-source -Wno-error=missing-field-initializers $CXXFLAGS" \
77+
# -DDISABLE_WERROR=ON -DOSS_FUZZ=ON $CMAKE_DEFINES $SRC/wireshark/
5578

5679
ninja fuzzshark
57-
cp run/fuzzshark $OUT/fuzzshark
58-
export FUZZSHARK_TARGET="tcp"
5980

81+
82+
$SRC/wireshark/tools/oss-fuzzshark/build.sh all

0 commit comments

Comments
 (0)