gecko-dev/mfbt
Christian Holler b8ee76ebd8 Bug 1373256 - Changes to support -fsanitize=integer in the codebase. r=froydnj
The -fsanitize=integer analysis from UBSan can be helpful to detect signed and unsigned integer overflows in the codebase. Unfortunately, those occur very frequently, making it impossible to test anything with it without the use of a huge blacklist. This patch includes a blacklist that is broad enough to silence everything that would drain performance too much. But even with this blacklist, neither tests nor fuzzing is "clean". We can however in the future combine this with static analysis to limit ourselves to interesting places to look at, or improve the dynamic analysis to omit typical benign overflows.

It also adds another attribute that can be used on functions. It is not used right now because it was initially easier to add things to the compile-time blacklist to get started.

Finally, it includes a runtime suppression list and patches various parts in the test harnesses to support that. It is currently empty and it should not be used on frequent overflows because it is expensive. However, it has the advantage that it can be used to differentiate between signed and unsigned overflows while the compile-time blacklist cannot do that. So it can be used to e.g. silence unsigned integer overflows on a file or function while still reporting signed issues. We can also use this suppression list for any other UBSan related suppressions, should we ever want to use other features from that sanitizer.

MozReview-Commit-ID: C5ofhfJdpCS

--HG--
extra : rebase_source : 952043a441b41b2f58ec4abc51ac15fa71fc142f
2017-04-09 12:59:26 +02:00
..
decimal Bug 1332797 - Move mfbt/double-conversion source files into a new source/ subdirectory, to segregate upstream files from update.sh and our local patches. r=froydnj 2017-01-23 15:11:50 -08:00
double-conversion Bug 1332797 - Delete the temporary directory used to store the double-conversion clone when all's said and done. r=froydnj 2017-01-26 13:26:40 -08:00
staticruntime Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
tests Bug 1373525 - mfbt: Use unused GetPrev() member function in DoublyLinkedList test. r=froydnj 2017-06-11 14:39:42 -07:00
Alignment.h Bug 1341951 - Remove mozilla::AlignedStorage, and inline its sole use into js::jit::RInstructionStorage. r=nbp 2017-02-22 18:27:51 -08:00
AllocPolicy.h Bug 1262671 - Introduce MFBT BufferList class (r=froydnj) 2016-05-27 09:57:40 -07:00
AlreadyAddRefed.h Bug 1162335 - Remove already_AddRefed::MatchNullptr. r=froydnj 2017-06-01 15:01:40 +10:00
Array.h Bug 1319626 - Part 2: Add BorderLayer class and basic support for them. r=mstange 2016-11-24 18:11:30 +13:00
ArrayUtils.h Bug 1277775 - Replace MOZ_CONSTEXPR{_VAR,_TMPL} with constexpr. r=froydnj 2016-07-08 14:39:53 -07:00
Assertions.cpp Bug 1338574 - Assertions.cpp can't use MOZ_CRASH_ANNOTATE, so set the crash reason directly. r=froydnj 2017-02-22 15:42:00 -05:00
Assertions.h Bug 1369622 - Add a static_assert when no variadic argument is given to MOZ_CRASH_UNSAFE_PRINTF. r=froydnj 2017-06-02 15:11:47 +09:00
Atomics.h Bug 1363426 - part 3 - minor cleanups to Atomics.h; r=erahm 2017-05-10 09:58:28 -04:00
Attributes.h Bug 1373256 - Changes to support -fsanitize=integer in the codebase. r=froydnj 2017-04-09 12:59:26 +02:00
BinarySearch.h Bug 1247835 (part 0) - Minor comment and style tweaks in BinarySearch.h. r=luke. 2016-02-23 15:41:39 +11:00
BloomFilter.h
BufferList.h Bug 1373579: Part 3 - Require fallible Init method rather than infallible constructor when using fallible allocator. r=billm 2017-06-20 12:06:13 -07:00
Casting.h Bug 1295611 - Add mozilla::Span. r=froydnj,gerv. 2017-03-31 13:32:18 +03:00
ChaosMode.cpp
ChaosMode.h Bug 1260247. In chaos mode randomly decide to start a new image load even if the image is in the image cache when allowed by spec. r=seth 2016-04-02 13:53:12 -05:00
Char16.h Bug 1353593 - Part 1: Allow implicit conversion of non-const char16ptr_t to wchar*. r=froydnj 2017-06-12 16:20:47 -07:00
CheckedInt.h Bug 1350790 - Add constexpr to CheckedInt. r=froydnj 2017-03-27 10:59:31 +08:00
Compiler.h Bug 1322792 - require GCC 4.9 to build; r=glandium 2016-12-23 05:47:31 -05:00
Compression.cpp Bug 1345331: Include <intrin.h> at top-level before lz4.c can include it in a namespace. r=Waldo 2017-03-09 15:11:15 +13:00
Compression.h Bug 1268754 - Tweak some MFBT return values. r=Ms2ger. 2016-04-29 13:14:34 +10:00
DebugOnly.h Bug 1253094, part 11 - Make DebugOnly a MOZ_STACK_CLASS. r=Waldo 2016-02-26 15:52:08 +00:00
DoublyLinkedList.h Bug 935809 - Part 0: Include assertion header in DoublyLinkedList.h. r=waldo 2017-05-03 19:22:39 -07:00
EndianUtils.h Bug 1275016 - Rename Endian.h to EndianUtils.h to avoid #include confusion with Android's endian.h stdlib header. r=froydnj 2016-05-22 13:31:11 -07:00
EnumSet.h Bug 1311068 - remove InitializerList.h; r=botond 2016-10-19 00:33:14 -04:00
EnumTypeTraits.h Bug 1297306 - part4:rename IsEnumFittingWithin with EnumTypeFitsWithin and move it to mfbt/EnumTypeTraits.h. r=froydnj 2016-09-07 10:20:16 +08:00
EnumeratedArray.h Initial import of Advanced Layers. (bug 1365879 part 20, r=bas) 2017-06-23 14:23:12 -07:00
EnumeratedRange.h Bug 1290035 - Remove the explicit Type parameter to MakeEnumeratedRange. r=Waldo 2016-07-28 17:48:50 +08:00
FastBernoulliTrial.h Bug 1231378 - part 3 - Fix uninitialized members of classes in modules/libjar and mfbt, r=smaug 2016-01-12 18:16:59 +00:00
FloatingPoint.cpp
FloatingPoint.h Bug 1311088 - Part 1: Add mozilla::SpecificNaNBits and JS::detail::CanonicalizedNaNBits. r=jwalden 2016-10-29 01:47:30 +09:00
GuardObjects.h
HashFunctions.cpp
HashFunctions.h Bug 1312001 - Scramble hash codes securely, to avoid leaking bits of object and symbol addresses. 2016-11-30 15:31:56 -06:00
IndexSequence.h Bug 1287006 - Adjust media/ code to not pass Maybe (or any class containing a Maybe member) by value, only by reference or pointer. r=jw_wang, r=rjesup 2017-02-13 09:07:40 -08:00
IntegerPrintfMacros.h Bug 1357873 - Fix up 64-bit Android macros in IntegerPrintfMacros.h; r=Waldo 2017-05-01 14:46:00 -04:00
IntegerRange.h Bug 1315274 - rename mozilla::MakeRange to mozilla::IntegerRange; r=Waldo 2017-01-06 09:22:53 -05:00
IntegerTypeTraits.h
JSONWriter.cpp
JSONWriter.h Bug 1293384 - Part 1: Rename snprintf_literal to SprintfLiteral. r=froydnj 2016-08-14 23:44:00 -07:00
Likely.h
LinkedList.h Bug 1359653: Part 3 - Add a clear() method and move asssignment operator to AutoCleanLinkedList. r=waldo 2017-05-02 17:54:18 -07:00
LinuxSignal.h Bug 1238661 - fix mozilla::SignalTrampoline to work properly with clang; r=darchons 2016-07-25 18:16:06 -04:00
MacroArgs.h Bug 1369622 - Fix MOZ_FOR_EACH with an empty list. r=froydnj 2017-06-02 14:53:54 +09:00
MacroForEach.h Bug 1368932 - Allow MOZ_PASTE_PREFIX_AND_ARG_COUNT to work with 0 arguments. r=froydnj 2017-05-25 15:47:21 +09:00
MathAlgorithms.h Bug 1299284 - Remove js::IsPowerOfTwo in favor of mozilla::IsPowerOfTwo. r=sfink 2016-07-21 00:36:38 -07:00
Maybe.h Bug 1356063 - Make Maybe<T> inherit static analysis annotations from T, r=mystor 2017-04-13 11:35:01 -07:00
MaybeOneOf.h Bug 1339555 - Make various operator-news into a known-non-null pointer use a ::operator new overload that odesn't null-check. r=froydnj 2017-02-14 11:23:18 -08:00
MemoryChecking.h
MemoryReporting.h
Move.h
NotNull.h Bug 1374629 - Ensure that mozilla::NotNull has zero space overhead. r=njn 2017-06-22 00:52:28 +09:00
NullPtr.h
Opaque.h Bug 1246061. r=jandem, r=bz, r=luke, r=froydnj 2016-03-09 00:37:20 -08:00
OperatorNewExtensions.h Bug 1294537 - Don't tag |void* p| in the don't-nullcheck placement operator new overload as MOZ_NONNULL, because that makes a double-checking assertion of non-nullness into a compiler warning. r=froydnj 2016-08-12 18:02:03 -07:00
Pair.h
PodOperations.h
Poison.cpp Bug 1158445 - posix_madvise() should be used instead of madvise on Solaris. r=froydnj, r=jandem 2017-06-09 00:59:32 -07:00
Poison.h Bug 1268246 - Add a simple Poison class lifetime checker. r=froydnj 2016-04-29 13:54:54 -04:00
Range.h Bug 1295611 - Add mozilla::Span. r=froydnj,gerv. 2017-03-31 13:32:18 +03:00
RangedArray.h
RangedPtr.h Bug 1319740 - Parametrize ComputeSingleDisplayName based on the character type of the key string, and iterate through the string using iterators, not using null-termination. r=arai 2016-12-02 14:02:36 -08:00
ReentrancyGuard.h
RefCountType.h
RefCounted.h Bug 1313351 - Fix js::RefCounted to not do leak checking. r=jandem 2016-12-23 21:13:26 +01:00
RefPtr.h Bug 1354642 - Add MakeRefPtr<> helper class. r=Ehsan 2017-04-07 15:08:42 -04:00
Result.h Bug 1325073 - Rename mozilla::MakeGenericErrorResult to mozilla::Err. r=Waldo 2017-03-08 13:33:07 +00:00
ReverseIterator.h
RollingMean.h
SHA1.cpp Bug 1275016 - Rename Endian.h to EndianUtils.h to avoid #include confusion with Android's endian.h stdlib header. r=froydnj 2016-05-22 13:31:11 -07:00
SHA1.h
STYLE Bug 1332797 - Move mfbt/double-conversion source files into a new source/ subdirectory, to segregate upstream files from update.sh and our local patches. r=froydnj 2017-01-23 15:11:50 -08:00
Saturate.h Bug 1288603 - Remove NumericLimits.h because all platforms have numeric_limits<char16_t>. r=froydnj 2016-07-22 22:05:45 -07:00
ScopeExit.h
Scoped.h Bug 1252902 - remove ScopedFreePtr; r=Waldo 2016-03-02 11:44:27 -05:00
SegmentedVector.h Bug 1358761 - replace PurpleBlock with SegmentedVector to reduce indirect memory accesses when calling suspect, r=mccr8,nfroyd 2017-05-05 00:49:22 +03:00
SizePrintfMacros.h Bug 1368406 Use non-Windows Printf Format Specifiers in MinGW r=froydnj 2017-05-29 00:38:57 -05:00
SmallPointerArray.h Bug 1331718 - Part 1: Add small pointer array. r=froydnj 2017-05-10 05:07:37 +02:00
Span.h Bug 1359874 - Make Span::Elements() always return a non-null pointer. r=froydnj. 2017-06-13 13:22:34 +03:00
SplayTree.h Bug 1277775 - Replace MOZ_CONSTEXPR{_VAR,_TMPL} with constexpr. r=froydnj 2016-07-08 14:39:53 -07:00
Sprintf.h Bug 1334279 - mark vsprintf-likes with MOZ_FORMAT_PRINTF; r=froydnj 2017-05-04 12:10:19 -06:00
StaticAnalysisFunctions.h Bug 1283395 - add markup functions for static analysis builds. r=froydnj 2016-07-25 16:57:30 +03:00
TaggedAnonymousMemory.cpp
TaggedAnonymousMemory.h
TemplateLib.h Bug 1338374 - Make tl::Min/Max variadic. r=froydnj 2017-01-30 15:56:05 -08:00
ThreadLocal.h merge mozilla-inbound to mozilla-central a=merge 2017-04-26 08:41:31 +02:00
ToString.h
Tuple.h Bug 1232418 - Allow mozilla::Tuple to support equality comparison; r=Waldo 2015-12-14 12:01:17 -08:00
TypeTraits.h Bug 1318677 part 3 - mozilla::Result: Add a new packing strategy to pack small enumerated values in a single word. r=Waldo 2017-02-07 18:57:43 +00:00
TypedEnumBits.h Bug 1315624 - Delete operator&& and operator|| for CastableTypedEnumResult. r=froydnj 2016-11-07 15:00:16 +08:00
Types.h Bug 1251769 - Remove remaining references to MOZILLA_XPCOMRT_API from mfbt. r=froydnj 2016-02-27 11:12:07 -08:00
UniquePtr.h Bug 1277775 - Replace MOZ_CONSTEXPR{_VAR,_TMPL} with constexpr. r=froydnj 2016-07-08 14:39:53 -07:00
UniquePtrExtensions.h Bug 1252195 - part 1 - implement UniqueFreePtr; r=Waldo 2016-02-29 10:29:13 -05:00
Unused.cpp Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj 2016-08-24 14:47:04 +08:00
Unused.h Bug 1368616 - Error compiling TestBlockingProcess.exe with MinGW: undefined reference to _imp___ZN7mozilla6UnusedE r=froydnj 2017-06-21 11:47:11 +02:00
Variant.h Bug 1365802 - In VariantImplementation::moveConstruct, move the aRhs rvalue to the next moveConstruct - r=froydnj 2017-05-18 15:39:40 +12:00
Vector.h Bug 1352073: Fix off-by-one in Vector::insert; r=luke 2017-03-30 16:20:30 +02:00
WeakPtr.h Backed out 12 changesets (bug 1356103) for build bustage at PostTraversalTask.h 2017-05-04 17:56:25 +08:00
WindowsVersion.h Bug 1368150: Add IsWindows10BuildOrNewer to MFBT; r=froydnj 2017-06-06 11:14:58 -06:00
XorShift128PlusRNG.h Bug 1277775 - Replace MOZ_CONSTEXPR{_VAR,_TMPL} with constexpr. r=froydnj 2016-07-08 14:39:53 -07:00
lz4.c
lz4.h
moz.build Bug 1331718 - Part 1: Add small pointer array. r=froydnj 2017-05-10 05:07:37 +02:00
objs.mozbuild Bug 1332797 - Move mfbt/double-conversion source files into a new source/ subdirectory, to segregate upstream files from update.sh and our local patches. r=froydnj 2017-01-23 15:11:50 -08:00