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

36 Коммитов

Автор SHA1 Сообщение Дата
Mike Hommey feacd37eba Bug 1490845 - Avoid fuzzer symbols being hidden r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D5729

--HG--
extra : moz-landing-system : lando
2018-09-13 22:36:11 +00:00
Thomas P. 061be62bb5 Bug 1481237 - Automate updating internal libFuzzer code. r=decoder 2018-08-15 22:01:25 +00:00
Alex Gaynor 63eed5d952 Bug 1452625 - bumped in-tree libFuzzer to latest version; r=decoder
MozReview-Commit-ID: 4Y5MMrK45ts

--HG--
extra : rebase_source : 52d857583590dd3d10e280e665a4051e366210f3
2018-04-09 10:00:54 -04:00
Alex Gaynor 4259227b9c Bug 1450047 - part 2 - updated in-tree copy of libFuzzer; r=decoder
MozReview-Commit-ID: I1LZ8N82kr7

--HG--
extra : rebase_source : fefb34f48a7eed9428bc055224bb5868dcc37430
2018-03-29 14:18:36 -04:00
Alex Gaynor 94ed3ca79d Bug 1450047 - Part 1 - switch libFuzzer update script to new git repo; r=decoder
MozReview-Commit-ID: Fg6b2UyvoyS

--HG--
extra : rebase_source : 05845c5c50bb2ae8dd444f021aeb3fef2717cc58
2018-03-29 14:17:44 -04:00
Tom Ritter f572733682 Bug 1444169 Fix capitalization for a few Windows files r=aklotz
MozReview-Commit-ID: BlWgIVobOBK

--HG--
extra : rebase_source : 71a8052c562aa7be510e3a4c13a0ca698a04a5ac
2018-03-08 14:49:59 -06:00
Christian Holler 8e72e4cc2f Bug 1431090 - Prepare tools/fuzzing/ to be used with JS_STANDALONE. r=froydnj
This patch adjusts tools/fuzzing/ in such a way that the relevant parts can be
reused in the JS engine. Changes in detail include:

* Various JS_STANDALONE checks to exclude parts that cannot be included in
  those builds.

