Change information
Commit message:
[M149] [Ozone/Wayland]Fix Use-After-Free in OnPointerFrameEvent
Original change's description:
> [Ozone/Wayland]Fix Use-After-Free in OnPointerFrameEvent
>
> In WaylandEventSource::OnPointerFrameEvent, a raw pointer to the
> focused WaylandWindow was cached outside the loop that drains
> pointer_frames_. If the window is synchronously closed during event
> dispatch, subsequent events in the same frame would use the dangling
> pointer, leading to a Use-After-Free.
>
> This CL fixes the issue by caching the target window as a WeakPtr
> and verifying its validity before each event dispatch.
>
> BUG=523725277
> TAG=agy
> CONV=600e2394-2a5e-4d13-93b9-91470f489eeb
>
> Change-Id: I8cd33570342fc1592ef5f78c5a2ec72064af1ea7
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7958261
> Reviewed-by: Jonathan Ross <jon...@chromium.org>
> Commit-Queue: Kramer Ge <fang...@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1649050}
(cherry picked from commit 45daaa0cb895d8e01f34b3138316bcb83bb7a845)
Bug: 525660026
Change-Id: I8cd33570342fc1592ef5f78c5a2ec72064af1ea7
Cr-Commit-Position: refs/branch-heads/7827@{#3676}
Cr-Branched-From: 9f3e9aaccba63bd2ec30334e45e0bfd07ebcc8f1-refs/heads/main@{#1625079}
Files:
- M ui/ozone/platform/wayland/host/wayland_event_source.cc
- M ui/ozone/platform/wayland/host/wayland_pointer_unittest.cc
Change size: S
Delta: 2 files changed, 44 insertions(+), 3 deletions(-)
Branch: refs/branch-heads/7827