public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/guava] rawhide: Fix CVE-2026-102554
@ 2026-10-27 11:01 Marian Koncek
  0 siblings, 0 replies; only message in thread
From: Marian Koncek @ 2026-10-27 11:01 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/guava
Branch : rawhide
Commit : 4bbf35f4078dcca91d256a21f4aa5f20d77c4b7f
Author : Marian Koncek <mkoncek@redhat.com>
Date   : 2026-10-27T10:58:21+01:00
Stats  : +189/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/guava/c/4bbf35f4078dcca91d256a21f4aa5f20d77c4b7f?branch=rawhide

Log:
Fix CVE-2026-102554

---
diff --git a/guava-33.5.0-CVE-2026-102554.patch b/guava-33.5.0-CVE-2026-102554.patch
new file mode 100644
index 0000000..fd1e5d5
--- /dev/null
+++ b/guava-33.5.0-CVE-2026-102554.patch
@@ -0,0 +1,188 @@
+From fa8b2ac73ec1ad5ad2b7cddf28cc79528c811217 Mon Sep 17 00:00:00 2001
+From: Marian Koncek <mkoncek@redhat.com>
+Date: Tue, 27 Oct 2026 10:42:02 +0100
+Subject: [PATCH] Avoid eagerly allocating as much memory as a serialization
+ payload requests.
+
+See the security advisory that this addresses (GHSA-xxph-c9ww-hj94) (CVE-2026-102554).
+
+Changed MapMaker, CompactHashMap, and CompactHashSet deserialization to avoid
+eagerly allocating as much memory as a serialization payload requests.
+
+Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
+---
+ .../common/collect/CompactHashMapTest.java    | 25 +++++++++++++++++++
+ .../common/collect/CompactHashSetTest.java    | 25 +++++++++++++++++++
+ .../collect/MapMakerInternalMapTest.java      | 25 +++++++++++++++++++
+ .../google/common/collect/CompactHashMap.java |  2 +-
+ .../google/common/collect/CompactHashSet.java |  2 +-
+ .../common/collect/MapMakerInternalMap.java   |  2 +-
+ 6 files changed, 78 insertions(+), 3 deletions(-)
+
+diff --git a/guava-tests/test/com/google/common/collect/CompactHashMapTest.java b/guava-tests/test/com/google/common/collect/CompactHashMapTest.java
+index f1baeba..a7914e7 100644
+--- a/guava-tests/test/com/google/common/collect/CompactHashMapTest.java
++++ b/guava-tests/test/com/google/common/collect/CompactHashMapTest.java
+@@ -19,7 +19,13 @@ package com.google.common.collect;
+ import static com.google.common.collect.Iterables.getOnlyElement;
+ import static com.google.common.truth.Truth.assertThat;
+ import static java.lang.Math.max;
++import static org.junit.Assert.assertThrows;
+ 
++import java.io.ByteArrayInputStream;
++import java.io.ByteArrayOutputStream;
++import java.io.IOException;
++import java.io.ObjectInputStream;
++import java.io.ObjectOutputStream;
+ import com.google.common.collect.testing.MapTestSuiteBuilder;
+ import com.google.common.collect.testing.TestStringMapGenerator;
+ import com.google.common.collect.testing.features.CollectionFeature;
+@@ -143,4 +149,23 @@ public class CompactHashMapTest extends TestCase {
+       assertThat(map.values).hasLength(expectedSize);
+     }
+   }
++
++  public void testDeserializeWithHugeSize() throws Exception {
++    CompactHashMap<Integer, String> map = CompactHashMap.create();
++    map.put(1, "1");
++    ByteArrayOutputStream baos = new ByteArrayOutputStream();
++    try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
++      oos.writeObject(map);
++    }
++    try (ObjectInputStream ois =
++        new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray())) {
++          @Override
++          public int readInt() throws IOException {
++            int unused = super.readInt();
++            return Integer.MAX_VALUE;
++          }
++        }) {
++      assertThrows(IOException.class, ois::readObject);
++    }
++  }
+ }
+diff --git a/guava-tests/test/com/google/common/collect/CompactHashSetTest.java b/guava-tests/test/com/google/common/collect/CompactHashSetTest.java
+index 7145ef1..4731277 100644
+--- a/guava-tests/test/com/google/common/collect/CompactHashSetTest.java
++++ b/guava-tests/test/com/google/common/collect/CompactHashSetTest.java
+@@ -19,7 +19,13 @@ package com.google.common.collect;
+ import static com.google.common.truth.Truth.assertThat;
+ import static java.lang.Math.max;
+ import static java.util.Arrays.asList;
++import static org.junit.Assert.assertThrows;
+ 
++import java.io.ByteArrayInputStream;
++import java.io.ByteArrayOutputStream;
++import java.io.IOException;
++import java.io.ObjectInputStream;
++import java.io.ObjectOutputStream;
+ import com.google.common.annotations.GwtIncompatible;
+ import com.google.common.collect.testing.SetTestSuiteBuilder;
+ import com.google.common.collect.testing.TestStringSetGenerator;
+@@ -127,4 +133,23 @@ public class CompactHashSetTest extends TestCase {
+       assertThat(set.elements).hasLength(expectedSize);
+     }
+   }
++
++  public void testDeserializeWithHugeSize() throws Exception {
++    CompactHashSet<Integer> set = CompactHashSet.create();
++    set.add(1);
++    ByteArrayOutputStream baos = new ByteArrayOutputStream();
++    try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
++      oos.writeObject(set);
++    }
++    try (ObjectInputStream ois =
++        new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray())) {
++          @Override
++          public int readInt() throws IOException {
++            int unused = super.readInt();
++            return Integer.MAX_VALUE;
++          }
++        }) {
++      assertThrows(IOException.class, ois::readObject);
++    }
++  }
+ }
+diff --git a/guava-tests/test/com/google/common/collect/MapMakerInternalMapTest.java b/guava-tests/test/com/google/common/collect/MapMakerInternalMapTest.java
+index 7bc01a7..05e0ddc 100644
+--- a/guava-tests/test/com/google/common/collect/MapMakerInternalMapTest.java
++++ b/guava-tests/test/com/google/common/collect/MapMakerInternalMapTest.java
+@@ -26,6 +26,11 @@ import com.google.common.collect.MapMakerInternalMap.Strength;
+ import com.google.common.collect.MapMakerInternalMap.WeakValueEntry;
+ import com.google.common.collect.MapMakerInternalMap.WeakValueReference;
+ import com.google.common.testing.NullPointerTester;
++import java.io.ByteArrayInputStream;
++import java.io.ByteArrayOutputStream;
++import java.io.IOException;
++import java.io.ObjectInputStream;
++import java.io.ObjectOutputStream;
+ import java.lang.ref.Reference;
+ import java.util.concurrent.atomic.AtomicReferenceArray;
+ import junit.framework.TestCase;
+@@ -940,4 +945,24 @@ public class MapMakerInternalMapTest extends TestCase {
+     NullPointerTester tester = new NullPointerTester();
+     tester.testAllPublicInstanceMethods(makeMap(createMapMaker()));
+   }
++
++  public void testDeserializeWithHugeSize() throws Exception {
++    ByteArrayOutputStream baos = new ByteArrayOutputStream();
++    try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
++      oos.writeObject(makeMap(createMapMaker()));
++    }
++    try (ObjectInputStream ois =
++        new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray())) {
++          @Override
++          public int readInt() throws IOException {
++            int unused = super.readInt();
++            return Integer.MAX_VALUE;
++          }
++        }) {
++      MapMakerInternalMap<?, ?, ?, ?> deserialized =
++          (MapMakerInternalMap<?, ?, ?, ?>) ois.readObject();
++      assertThat(deserialized).isEmpty();
++      assertThat(deserialized.segments[0].table.length()).isEqualTo(64);
++    }
++  }
+ }
+diff --git a/guava/src/com/google/common/collect/CompactHashMap.java b/guava/src/com/google/common/collect/CompactHashMap.java
+index cb381e9..7047c95 100644
+--- a/guava/src/com/google/common/collect/CompactHashMap.java
++++ b/guava/src/com/google/common/collect/CompactHashMap.java
+@@ -1111,7 +1111,7 @@ class CompactHashMap<K extends Object, V extends Object>
+     if (elementCount < 0) {
+       throw new InvalidObjectException("Invalid size: " + elementCount);
+     }
+-    init(elementCount);
++    init(Math.min(elementCount, 256));
+     for (int i = 0; i < elementCount; i++) {
+       K key = (K) stream.readObject();
+       V value = (V) stream.readObject();
+diff --git a/guava/src/com/google/common/collect/CompactHashSet.java b/guava/src/com/google/common/collect/CompactHashSet.java
+index 6d9a3a7..1239ef6 100644
+--- a/guava/src/com/google/common/collect/CompactHashSet.java
++++ b/guava/src/com/google/common/collect/CompactHashSet.java
+@@ -695,7 +695,7 @@ class CompactHashSet<E extends Object> extends AbstractSet<E> implements Seriali
+     if (elementCount < 0) {
+       throw new InvalidObjectException("Invalid size: " + elementCount);
+     }
+-    init(elementCount);
++    init(Math.min(elementCount, 256));
+     for (int i = 0; i < elementCount; i++) {
+       E element = (E) stream.readObject();
+       add(element);
+diff --git a/guava/src/com/google/common/collect/MapMakerInternalMap.java b/guava/src/com/google/common/collect/MapMakerInternalMap.java
+index d8bc4f9..16e5296 100644
+--- a/guava/src/com/google/common/collect/MapMakerInternalMap.java
++++ b/guava/src/com/google/common/collect/MapMakerInternalMap.java
+@@ -2813,7 +2813,7 @@ final class MapMakerInternalMap<
+     MapMaker readMapMaker(ObjectInputStream in) throws IOException {
+       int size = in.readInt();
+       return new MapMaker()
+-          .initialCapacity(size)
++          .initialCapacity(Math.min(size, 256))
+           .setKeyStrength(keyStrength)
+           .setValueStrength(valueStrength)
+           .keyEquivalence(keyEquivalence)
+-- 
+2.56.0
+

diff --git a/guava.spec b/guava.spec
index f393af4..e23715a 100644
--- a/guava.spec
+++ b/guava.spec
@@ -15,6 +15,7 @@ Source0:        https://github.com/google/guava/archive/v%{version}/guava-%{vers
 
 Patch:          0001-Remove-NullMarked-filtering-and-annotation-collectio.patch
 Patch:          0002-Fix-invalid-Maven-attribute-values-in-compilerArgs.patch
+Patch:          guava-33.5.0-CVE-2026-102554.patch
 
 BuildRequires:  jurand
 %if %{with bootstrap}

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-27 11:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27 11:01 [rpms/guava] rawhide: Fix CVE-2026-102554 Marian Koncek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox