Change information
Commit message:
[M150] [X11] Guard XDragDropClient and X11Window against destruction during DnD
Original change's description:
> [X11] Guard XDragDropClient and X11Window against destruction during DnD
>
> X11Window owns XDragDropClient. During drag-and-drop event handling,
> callbacks into target/delegate drop handlers (such as PerformDrop,
> OnBeforeDragLeave, and UpdateDrag) can spin nested run loops. If the
> associated window is closed/destroyed while the nested loop is running,
> both X11Window and XDragDropClient are destroyed.
>
> When the nested loop unwinds, continuing execution in the outer stack
> frames of XDragDropClient and X11Window leads to Use-After-Free (UAF)
> vulnerabilities from raw pointer dereferences and virtual method calls.
>
> This CL fixes the issue by adding base::WeakPtr liveness guards around
> every re-entrant delegate callback in XDragDropClient and X11Window.
>
> Fixed: 532929679
> Change-Id: I5d3e89014993df43cf45db1ff2f1b7825b57ebe5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8071147
> Reviewed-by: Lei Zhang <the...@chromium.org>
> Commit-Queue: Thomas Anderson <thomasa...@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1660006}
(cherry picked from commit e4ce9e74fdba5992af9d41349ca3644cfed78c98)
Bug: 533660933,532929679
Change-Id: I5d3e89014993df43cf45db1ff2f1b7825b57ebe5
Cr-Commit-Position: refs/branch-heads/7871@{#3339}
Cr-Branched-From: f542126b8c1b3e80104b26bb05ec830bd1206f29-refs/heads/main@{#1639810}
Files:
- M ui/base/x/x11_drag_drop_client.cc
- M ui/base/x/x11_drag_drop_client.h
- M ui/ozone/platform/x11/test/x11_drag_drop_client_unittest.cc
- M ui/ozone/platform/x11/x11_window.cc
Change size: M
Delta: 4 files changed, 133 insertions(+), 1 deletion(-)
Branch: refs/branch-heads/7871