Граф коммитов

166 Коммитов

Автор SHA1 Сообщение Дата
dlee 66dc1dfad0 Bug 1353956 - P2. Do not use SHA-256 while loading the V4 prefix files. r=gcp
SHA256 is an expensive operation, we should avoid using them if
possible. SafeBrowsing prefix files are loaded during startup and
verify integrity with SHA256 which may affect the performance
especially on the low-end device.

This patch simply removes the SHA256 integrity check. CRC32 version
integrity check will be introduced in the other patch.

This patch also changes the behavior of recording
"Telemetry::URLCLASSIFIER_VLPS_LOAD_CORRUPT" a little bit.
It used to records only once per session(during startup, the first
time we load prefix set), now it records per update.

Differential Revision: https://phabricator.services.mozilla.com/D21461

--HG--
extra : moz-landing-system : lando
2019-03-07 14:40:28 +00:00
Dimi Lee 5ad694e4e9 Bug 1353956 - P1. Rename checksum used in SafeBrowsing V4 to SHA256. r=gcp
SafeBrowsing V4 protocol use SHA-256 as the checksum to check integrity
of update data and also the integrity of prefix files.

SafeBrowsing V2 HashStore use MD5 as the checksum to check integrity of
.sbstore

Since we are going to use CRC32 as the integrity check of V4 prefix files,
I think rename V4 "checksum" to SHA256 can improve readability.

Differential Revision: https://phabricator.services.mozilla.com/D21460

--HG--
extra : moz-landing-system : lando
2019-03-07 14:40:14 +00:00
Dorel Luca fc78eb74a3 Backed out 6 changesets (bug 1353956) for Linux Build bustage
Backed out changeset 71dafccc22ae (bug 1353956)
Backed out changeset f1f29fe519cf (bug 1353956)
Backed out changeset 4978556a66f6 (bug 1353956)
Backed out changeset bc0b91abce9b (bug 1353956)
Backed out changeset 6b8412db5a05 (bug 1353956)
Backed out changeset 3d326cfcd002 (bug 1353956)
2019-03-07 01:49:03 +02:00
dlee d253a723f7 Bug 1353956 - P2. Do not use SHA-256 while loading the V4 prefix files. r=gcp
SHA256 is an expensive operation, we should avoid using them if
possible. SafeBrowsing prefix files are loaded during startup and
verify integrity with SHA256 which may affect the performance
especially on the low-end device.

This patch simply removes the SHA256 integrity check. CRC32 version
integrity check will be introduced in the other patch.

This patch also changes the behavior of recording
"Telemetry::URLCLASSIFIER_VLPS_LOAD_CORRUPT" a little bit.
It used to records only once per session(during startup, the first
time we load prefix set), now it records per update.

Differential Revision: https://phabricator.services.mozilla.com/D21461

--HG--
extra : moz-landing-system : lando
2019-02-28 08:18:46 +00:00
Dimi Lee 1032932288 Bug 1353956 - P1. Rename checksum used in SafeBrowsing V4 to SHA256. r=gcp
SafeBrowsing V4 protocol use SHA-256 as the checksum to check integrity
of update data and also the integrity of prefix files.

SafeBrowsing V2 HashStore use MD5 as the checksum to check integrity of
.sbstore

Since we are going to use CRC32 as the integrity check of V4 prefix files,
I think rename V4 "checksum" to SHA256 can improve readability.

Differential Revision: https://phabricator.services.mozilla.com/D21460

--HG--
extra : moz-landing-system : lando
2019-02-28 08:12:36 +00:00
Andrea Marchesini c607e645dc Bug 1528596 - Devirtualize accesses to nsUrlClassifierUtils, r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D20086

--HG--
extra : moz-landing-system : lando
2019-02-19 14:35:57 +00:00
Kris Maglione b83df4e952 Bug 1478124: Part 8a - Update toolkit module to use a static component manifest. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D15039

--HG--
extra : rebase_source : 1683d6ced9a6c10e6fa19425debbb51950b9b629
extra : source : d94039b199437180309264cb4c206ae7ebb7d21d
2018-12-16 16:03:00 -08:00
Andrea Marchesini 4e02fc2bf6 Bug 1522265 - Moving malware, phishing and blocked URIs to features - part 3 - DBService updated, r=dimi 2019-01-29 10:11:34 +01:00
arthur.iakab 652cde9859 Backed out 4 changesets (bug 1522265) for mochitest assertion failures on extensions/cookie/nsPermissionManager.cpp CLOSED TREE
Backed out changeset 38b4179568c7 (bug 1522265)
Backed out changeset 38b824df9d02 (bug 1522265)
Backed out changeset 6085d51681f8 (bug 1522265)
Backed out changeset e6a0832f3b11 (bug 1522265)
2019-01-29 14:25:00 +02:00
Andrea Marchesini 0b9a1617c2 Bug 1522265 - Moving malware, phishing and blocked URIs to features - part 3 - DBService updated, r=dimi 2019-01-29 10:11:34 +01:00
arthur.iakab c1fae83952 Backed out 16 changesets (bug 1478124) for failing android geckoview-junit CLOSED TREE
Backed out changeset fce62c77a56b (bug 1478124)
Backed out changeset eb2fa3b5edf7 (bug 1478124)
Backed out changeset 8dacce59fcc0 (bug 1478124)
Backed out changeset 012fd0107204 (bug 1478124)
Backed out changeset 496aaf774697 (bug 1478124)
Backed out changeset 21f4fda03159 (bug 1478124)
Backed out changeset b0444e0bc801 (bug 1478124)
Backed out changeset d94039b19943 (bug 1478124)
Backed out changeset 5d85deac61c2 (bug 1478124)
Backed out changeset 929fd654c9df (bug 1478124)
Backed out changeset 1ddd80d9e91a (bug 1478124)
Backed out changeset b8d2dfdfc324 (bug 1478124)
Backed out changeset f500020a273a (bug 1478124)
Backed out changeset dd00365ebb55 (bug 1478124)
Backed out changeset 538e40c5ee13 (bug 1478124)
Backed out changeset bedaa9c437ad (bug 1478124)
2019-01-29 10:03:06 +02:00
Kris Maglione d20f7f8e72 Bug 1478124: Part 8a - Update toolkit module to use a static component manifest. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D15039

--HG--
extra : rebase_source : 55c387662960d82986a2a0205d3b8e451304db4b
extra : absorb_source : bd201f3bcf08f70480f19a22bfb7a8bd9cb015a1
extra : histedit_source : ec13a9b248801ab36baa275e566765734e6f3717
2018-12-16 16:03:00 -08:00
dlee c9e502918e Bug 1504774 - Fix url-classifier worker thread is not aborted while shutting down. r=francois
In Bug 1453038, |mUpdateInterrupted| is set in Classifer::Close() which is
called by PreShutdown to abort an ongoing update. That doesn't handle
all the cases.

The SafeBrowsing update involves two threads, worker thread, and update
thread. Update thread takes care of most of the update work, when it finishes
its task, it posts a task back to the worker thread to apply the updated database
and also do some cleanup stuff. Then the update is complete.

The fix in Bug 1453038 doesn't abort an update if the woker thread is doing
the job. This is because the |mUpdateInterrupted| flag is set in the
worker thread. The PreShutdown event which eventually sets the flag has to
wait until the worker thread's current task is done.

In this patch:
1. Check nsUrlClassifierDBService::ShutdownHasStarted() to abort shutdown.
This is set by main thread so both worker thread and update thread can
be interrupted now.
2. mIsClosed is now replaced by the mUpdateInterrupted. The semantics of
mUpdateInterrupted is now changed to abort update for any internal APIs
which should cause an update to abort.
3. Remove |mUpdateInterrupted| and |ShutdownHasStarted()| checks and
unify with |ShouldAbort()|

Differential Revision: https://phabricator.services.mozilla.com/D12229

--HG--
extra : moz-landing-system : lando
2018-12-19 10:03:19 +00:00
Andrea Marchesini 49626a83f6 Bug 1511436 - Cleanup URL-Classifier code - part 4 - lookup optimization, r=dimi 2018-12-14 12:40:18 +01:00
Andrea Marchesini 71b120ca17 Bug 1511436 - Cleanup URL-Classifier code - part 2 - nsUrlClassifierDBService::AsyncClassifyLocalWithFeatures, r=dimi 2018-12-14 12:40:17 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Dimi Lee e05a4185a6 Bug 1481819 - Make Safe Browsing directory-based file copy interruptible. r=francois
A directory-based file copy without checkpoint to abort may take lots
of time to finish. This cause an issue that if firefox is shutting down
and try to close an ongoing update thread, main-thread may be blocked
for a long time.

