Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cherry-pick 1eb1e18ad41d from chromium #35880

Merged
merged 2 commits into from Oct 4, 2022

Conversation

nornagon
Copy link
Member

@nornagon nornagon commented Oct 3, 2022

Add CSSTokenizer-created strings to CSSVariableData's backing strings

When computing the value of a registered custom property, we create
a CSSVariableData object equivalent to the computed CSSValue by
serializing that CSSValue to a String, then tokenizing that value.

The problem is that CSSTokenizer can create new string objects
during the tokenization process (see calls to CSSTokenizer::
RegisterString), without communicating that fact to the call-site.

Therefore, this CL adds a way to access those strings so they can
be added to the backing strings of the CSSVariableData.

Also added a DCHECK to verify that we don't have any tokens with
non-backed string pointers.

Fixed: 1358907
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3892782
Reviewed-by: Steinar H Gunderson sesse@chromium.org
Commit-Queue: Anders Hartvoll Ruud andruud@chromium.org
Cr-Original-Commit-Position: refs/heads/main@{#1046868}
Change-Id: Ifb6d194508e99030a5a3ed5fbad5496b7263bdc1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3905727
Auto-Submit: Anders Hartvoll Ruud andruud@chromium.org
Cr-Commit-Position: refs/branch-heads/5249@{#518}
Cr-Branched-From: 4f7bea5de862aaa52e6bde5920755a9ef9db120b-refs/heads/main@{#1036826}

Ref electron/security#221

Notes: Security: backported fix for CVE-2022-3304.

@nornagon nornagon requested review from a team as code owners October 3, 2022 22:32
@nornagon nornagon added 20-x-y backport-check-skip Skip trop's backport validity checking security 🔒 semver/patch backwards-compatible bug fixes labels Oct 3, 2022
@electron-cation electron-cation bot added new-pr 🌱 PR opened in the last 24 hours and removed new-pr 🌱 PR opened in the last 24 hours labels Oct 3, 2022
@MarshallOfSound MarshallOfSound merged commit b0c881f into 20-x-y Oct 4, 2022
@MarshallOfSound MarshallOfSound deleted the cherry-pick/20-x-y/chromium/1eb1e18ad41d branch October 4, 2022 06:49
@release-clerk
Copy link

release-clerk bot commented Oct 4, 2022

Release Notes Persisted

Security: backported fix for CVE-2022-3304.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
20-x-y backport-check-skip Skip trop's backport validity checking security 🔒 semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants