Avoid memory corruption in sessions sync
This CL is premised on the theory that the memory corruption and related crashes are due to invalid input data being fed into the sessions sync code. See the linked bug for more details. Adds two tests that expose the scenario that is believed to be the cause of the bug. If checked in on their own, they would crash during destruction of the SyncedSessionTracker. Adds a CHECK to prevent the SyncedSessionsTracker from getting in to a bad state. The goal of this CHECK is to ensure that all crashes caused by misuse of the tracker cause a crash immediately, rather than corrupting the memory allocator's internal data structures and possibly causing crashes in unrelated code. The newly added tests would trigger this CHECK, if not for the last component of this CL. Adds a filter for incoming sync_pb::SessionHeader values. Before acting on the session, the SessionsSyncManager will now verify that the header does not contain any duplicate tab IDs. If verification fails, the header will be ignored. This part of the CL allows the new tests to pass. BUG=360822 Review URL: https://codereview.chromium.org/495593003 Cr-Commit-Position: refs/heads/master@{#291158} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291158 0039d316-1c4b-4281-b951-d872f2087c98
Showing
Please register or sign in to comment