Commit Graph

34 Commits

Author SHA1 Message Date
Alex Gaynor
e7dd8c5c49 Bug 1452625 - bumped in-tree libFuzzer to latest version; r=decoder
MozReview-Commit-ID: 4Y5MMrK45ts
2018-04-09 10:00:54 -04:00
Alex Gaynor
1ffa6d8235 Bug 1450047 - part 2 - updated in-tree copy of libFuzzer; r=decoder
MozReview-Commit-ID: I1LZ8N82kr7
2018-03-29 14:18:36 -04:00
Alex Gaynor
bd3ddbc72d Bug 1450047 - Part 1 - switch libFuzzer update script to new git repo; r=decoder
MozReview-Commit-ID: Fg6b2UyvoyS
2018-03-29 14:17:44 -04:00
Tom Ritter
d85883c626 Bug 1444169 Fix capitalization for a few Windows files r=aklotz
MozReview-Commit-ID: BlWgIVobOBK
2018-03-08 14:49:59 -06:00
Christian Holler
da96299906 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
2018-01-17 15:20:35 +01:00
Coroiu Cristina
f45b60d1d4 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)
2018-01-23 13:49:26 +02:00
Christian Holler
313f4d9830 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
2018-01-17 15:20:35 +01:00
Sylvestre Ledru
d6ef04e01c Bug 1394734 - Replace CONFIG['CLANG*'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: HbF5oT5HW6f
2017-12-07 22:09:38 +01:00
Eric Rahm
b80a434a68 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.
2017-12-06 16:52:51 -08:00
Tom Ritter
a1236c1705 Bug 1414394 Mark write()'s in libfuzzer as Unused to silence a warning r=njn
MozReview-Commit-ID: GbWTgrndfoa
2017-11-03 23:17:27 -05:00
Chris Manchester
104f1c3ef6 Bug 1411712 - Move libfuzzer ldflags filtering to moz.build. r=mshal
MozReview-Commit-ID: 50aeTifZ1gT
2017-11-02 11:47:49 -07:00
Chris Manchester
b915748260 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
ce551e51b9 Bug 870698 - Part 4: Replace Equals("") with EqualsLiteral(""). r=erahm
MozReview-Commit-ID: G1GhyvD29WK
2017-09-06 01:13:45 -07:00
Chris Peterson
b334b66ec7 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
2017-08-15 21:04:55 -07:00
Chris Peterson
0d9cf92beb 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
2017-06-13 00:42:23 -07:00
rforbes
5ebee3ca5d Bug 1365994 - Update libfuzzer r=decoder
MozReview-Commit-ID: GCwIIZd5PTS
***
1365994 - update moz.build for libfuzzer

MozReview-Commit-ID: IxbLnviJC08
2017-05-18 10:23:05 -07:00
Tom Tromey
d54ac8f34d Bug 1362215 - use MOZ_FORMAT_PRINTF in TestHarness.h; r=froydnj
MozReview-Commit-ID: JtNSFoowLIv
2017-05-05 14:23:00 -06:00
Mike Hommey
d7c9f0f24f 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.
2017-01-12 16:02:50 +09:00
Mike Hommey
e521d08008 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.
2017-01-12 14:44:18 +09:00
Mike Hommey
688aecac16 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.
2017-01-12 14:50:14 +09:00
Mike Hommey
e55bae1e11 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().
2017-01-12 11:59:37 +09:00
Benjamin Smedberg
b4f800ee6d Bug 1306329 - Stop exporting XPCOM and XUL symbols. r=glandium 2016-12-02 12:55:34 -05:00
Mike Hommey
4f57f6860b Bug 1330481 - Fix "error: a storage class can only be specified for objects and functions". r=decoder 2017-01-12 11:01:37 +09:00
Wes Kocher
842ef93a40 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
2e8da44529 Bug 1306329 - Stop exporting XPCOM and XUL symbols. r=glandium 2016-12-02 12:55:34 -05:00
Christian Holler (:decoder)
283ca45492 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)
b1e6ed7c5d Bug 1302451 - Import LibFuzzer code. r=froydnj
MozReview-Commit-ID: 3NRSquBHyr2
2016-11-07 15:58:20 +01:00
Tom Tromey
5e4803535d Bug 1067547 - unify ScopedLogging implementations and use in nsEmbedFunctions; r=bsmedberg
MozReview-Commit-ID: 6hDZDaBsNFM
2016-09-26 11:06:38 -06:00
Christian Holler (:decoder)
efaf4d5fa9 Bug 1289194 - Make LibFuzzerRunner use its own private ScopedXPCOM copy. r=ted
MozReview-Commit-ID: Kul2N4GA7O7
2016-08-24 22:35:03 +02:00
Christian Holler (:decoder)
0ee2e05a6f Bug 1289194 - Experimental LibFuzzer integration. r=glandium
MozReview-Commit-ID: 9njDcbltyow
2016-09-01 15:07:01 +02:00
Sebastian Hengst
cda67b5d84 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
7742c85047 Backed out changeset 13a770064f3e (bug 1289194)
MozReview-Commit-ID: ILJkzxfSLdU
2016-09-07 18:44:36 +02:00
Christian Holler (:decoder)
1427b04f68 Bug 1289194 - Make LibFuzzerRunner use its own private ScopedXPCOM copy. r=ted 2016-08-24 22:35:03 +02:00
Christian Holler (:decoder)
09deaa21d9 Bug 1289194 - Experimental LibFuzzer integration. r=glandium 2016-09-01 15:07:01 +02:00