Convert from storing lowest BrowsingInstanceID to keeping all in a set.
At present ChildProcessSecurityPolicyImpl::SecurityState stores only a single BrowsingInstanceID (the lowest) even though its associated process may contain multiple BrowsingInstances. This may lead CanAccessDataForOrigin to consider the wrong BrowsingInstance when performing its checks for opt-in isolated origins. This CL converts SecurityState to track an ordered set of all the BrowsingInstanceIDs so that they can all be checked. CanAccessDataForOrigin is modified to return 'true' if *any* BrowsingInstance in the set would allow the access, otherwise it returns 'false', and logs the failure reasons for each of the BrowsingInstances. This CL also includes delayed cleanup of BrowsingInstance state from ChildProcessSecurityPolicy when BrowsingInstances are deleted. This avoids memory leaks but may pose a small risk of renderer kills. We will monitor the CanAccessDataForOrigin crash keys to see if such cases occur in practice. This is a reland of https://chromium-review.googlesource.com/c/chromium/src/+/2446370. The issues that led to https://crbug.com/1141877 are fixed in https://chromium-review.googlesource.com/c/chromium/src/+/2523732 and include a test that becomes meaningful once this CL lands. Bug: 1135539, 1141721 Change-Id: I33da01254aaf9e0bb29635cf6b68d85f4823684f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2522904 Commit-Queue: James MacLean <wjmaclean@chromium.org> Reviewed-by:Alex Moshchuk <alexmos@chromium.org> Reviewed-by:
Charlie Reis <creis@chromium.org> Cr-Commit-Position: refs/heads/master@{#826024}
Showing
This diff is collapsed.
This diff is collapsed.
Please register or sign in to comment