Skip to content

[skia-sync] Merge upstream chrome/m153 - #350

Merged
mattleibow merged 2 commits into
skiasharpfrom
skia-sync/m153
Sep 3, 2026
Merged

[skia-sync] Merge upstream chrome/m153#350
mattleibow merged 2 commits into
skiasharpfrom
skia-sync/m153

Conversation

@mattleibow

@mattleibow mattleibow commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Note

Required merge method

Merge commit only. Do not squash or rebase this PR. The two-parent merge ancestry is required
so future syncs can prove which upstream commits are already integrated.

Description

Automated upstream merge of chrome/m153.

This pull request was produced by skia-upstream-sync.

SkiaSharp issue

N/A — automated upstream synchronization.

Required SkiaSharp PR

Requires mono/SkiaSharp#4927

Areas affected

  • C API (include/c, src/c)
  • Native dependency / DEPS
  • Build (gn / build files)
  • Upstream Skia merge or rebase
  • Rendering output / behavior
  • Other

Changes

Two-parent merge of upstream chrome/m153 into skiasharp (fork base
ca4e52cbb95210aaf4cc5d2deaa32b478a28429a).

  • Upstream ref: chrome/m153
  • Base upstream: 9d07e5bad9e3e21da2426946e589daa647218271
  • Target upstream: 4f574af2444846ceca4d277a8095c5d4229d175f[M153] Fix UAF in SkCachedData::internalUnref
  • Merge commit: d87457da65b27386267485bb10253b5ab9112121 (parents: fork base + target upstream)

The range is a single upstream commit touching exactly one file,
src/core/SkCachedData.cpp: it destroys the AutoMutexWritable RAII guard before
delete this in internalUnref, fixing a use-after-free (mutex unlocked after the
owning object was freed).

  • Conflicts: none — automatic merge, no fork patch touched.
  • Fork patches: audit_fork_patches.py --validate reports 0 added / 0 changed / 0 removed. Every fork patch preserved.
  • Dependencies: DEPS byte-identical between fork base and target; skia-dependency-changes.json shows changes: []. No revision, cgmanifest, or Component Governance change.
  • C API / build lists: no changes under include/c or src/c; no GN build-list changes.

Testing

Native library built from source on Linux/x64 (externals-linux --arch=x64,
libSkiaSharp.so.153.0.0, libHarfBuzzSharp.so.0.61421.0). Bindings regenerated: no
new native functions, no generated diff. Full unfiltered
tests/SkiaSharp.Tests.Console.slnx (net10.0/x64) passed:

  • SkiaSharp.Tests: Passed 6127, Skipped 33, Failed 0
  • SkiaSharp.Tests.SingletonInit: Passed 1, Failed 0
  • SkiaSharp.Vulkan.Tests: Passed 23, Skipped 2, Failed 0
  • SkiaSharp.Direct3D.Tests: Passed 2, Skipped 3, Failed 0

No GpuPolicy-required backend was skipped; the Vulkan backend (lavapipe) initialized
and executed. Remaining skips are the existing platform-policy skips (Direct3D on
Linux, etc.).

Human review

  • Only Linux/x64 was built and tested here. Windows (x64/Direct3D), macOS (arm64/x64/Metal), Android, iOS, and WASM were not executed and need CI/reviewer coverage.
  • Change is an internal-only correctness fix with no API/ABI surface; risk is low.

Checklist

  • Targets the skiasharp branch
  • Changes above lists every added/changed C API export or states that none changed
  • Companion mono/SkiaSharp PR linked above

Last rendered by the sync workflow: 2026-09-03T00:49:16Z

ArthurSonzogni and others added 2 commits September 2, 2026 10:14
Original change's description:
> Fix UAF in SkCachedData::internalUnref
>
> Destroy AutoMutexWritable before calling delete this in
> SkCachedData::internalUnref to avoid unlocking the mutex after the
> object has been deleted.
>
> This was found while trying to enable the MiraclePtr rewrite
> that would protect "this" and cause deterministic termination.
> Fixed: 553345874
> Bug: 351867706
> Doc: https://bit.ly/miracleptr-skia
> Change-Id: I0a1d3aed3b3d41e4ed06505295a14028ff634788
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1340596
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>

(cherry picked from commit d7c1561)

Bug: 553827434,553345874,351867706
Change-Id: I0a1d3aed3b3d41e4ed06505295a14028ff634788
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1348216
Auto-Submit: Chrome Cherry Picker <chrome-cherry-picker@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
@mattleibow mattleibow added partner/agentic-workflows Issues and PRs created by SkiaSharp agentic workflows. type/milestone-sync Any upstream Skia sync PR (milestone bump, same-milestone bug-fix re-sync, or tip sync). labels Sep 3, 2026
@mattleibow
mattleibow marked this pull request as ready for review September 3, 2026 04:31
@mattleibow
mattleibow merged commit 92dc1a6 into skiasharp Sep 3, 2026
3 checks passed
@mattleibow
mattleibow deleted the skia-sync/m153 branch September 3, 2026 05:02
mattleibow added a commit to mono/SkiaSharp that referenced this pull request Sep 3, 2026
[skia-sync] Merge upstream chrome/m153 bug fixes (#4927)

Requires: mono/skia#350
Changes: mono/skia@ca4e52c...92dc1a6

Advance the mono/skia submodule within milestone 153 to include the upstream
SkCachedData::internalUnref use-after-free fix.

The previous implementation could delete SkCachedData before its
AutoMutexWritable guard released the object's mutex. The upstream correction
records the unref result, destroys the guard, and only then deletes the object,
preventing an unlock through freed memory.

Keep chrome_milestone and product versions at 153. Update the cgmanifest
upstream commit to 4f574af24448 and point both its Skia registration and the
submodule gitlink at the actual mono/skia merge commit 92dc1a61df70.

That merge has the reviewed native commit d87457da65b2 as its second parent and
an identical tree, so the repin preserves the source that passed the native
Linux x64 build, binding regeneration, and full managed test solution.

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

partner/agentic-workflows Issues and PRs created by SkiaSharp agentic workflows. type/milestone-sync Any upstream Skia sync PR (milestone bump, same-milestone bug-fix re-sync, or tip sync).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants