Implement the LookupCacheV5 for the SafeBrowsing V5
Categories
(Toolkit :: Safe Browsing, task)
Tracking
()
People
(Reporter: timhuang, Assigned: timhuang, NeedInfo)
References
(Blocks 2 open bugs)
Details
Attachments
(5 external files)
V5 tables reuse LookupCacheV4, so each V5 table keeps its own full-hash cache and V5 completions are filtered to the table that asked. hashes.search returns every threat type for a prefix, so a completion for one table throws away what it learned for the others, and the same prefix can be completed again for another table.
This bug adds LookupCacheV5 so that V5 tables share one full-hash cache, owned by the Classifier, instead of keeping one per table. The real-time mode will depend on this shared cache.
| Assignee | ||
Updated•15 days ago
|
| Assignee | ||
Comment 1•14 days ago
|
||
This patch moves nsUrlClassifierHashCompleterBase into its own files
without changing its code. The following patches extend it with the V5
completion callback.
| Assignee | ||
Comment 2•14 days ago
|
||
This patch moves the full hash cache of LookupCache, with its check,
expiry sweep, cache info and dump logic, into a FullHashCache class that
LookupCache holds as a member. Behavior doesn't change. The following
patches add a V5 cache on top of FullHashCache that isn't tied to one
LookupCache.
| Assignee | ||
Comment 3•14 days ago
|
||
This patch clears mLastResults in nsUrlClassifierDBServiceWorker::ClearCache().
CacheCompletions() skips a result set that equals the last one it cached,
but ClearCache() emptied the caches without forgetting that set. If the
same prefix was completed again within the same second after a clear, the
result was never cached and the next lookup sent another completion
request.
| Assignee | ||
Comment 4•14 days ago
|
||
This patch adds ParseSearchHashesResponse(), which turns a V5
SearchHashesResponse into the returned full hashes, each with a bitmask of
its threat types, and the cache duration. The following patch uses it for
V5 completions in place of the parser in nsUrlClassifierUtils.
The parser drops a FullHashDetail with an unknown threat type or with any
attribute, because CANARY must not be enforced, FRAME_ONLY never applies
to top-level loads, and unknown attributes must be disregarded. Like the
parser it replaces, it reads a missing cache_duration as 0 seconds and
skips a full hash that isn't 32 bytes instead of failing the response.
makeSearchHashesResponseV5 replaces the test utility
makeFindFullHashResponseV5 and can build responses with several threat
types per full hash.
| Assignee | ||
Comment 5•14 days ago
|
||
This patch adds V5FullHashCache, one full hash cache owned by the
Classifier, and LookupCacheV5 for the V5 tables with a threat type, which
read it. hashes.search returns every threat type of a prefix, so a
completion for one table now also answers the others. A table is only
confirmed when the full hash carries its threat type. Tables without one,
such as goog-badbinurl-proto, stay LookupCacheV4 tables.
Comment 8•1 day ago
|
||
Backed out for causing build bustages @TestV5FullHashCache.cpp.
Comment 9•1 day ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/ca33906c567e
https://hg.mozilla.org/mozilla-central/rev/cf0a8a8d4796
https://hg.mozilla.org/mozilla-central/rev/95e13d0f14aa
https://hg.mozilla.org/mozilla-central/rev/c8039ea32922
https://hg.mozilla.org/mozilla-central/rev/1cc7326a50bd
Comment 10•1 day ago
|
||
Comment 11•1 day ago
|
||
Backout merged: https://hg-edge.mozilla.org/mozilla-central/rev/e6a3794207ab973cade0f08fc5cba1cd4438e572
Description
•