Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions benchmarks/lcms_cms_transform_fuzzer_all_seeds/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder@sha256:87ca1e9e19235e731fac8de8d1892ebe8d55caf18e7aa131346fc582a2034fdd

RUN apt-get update && \
apt-get install -y \
make \
automake \
libtool \
wget

RUN git clone https://github.com/mm2/Little-CMS.git

RUN wget -qO $OUT/cms_transform_fuzzer.dict \
https://raw.githubusercontent.com/google/fuzzing/master/dictionaries/icc.dict
COPY cms_transform_fuzzer.cc build.sh $SRC/
# Download the seeds tarball from your GitHub repository
RUN wget https://raw.githubusercontent.com/ardier/fuzzbench/minimized-subsumed-mutants-benchmark-with-seeds/benchmarks/lcms_cms_transform_fuzzer_all_seeds/seeds.tar.gz -O /tmp/seeds.tar.gz

# Extract the seeds tarball to the /opt/seeds directory
RUN mkdir -p /opt/seeds && \
tar -xzvf /tmp/seeds.tar.gz -C /opt/seeds
# ADD seeds /opt/seeds
24 changes: 24 additions & 0 deletions benchmarks/lcms_cms_transform_fuzzer_all_seeds/benchmark.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

commit: f0d963261b28253999e239a844ac74d5a8960f40
commit_date: 2023-01-25T18:20:28+0000
fuzz_target: cms_transform_fuzzer
project: lcms
unsupported_fuzzers:
- symcc_afl
- symcc_afl_single
- symcc_aflplusplus
- afldd
- aflpp_vs_dd
23 changes: 23 additions & 0 deletions benchmarks/lcms_cms_transform_fuzzer_all_seeds/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash -ex
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cd Little-CMS
./autogen.sh
./configure
make -j $(nproc)

$CXX $CXXFLAGS $SRC/cms_transform_fuzzer.cc -I include/ src/.libs/liblcms2.a \
$FUZZER_LIB -o $OUT/cms_transform_fuzzer
cp -r /opt/seeds $OUT/
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include <stdint.h>

#include "lcms2.h"

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
cmsHPROFILE srcProfile = cmsOpenProfileFromMem(data, size);
if (!srcProfile) return 0;

cmsHPROFILE dstProfile = cmsCreate_sRGBProfile();
if (!dstProfile) {
cmsCloseProfile(srcProfile);
return 0;
}

cmsColorSpaceSignature srcCS = cmsGetColorSpace(srcProfile);
cmsUInt32Number nSrcComponents = cmsChannelsOf(srcCS);
cmsUInt32Number srcFormat;
if (srcCS == cmsSigLabData) {
srcFormat =
COLORSPACE_SH(PT_Lab) | CHANNELS_SH(nSrcComponents) | BYTES_SH(0);
} else {
srcFormat =
COLORSPACE_SH(PT_ANY) | CHANNELS_SH(nSrcComponents) | BYTES_SH(1);
}

cmsUInt32Number intent = 0;
cmsUInt32Number flags = 0;
cmsHTRANSFORM hTransform = cmsCreateTransform(
srcProfile, srcFormat, dstProfile, TYPE_BGR_8, intent, flags);
cmsCloseProfile(srcProfile);
cmsCloseProfile(dstProfile);
if (!hTransform) return 0;

uint8_t output[4];
if (T_BYTES(srcFormat) == 0) { // 0 means double
double input[nSrcComponents];
for (uint32_t i = 0; i < nSrcComponents; i++) input[i] = 0.5f;
cmsDoTransform(hTransform, input, output, 1);
} else {
uint8_t input[nSrcComponents];
for (uint32_t i = 0; i < nSrcComponents; i++) input[i] = 128;
cmsDoTransform(hTransform, input, output, 1);
}
cmsDeleteTransform(hTransform);

return 0;
}
37 changes: 37 additions & 0 deletions benchmarks/lcms_cms_transform_fuzzer_dominator_mutants/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder@sha256:87ca1e9e19235e731fac8de8d1892ebe8d55caf18e7aa131346fc582a2034fdd

RUN apt-get update && \
apt-get install -y \
make \
automake \
libtool \
wget

RUN git clone https://github.com/mm2/Little-CMS.git

RUN wget -qO $OUT/cms_transform_fuzzer.dict \
https://raw.githubusercontent.com/google/fuzzing/master/dictionaries/icc.dict
COPY cms_transform_fuzzer.cc build.sh $SRC/
# Download the seeds tarball from your GitHub repository
RUN wget https://raw.githubusercontent.com/ardier/fuzzbench/minimized-subsumed-mutants-benchmark-with-seeds/benchmarks/lcms_cms_transform_fuzzer_dominator_mutants/seeds.tar.gz -O /tmp/seeds.tar.gz

