[M126-LTS] Protect ServiceWorkerVersion during ReleaseProcess
This CL avoid use-after-free around `EmbeddedWorkerInstance::ReleaseProcess()`: 1. During `ReleaseProcess()`: This CL protects `ServiceWorkerVersion` and its `EmbeddedWorkerInstance` from deletion. 2. In the direct callers of `ReleaseProcess()`: This CL early returns if `this` is deleted during `ReleaseProcess()`. Skipping `listener_list_` should be fine because `listener_list_` is the `owner_version_` (at least in non-test) that is already deleted if `this` is deleted. This CL also adds explicit comments that the methods calling `ReleaseProcess()` may delete `this`. 3. In the callers of 2.: As far as I checked, the callers should work even in the case of deletion of `ServiceWorkerVersion`. (cherry picked from commit 76ce1fe9) Bug: 350407902 Change-Id: If59e8354ae9832009b62408a8f0058cb6f6e803f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5685760 Reviewed-by:Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Original-Commit-Position: refs/heads/main@{#1324689} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5806117 Auto-Submit: Roger Felipe Zanoni da Silva (xWF) <rzanoni@google.com> Reviewed-by:
Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by:
Shunya Shishido <sisidovski@chromium.org> Commit-Queue: Roger Felipe Zanoni da Silva (xWF) <rzanoni@google.com> Owners-Override: Artem Sumaneev <asumaneev@google.com> Reviewed-by:
Artem Sumaneev <asumaneev@google.com> Cr-Commit-Position: refs/branch-heads/6478@{#1956} Cr-Branched-From: e6143acc-refs/heads/main@{#1300313}
Please register or sign in to comment