Change information
Commit message:
[M148] ozone/x11: Fix UAF inside X11Window::GetBoundsInPixels()
Original change's description:
> ozone/x11: Fix UAF inside X11Window::GetBoundsInPixels()
>
> When GetBoundsInPixels() triggers synchronous nested message loops
> within GeometryCache, the calling X11Window instance can be
> synchronously destroyed. Subsequent operations in X11Window continue
> executing on the freed this context, leading to potential memory
> corruption in the browser process.
>
> This CL resolves the issue by:
> 1. Making weak_ptr_factory_ mutable in X11Window.
> 2. Guarding GetBoundsInPixels() calls in all critical X11Window methods
> using base::WeakPtrFactory to prevent executing subsequent code if
> this has been destroyed.
> 3. Adding a regression/POC unit test verifying the safety of
> SetBoundsInPixels under re-entrancy deletion conditions.
>
> Fixed: 516653777
> Change-Id: I812afc95f56e77770cda51ad783e206ba0f1b4c1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7875980
> Commit-Queue: Thomas Anderson <thomasa...@chromium.org>
> Commit-Queue: Lei Zhang <the...@chromium.org>
> Auto-Submit: Thomas Anderson <thomasa...@chromium.org>
> Reviewed-by: Lei Zhang <the...@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1636605}
(cherry picked from commit e3ce9901de36bda58a50b1c5005dc5100b8d0991)
Fixed: 517405897
Bug: 516653777
Change-Id: I812afc95f56e77770cda51ad783e206ba0f1b4c1
Cr-Commit-Position: refs/branch-heads/7778@{#4408}
Cr-Branched-From: 77f495ee216d4c3cc784d33658bad4778c0680ee-refs/heads/main@{#1610480}
Files:
- M ui/ozone/platform/x11/x11_window.cc
- M ui/ozone/platform/x11/x11_window.h
- M ui/ozone/platform/x11/x11_window_ozone_unittest.cc
Change size: M
Delta: 3 files changed, 168 insertions(+), 15 deletions(-)
Branch: refs/branch-heads/7778
Submit Requirements:
Code-Review: +1 by Thomas Anderson, +1 by Lei Zhang