* Turn LibFuzzerRegistry and LibFuzzerRunner into generic FuzzerRegistry and
  FuzzerRunner classes and use them for AFL as well. Previously, AFL was
  piggy-backing on gtests which was kind of an ugly solution anyway (besides
  that it can't work in JS). Now more code like registry and harness is
  shared between the two and they follow almost the same call paths and entry
  points. AFL macros in FuzzingInterface have been rewritten accordingly.
  This also required name changes in various places. Furthermore, this unifies
  the way, the fuzzing target is selected, using the FUZZER environment
  variable rather than LIBFUZZER (using LIBFUZZER in browser builds will give
  you a deprecation warning because I know some people are using this already
  and need time to switch). Previously, AFL target had to be selected using
  GTEST_FILTER, so this is also much better now.

* I had to split up FuzzingInterface* such that the STREAM parts are in a
  separate set of files FuzzingInterfaceStream* because they use nsStringStream
  which is not allowed to be included into the JS engine even in a full browser
  build (error: "Using XPCOM strings is limited to code linked into libxul.").
  I also had to pull FuzzingInterface.cpp (the RAW part only) into the header
  and make it static because otherwise, would have to make not only separate
  files but also separate libraries to statically link to the JS engine, which
  seemed overkill for a single small function. The streaming equivalent of the
  function is still in a cpp file.

* LibFuzzerRegister functions are now unique by appending the module name to
  avoid redefinition errors.

MozReview-Commit-ID: 44zWCdglnHr

--HG--
extra : rebase_source : fe07c557032fd33257eb701190becfaf85ab79d0
2018-01-17 15:20:35 +01:00
Coroiu Cristina faa2f8c7da Backed out 2 changesets (bug 1431090) for Bf bustage at src/tools/fuzzing/interface/harness/FuzzerTestHarness.h
Backed out changeset 2e98bda3f397 (bug 1431090)
Backed out changeset eb6acc9e44ad (bug 1431090)

--HG--
rename : tools/fuzzing/registry/FuzzerRegistry.cpp => tools/fuzzing/libfuzzer/harness/LibFuzzerRegistry.cpp
rename : tools/fuzzing/registry/FuzzerRegistry.h => tools/fuzzing/libfuzzer/harness/LibFuzzerRegistry.h
rename : tools/fuzzing/interface/harness/FuzzerRunner.cpp => tools/fuzzing/libfuzzer/harness/LibFuzzerRunner.cpp
rename : tools/fuzzing/interface/harness/FuzzerRunner.h => tools/fuzzing/libfuzzer/harness/LibFuzzerRunner.h
rename : tools/fuzzing/interface/harness/FuzzerTestHarness.h => tools/fuzzing/libfuzzer/harness/LibFuzzerTestHarness.h
rename : tools/fuzzing/interface/harness/moz.build => tools/fuzzing/libfuzzer/harness/moz.build
2018-01-23 13:49:26 +02:00
Christian Holler 4ce6f81fee Bug 1431090 - Prepare tools/fuzzing/ to be used with JS_STANDALONE. r=froydnj
This patch adjusts tools/fuzzing/ in such a way that the relevant parts can be
reused in the JS engine. Changes in detail include:

* Various JS_STANDALONE checks to exclude parts that cannot be included in
  those builds.

* Turn LibFuzzerRegistry and LibFuzzerRunner into generic FuzzerRegistry and
  FuzzerRunner classes and use them for AFL as well. Previously, AFL was
  piggy-backing on gtests which was kind of an ugly solution anyway (besides
  that it can't work in JS). Now more code like registry and harness is
  shared between the two and they follow almost the same call paths and entry
  points. AFL macros in FuzzingInterface have been rewritten accordingly.
  This also required name changes in various places. Furthermore, this unifies
  the way, the fuzzing target is selected, using the FUZZER environment
  variable rather than LIBFUZZER (using LIBFUZZER in browser builds will give
  you a deprecation warning because I know some people are using this already
  and need time to switch). Previously, AFL target had to be selected using
  GTEST_FILTER, so this is also much better now.

* I had to split up FuzzingInterface* such that the STREAM parts are in a
  separate set of files FuzzingInterfaceStream* because they use nsStringStream
  which is not allowed to be included into the JS engine even in a full browser
  build (error: "Using XPCOM strings is limited to code linked into libxul.").
  I also had to pull FuzzingInterface.cpp (the RAW part only) into the header
  and make it static because otherwise, would have to make not only separate
  files but also separate libraries to statically link to the JS engine, which
  seemed overkill for a single small function. The streaming equivalent of the
  function is still in a cpp file.

* LibFuzzerRegister functions are now unique by appending the module name to
  avoid redefinition errors.

MozReview-Commit-ID: 44zWCdglnHr

--HG--
rename : tools/fuzzing/libfuzzer/harness/LibFuzzerRunner.cpp => tools/fuzzing/interface/harness/FuzzerRunner.cpp
rename : tools/fuzzing/libfuzzer/harness/LibFuzzerRunner.h => tools/fuzzing/interface/harness/FuzzerRunner.h
rename : tools/fuzzing/libfuzzer/harness/LibFuzzerTestHarness.h => tools/fuzzing/interface/harness/FuzzerTestHarness.h
rename : tools/fuzzing/libfuzzer/harness/moz.build => tools/fuzzing/interface/harness/moz.build
rename : tools/fuzzing/libfuzzer/harness/LibFuzzerRegistry.cpp => tools/fuzzing/registry/FuzzerRegistry.cpp
rename : tools/fuzzing/libfuzzer/harness/LibFuzzerRegistry.h => tools/fuzzing/registry/FuzzerRegistry.h
extra : rebase_source : 7d0511ca0591dbf4d099376011402e063a79ee3b
2018-01-17 15:20:35 +01:00
Sylvestre Ledru 4591d82b23 Bug 1394734 - Replace CONFIG['CLANG*'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: HbF5oT5HW6f

--HG--
extra : rebase_source : eca479b6ae4bff7f600d1cdb39e11ac2057e4e79
2017-12-07 22:09:38 +01:00
Eric Rahm 07c97a5afe Bug 1423773 - Part 1: Remove usage of nsStringGlue.h. r=glandium
This removes an unnecessary level of indirection by replacing all
nsStringGlue.h instances with just nsString.h.

--HG--
extra : rebase_source : 340989240af4018f3ebfd92826ae11b0cb46d019
2017-12-06 16:52:51 -08:00
Tom Ritter 7be06512ea Bug 1414394 Mark write()'s in libfuzzer as Unused to silence a warning r=njn
MozReview-Commit-ID: GbWTgrndfoa

--HG--
extra : rebase_source : fdee12c1d8d969a7efddd0937388d7ce61aba22c
2017-11-03 23:17:27 -05:00
Chris Manchester e84068a5db Bug 1411712 - Move libfuzzer ldflags filtering to moz.build. r=mshal
MozReview-Commit-ID: 50aeTifZ1gT

--HG--
extra : rebase_source : b89709f4bb5027061ab8da0fee0e864d4f25bb97
2017-11-02 11:47:49 -07:00
Chris Manchester 8dc000aa60 Bug 1403346 - Move cxxflags filtering for libfuzzer from Makefile.in to moz.build r=glandium
MozReview-Commit-ID: LDHiMMRjqut
2017-10-25 15:12:10 -07:00
Chris Peterson a0c8081df4 Bug 870698 - Part 4: Replace Equals("") with EqualsLiteral(""). r=erahm
MozReview-Commit-ID: G1GhyvD29WK

--HG--
extra : rebase_source : 115842c37a40041bdca7b4e1ff0a5680b02ced15
extra : source : 90bfff9c01d80086cdc17637f310e898fea295ea
2017-09-06 01:13:45 -07:00
Chris Peterson 39d2406e74 Bug 1389851 - libfuzzer: Suppress -Wunreachable-code-return warnings in FuzzerDriver.cpp. r=decoder
Suppress these warnings intead of fixing them because libfuzzer is a third-party llvm library:

tools/fuzzing/libfuzzer/FuzzerDriver.cpp:450:10: warning: 'return' will never be executed [-Wunreachable-code-return]
tools/fuzzing/libfuzzer/FuzzerDriver.cpp:663:12: warning: 'return' will never be executed [-Wunreachable-code-return]

MozReview-Commit-ID: 9mWEuc5wCn9

--HG--
extra : rebase_source : e880a5da2dac2f8c79139646713b02feb4ddc9b7
2017-08-15 21:04:55 -07:00
Chris Peterson dbae46159f Bug 1373525 - libfuzzer: Remove unused member function ScopedXPCOM::failed(). r=decoder
tools/fuzzing/libfuzzer/harness/LibFuzzerTestHarness.h:118:10: warning: unused member function 'failed' [-Wunused-member-function]

MozReview-Commit-ID: 7hsvvnnolcl

--HG--
extra : source : f80cd86fd1e116f59b23539292bb6d5dd6afcc7c
extra : intermediate-source : bb240b1bedb9c4503d34370f652b4a5dc9f68628
2017-06-13 00:42:23 -07:00
rforbes 5fa372aaa0 Bug 1365994 - Update libfuzzer r=decoder
MozReview-Commit-ID: GCwIIZd5PTS
***
1365994 - update moz.build for libfuzzer

MozReview-Commit-ID: IxbLnviJC08

--HG--
extra : rebase_source : 2ca4965181388fa113e2781fbd14b5f5ae2bbc4b
2017-05-18 10:23:05 -07:00
Tom Tromey 2a731f278c Bug 1362215 - use MOZ_FORMAT_PRINTF in TestHarness.h; r=froydnj
MozReview-Commit-ID: JtNSFoowLIv

--HG--
extra : rebase_source : 64b4151db74653b40822b31cd2a5136204d630d4
2017-05-05 14:23:00 -06:00
Mike Hommey ce74ceac47 Bug 1330533 - Remove XRE_LibFuzzerGetFuncs. r=decoder
Now that XRE_LibFuzzerGetFuncs is not used from outside libxul, it can
be inlined in LibFuzzerRunner::Run, simplifying things a little more.

--HG--
extra : rebase_source : 7a09f37444bf02983b232c964d85e7a866221f48
2017-01-12 16:02:50 +09:00
Mike Hommey 7523430127 Bug 1330533 - Use FuzzerDriver directly instead of wrapping it in a libfuzzer_main function. r=decoder
Going further from the previous changes, all libfuzzer_main really does
is call the init function, and then proceed to call the fuzzer driver
with the testing function.

So instead of calling that function for it to do all that, the
LibFuzzerRunner can just call the init function itself, and then
call the fuzzer driver with the testing function.

--HG--
extra : rebase_source : 2eb1a2ae763ef21827471cd32addceacefc1ac5d
2017-01-12 14:44:18 +09:00
Mike Hommey cc6c5d8f71 Bug 1330533 - Pass LibFuzzerInitFunc and LibFuzzerTestingFunc to libfuzzer_main. r=decoder
The LibFuzzerRunner code lives in libxul. It's unnecessary complications
to have it call back a function in the firefox executable just so that
it calls another function that is in libxul. Passing the init and
testing functions to the libfuzzer_main function allows to just bypass
that roundtrip, simplifying the setup.

--HG--
extra : rebase_source : ba72c029a904e05fe3b0ed5984c1bad946b73c6a
2017-01-12 14:50:14 +09:00
Mike Hommey 92c5bff388 Bug 1330533 - Remove argc/argv arguments to XRE_LibFuzzerSetMain. r=decoder
The function given to XRE_LibFuzzerSetMain is called from somewhere that
does have access to argc/argv already, so we can avoid passing them
to XRE_LibFuzzerSetMain.

This actually might fix subtle issues with argc/argv not really matching
reality when calling the LibFuzzerMain function in the current code:
some arguments are handled before the call, and both argc and argv are
modified from within XRE_main, but the values stored for the
LibFuzzerMain call still are the original ones.

Argv being a pointer, and it not being reallocated, the value stored for
the LibFuzzerMain call points to the changed one, but argc, being an
integer, is not modified accordingly.

In fact, it's actually worse, because while the Gecko code doesn't
reallocate argv, gtk_main might. So if some GTK flag is passed on the
command line, there's also a possibility that the LibFuzzerMain function
will do a use-after-free.

So all in all, it's just better to use the set of modified argc/argv
from XRE_main instead of storing them from main().

--HG--
extra : rebase_source : 92b89909eab0fc2f67ce372b959bb0e3ed12cd2b
2017-01-12 11:59:37 +09:00
Benjamin Smedberg c7352a6657 Bug 1306329 - Stop exporting XPCOM and XUL symbols. r=glandium
--HG--
extra : rebase_source : 482177f9c1026e527cff9f23b36a5076fa6d07a5
2016-12-02 12:55:34 -05:00
Mike Hommey 02f74c5857 Bug 1330481 - Fix "error: a storage class can only be specified for objects and functions". r=decoder
--HG--
extra : rebase_source : df4938bbea56575742cb44648636a0d24c3bf581
2017-01-12 11:01:37 +09:00
Wes Kocher d4ced30f67 Backed out 4 changesets (bug 1306329) for 3000+ hazards a=backout
Backed out changeset 1c2f51ce3faf (bug 1306329)
Backed out changeset 6bb17b9a62d8 (bug 1306329)
Backed out changeset 377ca1419f1a (bug 1306329)
Backed out changeset ad4e531c7070 (bug 1306329)

MozReview-Commit-ID: KJAxdyJeJ6J
2017-01-17 17:55:24 -08:00
Benjamin Smedberg d616a7ec44 Bug 1306329 - Stop exporting XPCOM and XUL symbols. r=glandium
--HG--
extra : rebase_source : 8c700498470b42279197f316d553154b1f2ed235
2016-12-02 12:55:34 -05:00
Christian Holler (:decoder) 623744a3cb Bug 1320387 - Add missing include in libfuzzer harness. r=froydnj
MozReview-Commit-ID: 3L0DKH4IEMA
2016-11-28 22:12:56 +01:00
Christian Holler (:decoder) 1ff4780834 Bug 1302451 - Import LibFuzzer code. r=froydnj
MozReview-Commit-ID: 3NRSquBHyr2
2016-11-07 15:58:20 +01:00
Tom Tromey 7bc8491bea Bug 1067547 - unify ScopedLogging implementations and use in nsEmbedFunctions; r=bsmedberg
MozReview-Commit-ID: 6hDZDaBsNFM

--HG--
extra : rebase_source : 9422c235ebdffd84e06137bb2c63ce106cb39f0b
2016-09-26 11:06:38 -06:00
Christian Holler (:decoder) 69b3ee60b9 Bug 1289194 - Make LibFuzzerRunner use its own private ScopedXPCOM copy. r=ted
MozReview-Commit-ID: Kul2N4GA7O7

--HG--
extra : rebase_source : f2706dcf33c1d589b4f3711634c1d45c3a036f95
2016-08-24 22:35:03 +02:00
Christian Holler (:decoder) 3c7149e85d Bug 1289194 - Experimental LibFuzzer integration. r=glandium
MozReview-Commit-ID: 9njDcbltyow

--HG--
extra : rebase_source : 774d25f2ac4e4b1a876e48159333188bc722f940
2016-09-01 15:07:01 +02:00
Sebastian Hengst a66df0b0c2 Backed out changeset 95e68b473e91 (bug 1289194) for failure to process moz.build file. r=backout a=backout
MozReview-Commit-ID: GhfzNoiE808
2016-09-07 18:45:40 +02:00
Sebastian Hengst 24724bde80 Backed out changeset 13a770064f3e (bug 1289194)
MozReview-Commit-ID: ILJkzxfSLdU
2016-09-07 18:44:36 +02:00
Christian Holler (:decoder) c0f039672e Bug 1289194 - Make LibFuzzerRunner use its own private ScopedXPCOM copy. r=ted
--HG--
extra : histedit_source : b3e8b3ced49f6aeb35a156251f37f7b463624891
2016-08-24 22:35:03 +02:00
Christian Holler (:decoder) 055c4fb1dd Bug 1289194 - Experimental LibFuzzer integration. r=glandium
--HG--
extra : histedit_source : a632f3ff76e07562d1854bc68b50499e4b4667a0
2016-09-01 15:07:01 +02:00