This patch adds a wrapper for copying an entire directory, within this
wrapper, we use file-based copy and add checkpoints to let update thread
has a chance to abort.

Differential Revision: https://phabricator.services.mozilla.com/D3414

--HG--
extra : moz-landing-system : lando
2018-09-18 14:29:20 +00:00
Gurzau Raul f4cb8a59ba Backed out changeset 6f6886c89554 (bug 1481819) for failing at url-classifier/tests/mochitest/test_classified_annotations.html 2018-09-14 21:49:04 +03:00
Dimi Lee 9117dcd8f1 Bug 1481819 - Make Safe Browsing directory-based file copy interruptible. r=francois
A directory-based file copy without checkpoint to abort may take lots
of time to finish. This cause an issue that if firefox is shutting down
and try to close an ongoing update thread, main-thread may be blocked
for a long time.

This patch adds a wrapper for copying an entire directory, within this
wrapper, we use file-based copy and add checkpoints to let update thread
has a chance to abort.

Differential Revision: https://phabricator.services.mozilla.com/D3414

--HG--
extra : moz-landing-system : lando
2018-09-14 15:33:24 +00:00
Francois Marier 9f161ab08f Bug 1461515 - Split tracking annotations from tracking protection. r=dimi
This makes it possible to use different lists for tracking protection
and for the features that rely on tracking annotations.

Differential Revision: https://phabricator.services.mozilla.com/D2484

--HG--
extra : moz-landing-system : lando
2018-08-01 20:45:41 +00:00
dlee 8ca348be37 Bug 1453038 - Interrupt update when firefox is shutting down. r=francois
URL Classifier has a mUpdateInterrupted flag to abort an ongoing
update in several checkpoints, but we didn't use this while shutting down.

Set this flag in PreShutdown() to avoid url-classifier worker thread or
update thread takes too long to finish an update.

Differential Revision: https://phabricator.services.mozilla.com/D2157

--HG--
extra : moz-landing-system : lando
2018-07-16 16:48:53 +00:00
Francois Marier 00afdd238f Bug 1467581 - Do less work in Reset() if Close() has been called. r=gcp
If Reset() is interleaved with a shutdown, there's no point in
finishing up and we may as well bail early.

MozReview-Commit-ID: Lhm6NfAEgSj

--HG--
extra : rebase_source : e74cc22a36d287a59425079a9f7c4676e7351eba
2018-06-07 17:45:46 -07:00
Francois Marier 79f1e9e5a8 Bug 1467581 - Remove the use of default captures in closures. r=gcp
Explicitly specify the arguments to copy to avoid making a copy of
a dangling `this` pointer.

Convert nsUrlClassifierDBService::mClassifier to a RefPtr since
the update closure might need to continue to access its members
after it's been released by the main thread.

MozReview-Commit-ID: CPio3n9MmsK

--HG--
extra : rebase_source : d7a8b207336209ee37441f3429bc608140e404ae
2018-06-07 17:22:32 -07:00
Francois Marier e0fce2a920 Bug 1434206 - Keep LookupResult objects in smart pointers. r=gcp
Replace raw pointers to LookupResult with RefPtrs and eplace the
nsAutoPtr objects + raw pointers params with UniquePtrs.

Also remove unnecessarily paranoid OOM checks when creating single
LookupResult objects since those are pretty small.

MozReview-Commit-ID: G85RNnAat6H

--HG--
extra : rebase_source : a8f6a1ff1e24663d428c8d894cb624e1c67e1bd3
2018-06-05 13:15:03 -07:00
Francois Marier e8e020d2af Bug 1434206 - Clarify when the lookupcache arrays should be cleared. r=gcp
MozReview-Commit-ID: 7smtnCC0MGT

--HG--
extra : rebase_source : 6288f543abc837cc8084de69f75ab30b7ce642db
2018-05-21 15:58:12 -07:00
Francois Marier 5a2649faf7 Bug 1434206 - Make LookupCache objects const as much as possible. r=gcp
MozReview-Commit-ID: AqC6NUh6ifm