# Extract the seeds tarball to the /opt/seeds directory
RUN mkdir -p /opt/seeds && \
tar -xzvf /tmp/seeds.tar.gz
# ADD seeds /opt/seeds
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

commit: f0d963261b28253999e239a844ac74d5a8960f40
commit_date: 2023-01-25T18:20:28+0000
fuzz_target: cms_transform_fuzzer
project: lcms
unsupported_fuzzers:
- symcc_afl
- symcc_afl_single
- symcc_aflplusplus
- afldd
- aflpp_vs_dd
23 changes: 23 additions & 0 deletions benchmarks/lcms_cms_transform_fuzzer_dominator_mutants/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash -ex
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cd Little-CMS
./autogen.sh
./configure
make -j $(nproc)

$CXX $CXXFLAGS $SRC/cms_transform_fuzzer.cc -I include/ src/.libs/liblcms2.a \
$FUZZER_LIB -o $OUT/cms_transform_fuzzer
cp -r /opt/seeds $OUT/
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include <stdint.h>

#include "lcms2.h"

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
cmsHPROFILE srcProfile = cmsOpenProfileFromMem(data, size);
if (!srcProfile) return 0;

cmsHPROFILE dstProfile = cmsCreate_sRGBProfile();
if (!dstProfile) {
cmsCloseProfile(srcProfile);
return 0;
}

cmsColorSpaceSignature srcCS = cmsGetColorSpace(srcProfile);
cmsUInt32Number nSrcComponents = cmsChannelsOf(srcCS);
cmsUInt32Number srcFormat;
if (srcCS == cmsSigLabData) {
srcFormat =
COLORSPACE_SH(PT_Lab) | CHANNELS_SH(nSrcComponents) | BYTES_SH(0);
} else {
srcFormat =
COLORSPACE_SH(PT_ANY) | CHANNELS_SH(nSrcComponents) | BYTES_SH(1);
}

cmsUInt32Number intent = 0;
cmsUInt32Number flags = 0;
cmsHTRANSFORM hTransform = cmsCreateTransform(
srcProfile, srcFormat, dstProfile, TYPE_BGR_8, intent, flags);
cmsCloseProfile(srcProfile);
cmsCloseProfile(dstProfile);
if (!hTransform) return 0;

uint8_t output[4];
if (T_BYTES(srcFormat) == 0) { // 0 means double
double input[nSrcComponents];
for (uint32_t i = 0; i < nSrcComponents; i++) input[i] = 0.5f;
cmsDoTransform(hTransform, input, output, 1);
} else {
uint8_t input[nSrcComponents];
for (uint32_t i = 0; i < nSrcComponents; i++) input[i] = 128;
cmsDoTransform(hTransform, input, output, 1);
}
cmsDeleteTransform(hTransform);

return 0;
}
37 changes: 37 additions & 0 deletions benchmarks/lcms_cms_transform_fuzzer_minimized_mutants/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder@sha256:87ca1e9e19235e731fac8de8d1892ebe8d55caf18e7aa131346fc582a2034fdd

RUN apt-get update && \
apt-get install -y \
make \
automake \
libtool \
wget

RUN git clone https://github.com/mm2/Little-CMS.git

RUN wget -qO $OUT/cms_transform_fuzzer.dict \
https://raw.githubusercontent.com/google/fuzzing/master/dictionaries/icc.dict
COPY cms_transform_fuzzer.cc build.sh $SRC/
# Download the seeds tarball from your GitHub repository
RUN wget https://raw.githubusercontent.com/ardier/fuzzbench/minimized-subsumed-mutants-benchmark-with-seeds/benchmarks/lcms_cms_transform_fuzzer_minimized_mutants/seeds.tar.gz -O /tmp/seeds.tar.gz

# Extract the seeds tarball to the /opt/seeds directory
RUN mkdir -p /opt/seeds && \
tar -xzvf /tmp/seeds.tar.gz
# ADD seeds /opt/seeds
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

commit: f0d963261b28253999e239a844ac74d5a8960f40
commit_date: 2023-01-25T18:20:28+0000
fuzz_target: cms_transform_fuzzer
project: lcms
unsupported_fuzzers:
- symcc_afl
- symcc_afl_single
- symcc_aflplusplus
- afldd
- aflpp_vs_dd
23 changes: 23 additions & 0 deletions benchmarks/lcms_cms_transform_fuzzer_minimized_mutants/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash -ex
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cd Little-CMS
./autogen.sh
./configure
make -j $(nproc)

$CXX $CXXFLAGS $SRC/cms_transform_fuzzer.cc -I include/ src/.libs/liblcms2.a \
$FUZZER_LIB -o $OUT/cms_transform_fuzzer
cp -r /opt/seeds $OUT/
Loading