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 4a65a669e11b from angle #35427

Merged
merged 3 commits into from Aug 25, 2022

Conversation

ppontes
Copy link
Member

@ppontes ppontes commented Aug 24, 2022

M104: Vulkan: Fix garbage collection vs outside-RP-only flush

In https://chromium-review.googlesource.com/c/angle/angle/+/3379231, an
optimization was implemented such that the excessive recorded texture
uploads would get flushed early and submitted. This caused a
use-after-free bug in the following situation:

  • Draw with pipeline A
  • Delete A <--- this puts A in the Context garbage list
  • Upload a lot of data

At this point, the flush threshold could pass and the commands recorded
outside of the render pass up to this point would be submitted.
Associated with this submission was the current garbage, including
pipeline A. However, the render pass that uses pipeline A is still not
submitted.

Now if after some time the render pass is still open, but the "completed
commands" are checked (another set of uploads causing another
submission, a query status check, etc), the garbage can be cleaned up.

When the render pass closes next and is submitted, the implementation
attempts to use the pipeline, which is already deleted.

In this change, outside-render-pass-only submissions no longer reference
the current garbage. This has the side effect that the temporary
buffers used for uploading texture data won't be released early. A
future optimization may want to separate the garbage list in ContextVk
to render pass and outside render pass garbage.

Bug: chromium:1337538
Change-Id: Ibfc11f2b0d166b0c325fced725f23d6b9328ff98
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3821371
Reviewed-by: Amirali Abdolrashidi abdolrashidi@google.com

Ref electron/security#201

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

@ppontes ppontes requested review from a team as code owners August 24, 2022 13:44
@ppontes ppontes added 19-x-y backport-check-skip Skip trop's backport validity checking security 🔒 semver/patch backwards-compatible bug fixes labels Aug 24, 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 Aug 24, 2022
@ppontes ppontes force-pushed the cherry-pick/19-x-y/angle/4a65a669e11b branch from d5f1d26 to 000ed53 Compare August 24, 2022 20:32
@codebytere codebytere merged commit 7fc35f0 into 19-x-y Aug 25, 2022
@codebytere codebytere deleted the cherry-pick/19-x-y/angle/4a65a669e11b branch August 25, 2022 13:55
@release-clerk
Copy link

release-clerk bot commented Aug 25, 2022

Release Notes Persisted

Security: backported fix for CVE-2022-2854.

@ppontes ppontes removed the wip ⚒ label Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
19-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

2 participants