Skip to content

Commit 4a656f0

Browse files
authored
Merge branch 'master' into fix-openssh-build
2 parents 7f91ed6 + 88d8897 commit 4a656f0

File tree

60 files changed

+251
-61
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+251
-61
lines changed

infra/cifuzz/cifuzz-base/Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717
FROM gcr.io/oss-fuzz-base/base-runner
1818

1919
RUN apt-get update && \
20-
apt-get install -y systemd && \
21-
wget https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/docker-ce-cli_20.10.8~3-0~ubuntu-focal_amd64.deb -O /tmp/docker-ce.deb && \
22-
dpkg -i /tmp/docker-ce.deb && \
23-
rm /tmp/docker-ce.deb
20+
apt-get install -y systemd wget gnupg && \
21+
install -m 0755 -d /etc/apt/keyrings && \
22+
wget -qO- https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
23+
chmod a+r /etc/apt/keyrings/docker.gpg && \
24+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu focal stable" > /etc/apt/sources.list.d/docker.list && \
25+
apt-get update && \
26+
apt-get install -y docker-ce-cli
2427

2528
ENV PATH=/opt/gcloud/google-cloud-sdk/bin/:$PATH
2629
ENV OSS_FUZZ_ROOT=/opt/oss-fuzz

infra/cifuzz/cifuzz-base/ubuntu-24-04.Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717
FROM gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04
1818

1919
RUN apt-get update && \
20-
apt-get install -y systemd && \
21-
wget https://download.docker.com/linux/ubuntu/dists/noble/pool/stable/amd64/docker-ce-cli_26.0.0-1~ubuntu.24.04~noble_amd64.deb -O /tmp/docker-ce.deb && \
22-
dpkg -i /tmp/docker-ce.deb && \
23-
rm /tmp/docker-ce.deb
20+
apt-get install -y systemd wget gnupg && \
21+
install -m 0755 -d /etc/apt/keyrings && \
22+
wget -qO- https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
23+
chmod a+r /etc/apt/keyrings/docker.gpg && \
24+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu noble stable" > /etc/apt/sources.list.d/docker.list && \
25+
apt-get update && \
26+
apt-get install -y docker-ce-cli
2427

2528
ENV PATH=/opt/gcloud/google-cloud-sdk/bin/:$PATH
2629
ENV OSS_FUZZ_ROOT=/opt/oss-fuzz

projects/apache-commons-collections/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
FROM gcr.io/oss-fuzz-base/base-builder-jvm
1818

19-
RUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \
19+
RUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \
2020
unzip maven.zip -d $SRC/maven && \
2121
rm -rf maven.zip
2222

23-
ENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn
23+
ENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn
2424

2525
RUN git clone https://github.com/apache/commons-collections
2626

projects/apache-poi/src/main/java/org/apache/poi/POIFileHandlerFuzzer.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.apache.poi;
1818

19+
import java.awt.AWTError;
1920
import java.awt.geom.IllegalPathStateException;
2021
import java.io.ByteArrayInputStream;
2122
import java.io.IOException;
@@ -50,6 +51,7 @@
5051
import org.apache.poi.stress.XWPFFileHandler;
5152
import org.apache.poi.util.DocumentFormatException;
5253
import org.apache.poi.util.RecordFormatException;
54+
import org.apache.poi.xssf.binary.XSSFBParseException;
5355
import org.apache.xmlbeans.XmlException;
5456
import org.junit.platform.commons.util.ExceptionUtils;
5557
import org.opentest4j.AssertionFailedError;
@@ -99,13 +101,18 @@ public static void fuzzerTestOneInput(byte[] input) throws Exception {
99101
IllegalArgumentException | IllegalStateException | IndexOutOfBoundsException | NoSuchElementException |
100102
UnsupportedOperationException | NegativeArraySizeException | BufferUnderflowException |
101103
ChunkNotFoundException | RecordInputStream.LeftoverDataException | RecordFormatException |
102-
OpenXML4JException | OpenXML4JRuntimeException | DocumentFormatException |
104+
OpenXML4JException | OpenXML4JRuntimeException | DocumentFormatException | XSSFBParseException |
103105
// some FileHandlers perform checks via assertions, so we expect this type of exception as well
104106
AssertionFailedError | TestAbortedException |
105107
NotImplementedException | FormulaParseException | IllegalPathStateException
106108
e) {
107109
// expected here
108-
} catch (java.lang.InternalError e) {
110+
} catch (AWTError e) {
111+
// POI cannot fix it if there is no DISPLAY
112+
if (!ExceptionUtils.readStackTrace(e).contains("Can't connect to X11 window server")) {
113+
throw e;
114+
}
115+
} catch (InternalError e) {
109116
// POI cannot fix it if the font-system is not fully installed, so let's ignore
110117
// this for fuzzing
111118
if (!ExceptionUtils.readStackTrace(e).contains("Fontconfig head is null")) {

projects/apache-poi/src/main/java/org/apache/poi/POIHSLFFuzzer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ public static void fuzzerTestOneInput(byte[] input) {
4343
slides.write(NullOutputStream.INSTANCE);
4444
} catch (IOException | IllegalArgumentException | RecordFormatException |
4545
IllegalStateException | HSLFException | IndexOutOfBoundsException |
46-
BufferUnderflowException | POIXMLException | NoSuchElementException e) {
46+
BufferUnderflowException | POIXMLException | NoSuchElementException |
47+
NegativeArraySizeException e) {
4748
// expected here
4849
}
4950

projects/binutils/fuzz_addr2line.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
2121
int
2222
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
2323
{
24+
if (size > 16384)
25+
return 0;
2426
char filename[256];
2527
sprintf(filename, "/tmp/libfuzzer.%d", getpid());
2628
FILE *fp = fopen(filename, "wb");

projects/binutils/fuzz_as.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ xatexit (void (*fn) (void) ATTRIBUTE_UNUSED)
3232

3333
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
3434
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
35+
if (size > 1024)
36+
return 0;
3537
char filename[256];
3638
sprintf(filename, "/tmp/libfuzzer-%d.s", getpid());
3739
FILE *fp = fopen(filename, "wb");

projects/binutils/fuzz_bfd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ static int bufferToFile(char * name, const uint8_t *Data, size_t Size) {
3939
char *target = NULL;
4040

4141
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
42+
if (Size > 16384)
43+
return 0;
4244
char tmpfilename[32];
4345

4446
if (bfd_init() != BFD_INIT_MAGIC)

projects/binutils/fuzz_bfd_ext.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ static int bufferToFile(char *name, const uint8_t *Data, size_t Size) {
4242
}
4343

4444
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
45+
if (Size > 16384)
46+
return 0;
4547
char tmpfilename[32];
4648

4749
if (bfd_init() != BFD_INIT_MAGIC)

projects/binutils/fuzz_dlltool.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
6060
int
6161
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
6262
{
63-
if (size < 512) {
63+
if (size < 512 || size > 16384)
6464
return 0;
65-
}
6665

6766
/* def file */
6867
char filename[256];

0 commit comments

Comments
 (0)