Fix use-after-free bug triggered when memory pressure reaches critical
When memory pressure reaches critical, SingleTreeTracker clears the pending_entries_ map. However, if an inclusion check is in progress for one or more of those pending entries, LogDnsClient will have a pointer to a MerkleAuditProof held in that map. This results in it trying to access freed memory. The fix is to cancel all inclusion checks when this happens. This is done by changing LogDnsClient to provide a "resource handle" when it starts a query, which can be deleted in order to abort the query. Storing this in pending_entries_ assures that all inclusion checks will be aborted when pending_entries_ is cleared. Bug: 811566 Change-Id: I86b7ff880c050b790d219fa0cd50b42839bc0d3e Reviewed-on: https://chromium-review.googlesource.com/939627Reviewed-by:Ryan Sleevi <rsleevi@chromium.org> Reviewed-by:
Matt Mueller <mattm@chromium.org> Commit-Queue: Rob Percival <robpercival@chromium.org> Cr-Commit-Position: refs/heads/master@{#546183}
Showing
This diff is collapsed.
This diff is collapsed.
Please register or sign in to comment