--HG--
extra : rebase_source : a125989490e7988021215f47d17d3cb3b0303651
2018-05-21 15:11:01 -07:00
Francois Marier 8f19e9f805 Bug 1434206 - Keep LookupCache objects in smart pointers. r=gcp
The existing mix of UniquePtr and raw pointers is confusing when
trying to figure out the exact lifetime of these objects.

MozReview-Commit-ID: Br4S7BXEFKs

--HG--
extra : rebase_source : ba35d5c2eeda0741eb4c5491a6caf03f20f3d0ce
2018-05-16 19:13:48 -07:00
Francois Marier 84e344038a Bug 1434206 - Replace a pointer with a reference. r=gcp
This will prevent our holding on to this pointer incorrectly in the
future.

MozReview-Commit-ID: H8ueIOK1qAK

--HG--
extra : rebase_source : 937e9c702c5109b6dfc1684392a1204d8a1edc49
2018-05-15 17:18:18 -07:00
Francois Marier 8b98277f9f Bug 1434206 - Make TableUpdate objects const as much as possible. r=gcp
I tried to make TableUpdateArray point to const TableUpdate objects
everywhere but there were two problems:

- HashStore::ApplyUpdate() triggers a few Merge() calls which include
  sorting the underlying TableUpdate object first.

- LookupCacheV4::ApplyUpdate() calls TableUpdateV4::NewChecksum() when the
  checksum is missing and that sets mChecksum.

MozReview-Commit-ID: LIhJcoxo7e7

--HG--
extra : rebase_source : f6ca4bf42d1ddb897a974a0b19c7185b0b6b93af
2018-05-11 16:02:37 -07:00
Francois Marier 214074e8d4 Bug 1434206 - Keep TableUpdate objects in smart pointers. r=gcp
Manually keeping tabs on the lifetime of these objects is a pain
and is the likely source of some of our crashes. I suspect we might
also be leaking memory.

This change creates an explicit copy of the main array into the
update thread to avoid using a non-thread-safe shared data
structure. This is a shallow copy. Only the pointers to the
TableUpdates are copied, which means one pointer per list (e.g. 5
in total for google4 in a new profile).

MozReview-Commit-ID: 221d6GkKt0M

--HG--
extra : rebase_source : e1b81f11bb9b41e465571a95845079f455b5868e
2018-06-01 15:48:48 -07:00
Francois Marier a13da01475 Bug 1434206 - Assert that gethash processing happens on the right thread. r=gcp
MozReview-Commit-ID: FbF8LzCZ3XO

--HG--
extra : rebase_source : 097b1c519ddb162bce877f76b3b37eb7e80d0ac7
2018-05-11 11:47:26 -07:00
Francois Marier d16c2f1d5c Bug 1434206 - Use a TableUpdateV2 param in ApplyUpdate(). r=gcp
HashStore::ApplyUpdate() is a V2-only function and so we can be
explicit about that and remove unnecessary casts.

Add a new update error code for when we fail to cast a TableUpdate
object to the expected protocol version.

MozReview-Commit-ID: 65BBwiZJw6J

--HG--
extra : rebase_source : 3f4bb0f7594d4015e2614ef747526ec5e8168a08
2018-05-10 16:06:49 -07:00
Francois Marier 30207d91aa Bug 1434206 - Add const to members and functions that can take it. r=gcp
MozReview-Commit-ID: B2aaQTttPAV

--HG--
extra : rebase_source : bbd8d9c734660a4380922ed9b76f1af1de427f3f
2018-05-16 15:26:14 -07:00
Kris Maglione 6b12d08f7d Bug 1462937: Update callers to use nsIFile::GetDirectoryEntries as a nsIDirectoryEnumerator. r=froydnj
MozReview-Commit-ID: Iv4T1MVAF5

--HG--
extra : rebase_source : 1c518883d082884db7f9323a5acc20361228c26b
extra : histedit_source : 70a73c23d1199d3bfbb5379c78930401166c094b
2018-05-19 20:17:45 -07:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Francois Marier 7d4feeefa4 Bug 1442486 - Mark LookupCacheV4 as primed after creating it. r=gcp
RegenActiveTables() relies on mPrimed being set correctly and so
the V4 lookup cache should behave the same way as the V2 one.

