Debian Codegraph @

debian/patches/CVE-2026-7949

raw
1 From f04d09d1075926a5e5ef0a52171c9c12043fab03 Mon Sep 17 00:00:00 2001
2 From: Florin Malita <[email protected]>
3 Date: Fri, 27 Mar 2026 12:07:04 -0400
4 Subject: [PATCH] Use a local data copy for strike deserialization
5
6 The readStrikeData() input is volatile (shared memory) and untrusted.
7
8 To avoid time-of-check to time-of-use issues during deserialization,
9 always make a copy when transitioning to internal/non-volatile APIs.
10
11 This is similar to the other defensive copies used in Chromium's
12 cc/paint_op deserialization, e.g. [1].
13
14 [1] https://source.chromium.org/chromium/chromium/src/+/main:cc/paint/paint_op_reader.cc;drc=9c91b2494d4bf0a2d33b5985f7d1af79e72146f2;l=329
15
16 Bug: https://issues.chromium.org/issues/496206134
17 Change-Id: I775d24b10ee7348b159016171ce044737f5bcbe0
18 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1197136
19 Commit-Queue: Florin Malita <[email protected]>
20 Reviewed-by: Kaylee Lubick <[email protected]>
21 ---
22 src/text/gpu/SkChromeRemoteGlyphCache.cpp | 5 ++++-
23 1 file changed, 4 insertions(+), 1 deletion(-)
24
25 diff --git a/src/text/gpu/SkChromeRemoteGlyphCache.cpp b/src/text/gpu/SkChromeRemoteGlyphCache.cpp
26 index b0a37db298..caf2869d3a 100644
27 --- a/src/text/gpu/SkChromeRemoteGlyphCache.cpp
28 +++ b/src/text/gpu/SkChromeRemoteGlyphCache.cpp
29 @@ -632,9 +632,12 @@ bool SkStrikeClientImpl::readStrikeData(const volatile void* memory, size_t memo
30 SkASSERT(memorySize != 0);
31 SkASSERT(memory != nullptr);
32
33 + // Use a local copy to defend against volatile memory TOCTOU issues during deserialization.
34 + sk_sp<SkData> safeMemory = SkData::MakeWithCopy(const_cast<const void*>(memory), memorySize);
35 +
36 // We do not need to set any SkDeserialProcs here because SkStrikeServerImpl::writeStrikeData
37 // did not encode any SkImages.
38 - SkReadBuffer buffer{const_cast<const void*>(memory), memorySize};
39 + SkReadBuffer buffer{safeMemory->data(), safeMemory->size()};
40 // Limit the kinds of effects that appear in a glyph's drawable (crbug.com/1442140):
41 buffer.setAllowSkSL(false);
42
43 --
44 2.43.0
45