The V2 lookup cache on the other hand was unnecessarily setting
mPrimed to true twice.

MozReview-Commit-ID: LwNdI9DTqZ7

--HG--
extra : rebase_source : ff7d7a051f28867be5c35c1079407bb2bfd3a490
2018-03-01 18:09:58 -08:00
Dorel Luca 6ad641c5c4 Merge mozilla-inboud to mozilla-central. a=merge 2018-02-22 11:59:54 +02:00
Jason Orendorff a48654929c Bug 1439665 - Part 1: #include some headers directly in files that use them. r=sfink.
"Include what you use."

--HG--
extra : rebase_source : 2239a380029e0efbc9dd3042459222a67c38d70f
extra : amend_source : 4453c32cc469caa592049167205666997f1a1e7b
extra : histedit_source : a533edd4a4d3d0642b08989e93674661d27baa6a%2C37d27eeef9580381ccc0de8507f60166dabf1730
2018-02-20 11:28:12 -06:00
Francois Marier 6d970e2d08 Bug 1435859 - Fix OOM crash on filenames without extensions. r=gcp
Passing a value of -1 to nsCString::Truncate() converts that
value to a large integer and leads to an unnecessary 4GB
memory allocation.

MozReview-Commit-ID: Icm5iUsEgA6

--HG--
extra : rebase_source : 7c7a52762ba86b1daadf60b0f362c5740d335781
2018-02-15 12:30:40 -08:00
dimi 48a63f5601 Bug 1408631 - Release SafeBrowsing lookupcache in worker thread while shutdown. r=francois
MozReview-Commit-ID: HuPUyIDFLPX

--HG--
extra : rebase_source : d6e4f5bbcf96c97541792e23447f0810150c5ac9
2017-10-20 10:18:59 +08:00
Thomas Nguyen e70d76485c Bug 1394031 - Remove mCryptoHash members of nsUrlClassifierDBServiceWorker and ProtocolParser
The usage of cryptoHash consists of a complete set of Init, Update, and Finish, there's
no reason to keep it around

MozReview-Commit-ID: 7bT9IsWEM5m
2017-09-14 10:51:55 +08:00
Eric Rahm 9398bd6f43 Bug 1393235 - Fix improper usages of string functions. r=njn
This fixes usages of `Find`, `RFind` and the equality operator that kind of
work right now but will break with the proper type checking of a templatized
version of the string classes.

For `Find` and `RFind` it appears that `nsCString::(R)Find("foo", 0)` calls
were being coerced to the `Find(char*, bool, int, int)` versions. The intent was
probably to just start searching from position zero.

For the equality operator, the type of nullptr is nullptr_t rather than
char(16_t)* so we'd need to add an operator overload that takes nullptr_t. In
this case just using `IsVoid` is probably more appropriate.

--HG--
extra : rebase_source : 50f78519084012ca669da0a211c489520c11d6b6
2017-08-22 19:30:46 -07:00
Kartikaya Gupta ba4b3b9101 Bug 1384233 - Remove SizePrintfMacros.h. r=froydnj
We have a minimum requirement of VS 2015 for Windows builds, which supports
the z length modifier for format specifiers. So we don't need SizePrintfMacros.h
any more, and can just use %zu and friends directly everywhere.

MozReview-Commit-ID: 6s78RvPFMzv

--HG--
extra : rebase_source : 009ea39eb4dac1c927aa03e4f97d8ab673de8a0e
2017-07-26 16:03:57 -04:00
Thomas Nguyen 7e59091f92 Bug 1378680 - Refactor usage fallible alloc in url-classifier r=francois
MozReview-Commit-ID: HHG1ByeIwZv

--HG--
extra : rebase_source : 1b025edaac49ee202b9a10cd2f2589acb587649b
2017-07-20 16:20:27 +08:00
Bill McCloskey f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Carsten "Tomcat" Book 8a1350b5a6 Backed out changeset 4f6302a98ae4 (bug 1372405)
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00
Bill McCloskey 6b3e84ed5f Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book ea1b86680c Backed out changeset 9846de3bd954 (bug 1372405)
--HG--
extra : rebase_source : 5d4a48e8ec394c329994689d938d2a6e9b2752b0
2017-06-20 08:27:02 +02:00
Bill McCloskey 4592152411 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00