LLVM  5.0.0
Classes | Typedefs | Functions | Variables
fuzzer Namespace Reference

Classes

struct  InputInfo
 
class  InputCorpus
 
struct  ScopedDoingMyOwnMemOrStr
 
class  FixedWord
 
class  DictionaryEntry
 
class  Dictionary
 
struct  FlagDescription
 
struct  ExternalFunctions
 
class  Fuzzer
 
struct  MallocFreeTracer
 
struct  MergeFileInfo
 
struct  Merger
 
class  MutationDispatcher
 
struct  FuzzingOptions
 
class  Random
 
class  SharedMemoryRegion
 
struct  TableOfRecentCompares
 
struct  MemMemTable
 
class  TracePC
 
struct  ValueBitMap
 

Typedefs

typedef std::vector< uint8_t > Unit
 
typedef std::vector< Unit > UnitVector
 
typedef int(* UserCallback )(const uint8_t *Data, size_t Size)
 
typedef FixedWord< 64 > Word
 

Functions

template<class T >
T Min (T a, T b)
 
template<class T >
T Max (T a, T b)
 
int FuzzerDriver (int *argc, char ***argv, UserCallback Callback)
 
uint8_t Bswap (uint8_t x)
 
uint16_t Bswap (uint16_t x)
 
uint32_t Bswap (uint32_t x)
 
uint64_t Bswap (uint64_t x)
 
uint8_t * ExtraCountersBegin ()
 
uint8_t * ExtraCountersEnd ()
 
void ClearExtraCounters ()
 
bool ParseOneDictionaryEntry (const std::string &Str, Unit *U)
 
bool ParseDictionaryFile (const std::string &Text, std::vector< Unit > *Units)
 
 FUZZER_FLAG_INT (runs,-1,"Number of individual test runs (-1 for infinite runs).") FUZZER_FLAG_INT(max_len
 
Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it 
FUZZER_FLAG_INT (mutate_depth, 5,"Apply this number of consecutive mutations to each input.") FUZZER_FLAG_INT(prefer_small
 
Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle 
FUZZER_FLAG_INT (timeout, 1200,"Timeout in seconds (if positive). ""If one unit runs more than this number of seconds the process will abort.") FUZZER_FLAG_INT(error_exitcode
 
Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used 
FUZZER_FLAG_INT (timeout_exitcode, 77,"When libFuzzer reports a timeout ""this exit code will be used.") FUZZER_FLAG_INT(max_total_time
 
Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer 
FUZZER_FLAG_INT (merge, 0,"If 1, the 2-nd, 3-rd, etc corpora will be ""merged into the 1-st corpus. Only interesting units will be taken. ""This flag can be used to minimize a corpus.") FUZZER_FLAG_STRING(save_coverage_summary
 
Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with tries to
cleanse the provided crash
input to make it contain fewer
original bytes Use with
exact_artifact_path to specify
the output 
FUZZER_FLAG_INT (use_memmem, 1,"Use hints from intercepting memmem, strstr, etc") FUZZER_FLAG_INT(use_value_profile
 
Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with tries to
cleanse the provided crash
input to make it contain fewer
original bytes Use with
exact_artifact_path to specify
the output Experimental Use
value profile to guide fuzzing 
FUZZER_FLAG_INT (reduce_inputs, 0,"Experimental. ""Try to reduce the size of inputs wile preserving their full feature sets") FUZZER_FLAG_UNSIGNED(jobs
 
Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with tries to
cleanse the provided crash
input to make it contain fewer
original bytes Use with
exact_artifact_path to specify
the output Experimental Use
value profile to guide fuzzing
Number of jobs to run If 
min (jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
 
Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with tries to
cleanse the provided crash
input to make it contain fewer
original bytes Use with
exact_artifact_path to specify
the output Experimental Use
value profile to guide fuzzing
Number of jobs to run If
Reload the main corpus every
< N > seconds to get new units
discovered by other processes
disabled 
FUZZER_FLAG_INT (report_slow_units, 10,"Report slowest units if they run for more than this number of seconds.") FUZZER_FLAG_INT(only_ascii
 
Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with tries to
cleanse the provided crash
input to make it contain fewer
original bytes Use with
exact_artifact_path to specify
the output Experimental Use
value profile to guide fuzzing
Number of jobs to run If
Reload the main corpus every
< N > seconds to get new units
discovered by other processes
disabled generate only 
ASCII (isprint+isspace) inputs.") FUZZER_FLAG_STRING(artifact_prefix
 
Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with tries to
cleanse the provided crash
input to make it contain fewer
original bytes Use with
exact_artifact_path to specify
the output Experimental Use
value profile to guide fuzzing
Number of jobs to run If
Reload the main corpus every
< N > seconds to get new units
discovered by other processes
disabled generate only Write
fuzzing 
artifacts (crash," "timeout, or slow inputs) as" "$(artifact_prefix) file") FUZZER_FLAG_STRING(exact_artifact_path
 
Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with tries to
cleanse the provided crash
input to make it contain fewer
original bytes Use with
exact_artifact_path to specify
the output Experimental Use
value profile to guide fuzzing
Number of jobs to run If
Reload the main corpus every
< N > seconds to get new units
discovered by other processes
disabled generate only Write
fuzzing Write the single
artifact on 
failure (crash, timeout)" "as $(exact_artifact_path).This override s-artifact_prefix" "and will not use checksum in the file name.Do not" "use the same path for several parallel processes.") FUZZER_FLAG_INT(print_corpus_stats
 
Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with tries to
cleanse the provided crash
input to make it contain fewer
original bytes Use with
exact_artifact_path to specify
the output Experimental Use
value profile to guide fuzzing
Number of jobs to run If
Reload the main corpus every
< N > seconds to get new units
discovered by other processes
disabled generate only Write
fuzzing Write the single
artifact on print statistics
on corpus elements at exit 
FUZZER_FLAG_INT (print_coverage, 0,"If 1, print coverage information as text"" at exit.") FUZZER_FLAG_INT(dump_coverage
 
Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with tries to
cleanse the provided crash
input to make it contain fewer
original bytes Use with
exact_artifact_path to specify
the output Experimental Use
value profile to guide fuzzing
Number of jobs to run If
Reload the main corpus every
< N > seconds to get new units
discovered by other processes
disabled generate only Write
fuzzing Write the single
artifact on print statistics
on corpus elements at exit
dump coverage information as a
sancov file at exit 
FUZZER_FLAG_INT (close_fd_mask, 0,"If 1, close stdout at startup; ""if 2, close stderr; if 3, close both. ""Be careful, this will also close e.g. asan's stderr/stdout.") FUZZER_FLAG_INT(detect_leaks
 
Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with tries to
cleanse the provided crash
input to make it contain fewer
original bytes Use with
exact_artifact_path to specify
the output Experimental Use
value profile to guide fuzzing
Number of jobs to run If
Reload the main corpus every
< N > seconds to get new units
discovered by other processes
disabled generate only Write
fuzzing Write the single
artifact on print statistics
on corpus elements at exit
dump coverage information as a
sancov file at exit and if
LeakSanitizer is enabled try
to detect memory leaks during 
fuzzing (i.e.not only at shut down).") FUZZER_FLAG_INT(trace_malloc
 
 PrintASCII (Dict[i].data(), Dict[i].size(),"\"")
 
 Printf (" # Score: %d, Used: %d\n", Scores[i], Usages[i])
 
 Printf ("###### End of useless dictionary elements. ######\n")
 
long GetEpoch (const std::string &Path)
 
Unit FileToVector (const std::string &Path, size_t MaxSize, bool ExitOnError)
 
std::string FileToString (const std::string &Path)
 
void CopyFileToErr (const std::string &Path)
 
void WriteToFile (const Unit &U, const std::string &Path)
 
void ReadDirToVectorOfUnits (const char *Path, std::vector< Unit > *V, long *Epoch, size_t MaxSize, bool ExitOnError)
 
std::string DirPlusFile (const std::string &DirPath, const std::string &FileName)
 
void DupAndCloseStderr ()
 
void CloseStdout ()
 
void Printf (const char *Fmt,...)
 
std::string DirName (const std::string &FileName)
 
std::string TmpDir ()
 
bool IsInterestingCoverageFile (const std::string &FileName)
 
void RawPrint (const char *Str)
 
bool IsFile (const std::string &Path)
 
void ListFilesInDirRecursive (const std::string &Dir, long *Epoch, std::vector< std::string > *V, bool TopDir)
 
char GetSeparator ()
 
FILE * OpenFile (int Fd, const char *Mode)
 
int CloseFile (int Fd)
 
int DuplicateFile (int Fd)
 
void RemoveFile (const std::string &Path)
 
void DiscardOutput (int Fd)
 
intptr_t GetHandleFromFd (int fd)
 
ATTRIBUTE_NO_SANITIZE_MEMORY void MallocHook (const volatile void *ptr, size_t size)
 
ATTRIBUTE_NO_SANITIZE_MEMORY void FreeHook (const volatile void *ptr)
 
static bool LooseMemeq (const uint8_t *A, const uint8_t *B, size_t Size)
 
static size_t ComputeMutationLen (size_t MaxInputSize, size_t MaxMutationLen, Random &Rand)
 
static void PrintASCII (const Word &W, const char *PrintAfter)
 
static char RandCh (Random &Rand)
 
template<class T >
size_t ChangeBinaryInteger (uint8_t *Data, size_t Size, Random &Rand)
 
void ComputeSHA1 (const uint8_t *Data, size_t Len, uint8_t *Out)
 
std::string Sha1ToString (const uint8_t Sha1[kSHA1NumBytes])
 
std::string Hash (const Unit &U)
 
ALWAYS_INLINE uintptr_t GetPreviousInstructionPc (uintptr_t PC)
 
static size_t InternalStrnlen (const char *S, size_t MaxLen)
 
static size_t InternalStrnlen2 (const char *S1, const char *S2)
 
template<class Callback >
ATTRIBUTE_NO_SANITIZE_ALL void ForEachNonZeroByte (const uint8_t *Begin, const uint8_t *End, size_t FirstFeature, Callback Handle8bitCounter)
 
 ForEachNonZeroByte (Counters, Counters+N, FirstFeature, Handle8bitCounter)
 
 for (size_t i=0;i< NumModulesWithInline8bitCounters;i++)
 
 ForEachNonZeroByte (ExtraCountersBegin(), ExtraCountersEnd(), FirstFeature, Handle8bitCounter)
 
 if (UseValueProfile) ValueProfileMap.ForEach([&](size_t Idx)
 
void PrintHexArray (const uint8_t *Data, size_t Size, const char *PrintAfter)
 
void Print (const Unit &v, const char *PrintAfter)
 
void PrintASCIIByte (uint8_t Byte)
 
void PrintASCII (const uint8_t *Data, size_t Size, const char *PrintAfter)
 
void PrintASCII (const Unit &U, const char *PrintAfter)
 
bool ToASCII (uint8_t *Data, size_t Size)
 
bool IsASCII (const Unit &U)
 
bool IsASCII (const uint8_t *Data, size_t Size)
 
std::string Base64 (const Unit &U)
 
std::string DescribePC (const char *SymbolizedFMT, uintptr_t PC)
 
void PrintPC (const char *SymbolizedFMT, const char *FallbackFMT, uintptr_t PC)
 
unsigned NumberOfCpuCores ()
 
bool ExecuteCommandAndReadOutput (const std::string &Command, std::string *Out)
 
size_t SimpleFastHash (const uint8_t *Data, size_t Size)
 
void PrintHexArray (const Unit &U, const char *PrintAfter="")
 
void SetSignalHandler (const FuzzingOptions &Options)
 
void SleepSeconds (int Seconds)
 
unsigned long GetPid ()
 
size_t GetPeakRSSMb ()
 
int ExecuteCommand (const std::string &Command)
 
FILE * OpenProcessPipe (const char *Command, const char *Mode)
 
const void * SearchMemory (const void *haystack, size_t haystacklen, const void *needle, size_t needlelen)
 
std::string CloneArgsWithoutX (const std::vector< std::string > &Args, const char *X1, const char *X2)
 
std::string CloneArgsWithoutX (const std::vector< std::string > &Args, const char *X)
 
std::pair< std::string,
std::string > 
SplitBefore (std::string X, std::string S)
 
std::string DisassembleCmd (const std::string &FileName)
 
std::string SearchRegexCmd (const std::string &Regex)
 

Variables

ExternalFunctions * EF = nullptr
 
struct {
   Maximum length of the test input   fuzzer::If
 
   Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it   fuzzer::If
 
   Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If   fuzzer::positive
 
   Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer   fuzzer::Experimental:" " save coverage summary to a given file." " Used with -merge=1")FUZZER_FLAG_STRING(load_coverage_summary
 
   Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer   fuzzer::If
 
   Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with   fuzzer::runs
 
   Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with tries to
cleanse the provided crash
input to make it contain fewer
original bytes Use with
exact_artifact_path to specify
the output Experimental Use
value profile to guide fuzzing
Number of jobs to run If   fuzzer::jobs
 
   Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with tries to
cleanse the provided crash
input to make it contain fewer
original bytes Use with
exact_artifact_path to specify
the output Experimental Use
value profile to guide fuzzing
Number of jobs to run If
Reload the main corpus every
< N > seconds to get new units
discovered by other processes   fuzzer::If
 
   Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with tries to
cleanse the provided crash
input to make it contain fewer
original bytes Use with
exact_artifact_path to specify
the output Experimental Use
value profile to guide fuzzing
Number of jobs to run If
Reload the main corpus every
< N > seconds to get new units
discovered by other processes
disabled   fuzzer::If
 
   Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with tries to
cleanse the provided crash
input to make it contain fewer
original bytes Use with
exact_artifact_path to specify
the output Experimental Use
value profile to guide fuzzing
Number of jobs to run If
Reload the main corpus every
< N > seconds to get new units
discovered by other processes
disabled generate only Write
fuzzing Write the single
artifact on   fuzzer::If
 
   Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with tries to
cleanse the provided crash
input to make it contain fewer
original bytes Use with
exact_artifact_path to specify
the output Experimental Use
value profile to guide fuzzing
Number of jobs to run If
Reload the main corpus every
< N > seconds to get new units
discovered by other processes
disabled generate only Write
fuzzing Write the single
artifact on print statistics
on corpus elements at exit   fuzzer::If
 
   Maximum length of the test
input libFuzzer tries to guess
a good value based on the
corpus and reports it always
prefer smaller inputs during
the corpus shuffle When
libFuzzer itself reports a bug
this exit code will be used If
indicates the maximal total
time in seconds to run the
fuzzer minimizes the provided
crash input Use with tries to
cleanse the provided crash
input to make it contain fewer
original bytes Use with
exact_artifact_path to specify
the output Experimental Use
value profile to guide fuzzing
Number of jobs to run If
Reload the main corpus every
< N > seconds to get new units
discovered by other processes
disabled generate only Write
fuzzing Write the single
artifact on print statistics
on corpus elements at exit
dump coverage information as a
sancov file at exit   fuzzer::If
 
} Flags
 
use help
 
 return
 
static FILE * OutputFile = stderr
 
static const size_t kMaxUnitSizeToPrint = 256
 
SharedMemoryRegion SMR
 
static Fuzzer * F
 
static MallocFreeTracer AllocTracer
 
static const int kSHA1NumBytes = 20
 
TracePC TPC
 
template<class Callback >
ATTRIBUTE_NO_SANITIZE_ALL
__attribute__((noinline)) void
TracePC size_t 
N = GetNumPCs()
 
auto Handle8bitCounter
 
size_t FirstFeature = 0
 

Typedef Documentation

typedef std::vector<uint8_t> fuzzer::Unit

Definition at line 105 of file FuzzerDefs.h.

typedef std::vector<Unit> fuzzer::UnitVector

Definition at line 106 of file FuzzerDefs.h.

typedef int(* fuzzer::UserCallback)(const uint8_t *Data, size_t Size)

Definition at line 107 of file FuzzerDefs.h.

typedef FixedWord<64> fuzzer::Word

Definition at line 56 of file FuzzerDictionary.h.

Function Documentation

Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If Reload the main corpus every< N > seconds to get new units discovered by other processes disabled generate only Write fuzzing fuzzer::@301::artifacts ( crash  ,
" "  timeout,
or slow  inputs 
)
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If Reload the main corpus every<N> seconds to get new units discovered by other processes disabled generate only fuzzer::ASCII ( isprint+  isspace)
std::string fuzzer::Base64 ( const Unit &  U)

Definition at line 154 of file FuzzerUtil.cpp.

Referenced by TEST().

uint8_t fuzzer::Bswap ( uint8_t  x)
inline

Definition at line 117 of file FuzzerDefs.h.

Referenced by ChangeBinaryInteger().

uint16_t fuzzer::Bswap ( uint16_t  x)
inline

Definition at line 118 of file FuzzerDefs.h.

uint32_t fuzzer::Bswap ( uint32_t  x)
inline

Definition at line 119 of file FuzzerDefs.h.

uint64_t fuzzer::Bswap ( uint64_t  x)
inline

Definition at line 120 of file FuzzerDefs.h.

template<class T >
size_t fuzzer::ChangeBinaryInteger ( uint8_t *  Data,
size_t  Size,
Random &  Rand 
)
void fuzzer::ClearExtraCounters ( )

Definition at line 38 of file FuzzerExtraCounters.cpp.

Referenced by fuzzer::TracePC::ResetMaps().

std::string fuzzer::CloneArgsWithoutX ( const std::vector< std::string > &  Args,
const char *  X1,
const char *  X2 
)
std::string fuzzer::CloneArgsWithoutX ( const std::vector< std::string > &  Args,
const char *  X 
)
inline

Definition at line 65 of file FuzzerUtil.h.

References CloneArgsWithoutX().

int fuzzer::CloseFile ( int  Fd)
void fuzzer::CloseStdout ( )

Definition at line 106 of file FuzzerIO.cpp.

References DiscardOutput().

static size_t fuzzer::ComputeMutationLen ( size_t  MaxInputSize,
size_t  MaxMutationLen,
Random &  Rand 
)
static

Definition at line 570 of file FuzzerLoop.cpp.

References assert(), Min(), and fuzzer::Random::Rand().

void fuzzer::ComputeSHA1 ( const uint8_t *  Data,
size_t  Len,
uint8_t *  Out 
)

Definition at line 202 of file FuzzerSHA1.cpp.

References HASH_LENGTH.

Referenced by fuzzer::InputCorpus::AddToCorpus(), Hash(), and fuzzer::InputCorpus::Replace().

void fuzzer::CopyFileToErr ( const std::string &  Path)

Definition at line 57 of file FuzzerIO.cpp.

References llvm::c_str(), FileToString(), and Printf().

std::string fuzzer::DescribePC ( const char *  SymbolizedFMT,
uintptr_t  PC 
)

Definition at line 182 of file FuzzerUtil.cpp.

References EF.

Referenced by fuzzer::TracePC::PrintCoverage(), and PrintPC().

std::string fuzzer::DirName ( const std::string &  FileName)
std::string fuzzer::DirPlusFile ( const std::string &  DirPath,
const std::string &  FileName 
)

Definition at line 87 of file FuzzerIO.cpp.

References GetSeparator().

Referenced by fuzzer::Fuzzer::CrashResistantMerge(), and fuzzer::InputCorpus::DeleteFile().

std::string fuzzer::DisassembleCmd ( const std::string &  FileName)
void fuzzer::DiscardOutput ( int  Fd)

Referenced by CloseStdout(), and DupAndCloseStderr().

void fuzzer::DupAndCloseStderr ( )

Definition at line 92 of file FuzzerIO.cpp.

References DiscardOutput(), DuplicateFile(), EF, GetHandleFromFd(), OpenFile(), and OutputFile.

int fuzzer::DuplicateFile ( int  Fd)

Referenced by DupAndCloseStderr().

int fuzzer::ExecuteCommand ( const std::string &  Command)
bool fuzzer::ExecuteCommandAndReadOutput ( const std::string &  Command,
std::string *  Out 
)

Definition at line 208 of file FuzzerUtil.cpp.

References N, and OpenProcessPipe().

Referenced by fuzzer::TracePC::PrintCoverage().

uint8_t * fuzzer::ExtraCountersBegin ( )

Definition at line 36 of file FuzzerExtraCounters.cpp.

uint8_t * fuzzer::ExtraCountersEnd ( )

Definition at line 37 of file FuzzerExtraCounters.cpp.

Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If Reload the main corpus every< N > seconds to get new units discovered by other processes disabled generate only Write fuzzing Write the single artifact on fuzzer::@301::failure ( crash  ,
timeout   
)
override
std::string fuzzer::FileToString ( const std::string &  Path)

Definition at line 51 of file FuzzerIO.cpp.

References T.

Referenced by CopyFileToErr().

Unit fuzzer::FileToVector ( const std::string &  Path,
size_t  MaxSize,
bool  ExitOnError 
)
fuzzer::for ( )

Definition at line 191 of file FuzzerTracePC.h.

References ForEachNonZeroByte(), and Handle8bitCounter.

template<class Callback >
ATTRIBUTE_NO_SANITIZE_ALL void fuzzer::ForEachNonZeroByte ( const uint8_t *  Begin,
const uint8_t *  End,
size_t  FirstFeature,
Callback  Handle8bitCounter 
)

Definition at line 145 of file FuzzerTracePC.h.

References llvm::WebAssembly::End, Handle8bitCounter, I, and P.

Referenced by for(), and TEST().

fuzzer::ForEachNonZeroByte ( Counters  ,
Counters+  N,
FirstFeature  ,
Handle8bitCounter   
)
fuzzer::ForEachNonZeroByte ( ExtraCountersBegin()  ,
ExtraCountersEnd()  ,
FirstFeature  ,
Handle8bitCounter   
)
ATTRIBUTE_NO_SANITIZE_MEMORY void fuzzer::FreeHook ( const volatile void *  ptr)
fuzzer::@301::FUZZER_FLAG_INT ( runs  ,
-  1,
"Number of individual test runs (-1 for infinite runs)."   
)
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it fuzzer::@301::FUZZER_FLAG_INT ( mutate_depth  ,
5  ,
"Apply this number of consecutive mutations to each input."   
)
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle fuzzer::@301::FUZZER_FLAG_INT ( timeout  ,
1200  ,
"Timeout in seconds (if positive). ""If one unit runs more than this number of seconds the process will abort."   
)
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used fuzzer::@301::FUZZER_FLAG_INT ( timeout_exitcode  ,
77  ,
"When libFuzzer reports a timeout ""this exit code will be used."   
)
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer fuzzer::@301::FUZZER_FLAG_INT ( merge  ,
0  ,
"If  1,
the 2-  nd,
3-  rd,
etc corpora will be" "merged into the 1-st corpus.Only interesting units will be taken." "This flag can be used to minimize a corpus."   
)
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output fuzzer::@301::FUZZER_FLAG_INT ( use_memmem  ,
1  ,
"Use hints from intercepting  memmem,
strstr  ,
etc"   
)
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing fuzzer::@301::FUZZER_FLAG_INT ( reduce_inputs  ,
0  ,
"Experimental. ""Try to reduce the size of inputs wile preserving their full feature sets"   
)
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If Reload the main corpus every< N > seconds to get new units discovered by other processes disabled fuzzer::@301::FUZZER_FLAG_INT ( report_slow_units  ,
10  ,
"Report slowest units if they run for more than this number of seconds."   
)
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If Reload the main corpus every< N > seconds to get new units discovered by other processes disabled generate only Write fuzzing Write the single artifact on print statistics on corpus elements at exit fuzzer::@301::FUZZER_FLAG_INT ( print_coverage  ,
0  ,
"If  1,
print coverage information as text" "at exit."   
)
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If Reload the main corpus every< N > seconds to get new units discovered by other processes disabled generate only Write fuzzing Write the single artifact on print statistics on corpus elements at exit dump coverage information as a sancov file at exit fuzzer::@301::FUZZER_FLAG_INT ( close_fd_mask  ,
0  ,
"If  1,
close stdout at startup;" "if  2,
close stderr;if  3,
close both." "Be  careful,
this will also close e.g.asan's stderr/stdout."   
)
int fuzzer::FuzzerDriver ( int *  argc,
char ***  argv,
UserCallback  Callback 
)

Definition at line 601 of file FuzzerDriver.cpp.

Referenced by main().

Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If Reload the main corpus every< N > seconds to get new units discovered by other processes disabled generate only Write fuzzing Write the single artifact on print statistics on corpus elements at exit dump coverage information as a sancov file at exit and if LeakSanitizer is enabled try to detect memory leaks during fuzzer::@301::fuzzing ( i.e.not only at shut  down)
long fuzzer::GetEpoch ( const std::string &  Path)

Definition at line 26 of file FuzzerIO.cpp.

Referenced by fuzzer::Fuzzer::Fuzzer(), and ReadDirToVectorOfUnits().

intptr_t fuzzer::GetHandleFromFd ( int  fd)

Referenced by DupAndCloseStderr().

size_t fuzzer::GetPeakRSSMb ( )
unsigned long fuzzer::GetPid ( )
ALWAYS_INLINE uintptr_t fuzzer::GetPreviousInstructionPc ( uintptr_t  PC)
inline

Definition at line 231 of file FuzzerTracePC.cpp.

Referenced by fuzzer::TracePC::DumpCoverage().

char fuzzer::GetSeparator ( )

Referenced by DirPlusFile().

std::string fuzzer::Hash ( const Unit &  U)
fuzzer::if ( UseValueProfile  )

Definition at line 200 of file FuzzerTracePC.h.

static size_t fuzzer::InternalStrnlen ( const char *  S,
size_t  MaxLen 
)
static

Definition at line 298 of file FuzzerTracePC.cpp.

Referenced by __sanitizer_weak_hook_strncmp().

static size_t fuzzer::InternalStrnlen2 ( const char *  S1,
const char *  S2 
)
static

Definition at line 306 of file FuzzerTracePC.cpp.

Referenced by __sanitizer_weak_hook_strcmp().

bool fuzzer::IsASCII ( const Unit &  U)

Definition at line 73 of file FuzzerUtil.cpp.

bool fuzzer::IsASCII ( const uint8_t *  Data,
size_t  Size 
)

Definition at line 75 of file FuzzerUtil.cpp.

References llvm::AMDGPU::CodeObject::Kernel::Arg::Key::Size.

bool fuzzer::IsFile ( const std::string &  Path)
bool fuzzer::IsInterestingCoverageFile ( const std::string &  FileName)
void fuzzer::ListFilesInDirRecursive ( const std::string &  Dir,
long *  Epoch,
std::vector< std::string > *  V,
bool  TopDir 
)
static bool fuzzer::LooseMemeq ( const uint8_t *  A,
const uint8_t *  B,
size_t  Size 
)
static

Definition at line 449 of file FuzzerLoop.cpp.

Referenced by fuzzer::Fuzzer::ExecuteCallback().

ATTRIBUTE_NO_SANITIZE_MEMORY void fuzzer::MallocHook ( const volatile void *  ptr,
size_t  size 
)
template<class T >
T fuzzer::Max ( T  a,
T  b 
)
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If fuzzer::min ( jobs  ,
NumberOfCpuCores()/  2 
)

Referenced by __sanitizer_weak_hook_strncmp(), llvm::AbsoluteDifference(), fuzzer::MemMemTable< 1024 >::Add(), llvm::DwarfExpression::addUnsignedConstant(), fuzzer::TracePC::AddValueForMemcmp(), llvm::IntervalMapImpl::NodeBase< std::pair< KeyT, KeyT >, ValT, N >::adjustFromLeftSib(), llvm::GCNHazardRecognizer::AdvanceCycle(), llvm::SmallBitVector::anyCommon(), llvm::BitVector::anyCommon(), ApplyDisplacementBounds(), llvm::LanaiInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::HexagonFrameLowering::assignCalleeSavedSpillSlots(), assignCalleeSavedSpillSlots(), calculateSetFPREG(), canReduceVMulWidth(), llvm::CC_ARM_AAPCS_Custom_Aggregate(), llvm::CC_X86_32_MCUInReg(), checkLinkerOptCommand(), llvm::pdb::ClassLayout::ClassLayout(), combineLoad(), combineStore(), llvm::StringRef::compare(), llvm::StringRef::compare_lower(), llvm::StringRef::compare_numeric(), llvm::ComputeEditDistance(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), computeKnownBitsMul(), llvm::SelectionDAG::ComputeNumSignBits(), ComputeNumSignBitsImpl(), computeNumSignBitsVectorConstant(), llvm::computePeelCount(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), llvm::ConstantFoldBinaryInstruction(), llvm::APInt::countTrailingZeros(), llvm::createMemCpyLoopKnownSize(), fuzzer::MutationDispatcher::CrossOver(), DecodeDPRRegListOperand(), llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >::drop_back(), llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >::drop_front(), EmitNop(), llvm::ARMFrameLowering::emitPrologue(), llvm::emitSourceFileHeader(), llvm::X86FrameLowering::emitSPUpdate(), llvm::SystemZSelectionDAGInfo::EmitTargetCodeForMemset(), llvm::emitThumbRegPlusImmediate(), llvm::CodeViewContext::encodeDefRange(), llvm::CodeViewContext::encodeInlineLineTable(), estimateRSStackSizeLimit(), llvm::AlignmentFromAssumptionsPass::extractAlignmentInfo(), FileToVector(), llvm::BlockFrequencyInfoImplBase::finalizeMetrics(), llvm::StringRef::find(), llvm::StringRef::find_first_not_of(), llvm::StringRef::find_first_of(), llvm::StringRef::find_last_not_of(), llvm::StringRef::find_last_of(), findCommonAlignment(), FoldIntToFPToInt(), llvm::InstCombiner::FoldItoFPtoI(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::MipsTargetLowering::getABIAlignmentForCallingConv(), getBranchHint(), llvm::getCallsiteCost(), llvm::AMDGPUSubtarget::getFlatWorkGroupSizes(), getFullUnrollBoostingFactor(), llvm::AMDGPUDisassembler::getInstruction(), getInt64Count(), llvm::ARMTTIImpl::getIntImmCost(), llvm::AMDGPU::IsaInfo::getMaxNumSGPRs(), llvm::SISubtarget::getMaxNumSGPRs(), llvm::AMDGPU::IsaInfo::getMaxNumVGPRs(), getMaxWaves(), llvm::AMDGPU::IsaInfo::getMaxWorkGroupsPerCU(), getMemsetStringVal(), llvm::AMDGPU::IsaInfo::getMinNumSGPRs(), llvm::AMDGPU::IsaInfo::getMinNumVGPRs(), llvm::ScalarEvolution::getMulExpr(), getNoopInput(), llvm::GCNRegPressure::getOccupancy(), llvm::AMDGPUSubtarget::getOccupancyWithLocalMemSize(), llvm::getOrEnforceKnownAlignment(), llvm::SIRegisterInfo::getRegPressureLimit(), getRThroughputFromInstrSchedModel(), getRThroughputFromItineraries(), llvm::ScalarEvolution::getSmallConstantTripMultiple(), llvm::object::COFFObjectFile::getSymbolAlignment(), llvm::MipsTargetLowering::HandleByVal(), llvm::TextInstrProfReader::hasFormat(), llvm::raw_ostream::indent(), llvm::SelectionDAG::InferPtrAlignment(), llvm::ResourcePriorityQueue::initNumRegDefsLeft(), llvm::InlineFunction(), intersect(), llvm::AArch64TargetLowering::isLegalAddImmediate(), isOverwrite(), isVectorPromotionViableForSlice(), KnuthDiv(), llvm::GCNRegPressure::less(), LLVMDisasmInstruction(), LLVMFuzzerCustomCrossOver(), LLVMInitializeMCJITCompilerOptions(), llvm::AMDGPUTargetLowering::LowerDIVREM24(), LowerVAARG(), llvm::ConstantRange::lshr(), llvm::StringRef::ltrim(), llvm::detail::IEEEFloat::makeNaN(), mapNameAndUniqueName(), llvm::codeview::CodeViewRecordIO::maxFieldLength(), llvm::MachineInstr::mayAlias(), llvm::RandomNumberGenerator::min(), llvm::object::COFFObjectFile::moveSymbolNext(), llvm::ConstantRange::multiply(), fuzzer::MutationDispatcher::Mutate_InsertRepeatedBytes(), fuzzer::MutationDispatcher::Mutate_ShuffleBytes(), llvm::LegalizerHelper::narrowScalar(), operator new(), llvm::BitVector::operator&=(), llvm::BitVector::operator==(), llvm::pdb::PDBFile::parseFileHeaders(), PerformSTORECombine(), PerformVMOVRRDCombine(), llvm::SMDiagnostic::print(), llvm::X86FrameLowering::processFunctionBeforeFrameFinalized(), llvm::pruneCache(), llvm::AArch64TargetLowering::ReconstructShuffle(), llvm::SmallBitVector::reset(), llvm::BitVector::reset(), RewriteP2Align(), llvm::StringRef::rfind(), llvm::StringRef::rfind_lower(), llvm::StringRef::rtrim(), llvm::Interpreter::runFunction(), scalarizeMaskedLoad(), llvm::detail::scalbn(), llvm::GCNIterativeScheduler::scheduleLegacyMaxOccupancy(), llvm::ConstantRange::shl(), SimplifyExtractValueInst(), llvm::StringRef::slice(), llvm::SplitEditor::splitRegInBlock(), llvm::SplitEditor::splitRegOutBlock(), llvm::SplitEditor::splitSingleBlock(), llvm::StringRef::substr(), llvm::SmallPtrSetImplBase::swap(), llvm::APInt::tcMultiplyPart(), llvm::APInt::tcShiftLeft(), llvm::APInt::tcShiftRight(), llvm::SmallBitVector::test(), llvm::BitVector::test(), llvm::MachineInstr::tieOperands(), llvm::ScaledNumberBase::toString(), toStringAPFloat(), llvm::GCNIterativeScheduler::tryMaximizeOccupancy(), updateCallProfile(), llvm::sroa::AllocaSliceRewriter::visit(), llvm::InstCombiner::visitAShr(), llvm::InstCombiner::visitLShr(), llvm::InstCombiner::visitSwitchInst(), llvm::InstCombiner::visitTrunc(), llvm::write_hex(), and llvm::msf::WritableMappedBlockStream::writeBytes().

template<class T >
T fuzzer::Min ( T  a,
T  b 
)
unsigned fuzzer::NumberOfCpuCores ( )

Definition at line 198 of file FuzzerUtil.cpp.

References N, and Printf().

FILE* fuzzer::OpenFile ( int  Fd,
const char *  Mode 
)

Referenced by DupAndCloseStderr().

FILE* fuzzer::OpenProcessPipe ( const char *  Command,
const char *  Mode 
)
bool fuzzer::ParseDictionaryFile ( const std::string &  Text,
std::vector< Unit > *  Units 
)

Definition at line 127 of file FuzzerUtil.cpp.

References ParseOneDictionaryEntry(), and Printf().

Referenced by TEST().

bool fuzzer::ParseOneDictionaryEntry ( const std::string &  Str,
Unit *  U 
)

Definition at line 81 of file FuzzerUtil.cpp.

References assert(), and L.

Referenced by ParseDictionaryFile(), and TEST().

void fuzzer::Print ( const Unit &  v,
const char *  PrintAfter 
)

Definition at line 34 of file FuzzerUtil.cpp.

References PrintAfter(), and PrintHexArray().

static void fuzzer::PrintASCII ( const Word &  W,
const char *  PrintAfter 
)
static
void fuzzer::PrintASCII ( const uint8_t *  Data,
size_t  Size,
const char *  PrintAfter 
)
void fuzzer::PrintASCII ( const Unit &  U,
const char *  PrintAfter 
)

Definition at line 55 of file FuzzerUtil.cpp.

References PrintAfter(), and PrintASCII().

fuzzer::PrintASCII ( Dict.  data()[i],
Dict.  size()[i],
"\""   
)
void fuzzer::PrintASCIIByte ( uint8_t  Byte)

Definition at line 38 of file FuzzerUtil.cpp.

References Printf().

Referenced by PrintASCII().

void fuzzer::Printf ( const char *  Fmt,
  ... 
)

Definition at line 110 of file FuzzerIO.cpp.

References OutputFile.

fuzzer::Printf ( " # Score: %  d,
Used:%d\n"  ,
Scores  [i],
Usages  [i] 
)
fuzzer::Printf ( "###### End of useless dictionary elements. ######\n"  )
void fuzzer::PrintHexArray ( const Unit &  U,
const char *  PrintAfter = "" 
)
void fuzzer::PrintHexArray ( const uint8_t *  Data,
size_t  Size,
const char *  PrintAfter 
)

Definition at line 27 of file FuzzerUtil.cpp.

References Printf(), and llvm::AMDGPU::CodeObject::Kernel::Arg::Key::Size.

Referenced by Print().

void fuzzer::PrintPC ( const char *  SymbolizedFMT,
const char *  FallbackFMT,
uintptr_t  PC 
)

Definition at line 191 of file FuzzerUtil.cpp.

References llvm::c_str(), DescribePC(), EF, and Printf().

Referenced by fuzzer::TracePC::PrintNewPCs().

static char fuzzer::RandCh ( Random &  Rand)
static
void fuzzer::RawPrint ( const char *  Str)
void fuzzer::ReadDirToVectorOfUnits ( const char *  Path,
std::vector< Unit > *  V,
long *  Epoch,
size_t  MaxSize,
bool  ExitOnError 
)

Definition at line 69 of file FuzzerIO.cpp.

References E, FileToVector(), GetEpoch(), ListFilesInDirRecursive(), Printf(), and X.

Referenced by fuzzer::Fuzzer::RereadOutputCorpus().

void fuzzer::RemoveFile ( const std::string &  Path)
const void* fuzzer::SearchMemory ( const void *  haystack,
size_t  haystacklen,
const void *  needle,
size_t  needlelen 
)
std::string fuzzer::SearchRegexCmd ( const std::string &  Regex)
void fuzzer::SetSignalHandler ( const FuzzingOptions &  Options)
std::string fuzzer::Sha1ToString ( const uint8_t  Sha1[kSHA1NumBytes])
size_t fuzzer::SimpleFastHash ( const uint8_t *  Data,
size_t  Size 
)
void fuzzer::SleepSeconds ( int  Seconds)
std::pair<std::string, std::string> fuzzer::SplitBefore ( std::string  X,
std::string  S 
)
inline

Definition at line 70 of file FuzzerUtil.h.

Referenced by fuzzer::Fuzzer::CrashResistantMerge().

std::string fuzzer::TmpDir ( )
bool fuzzer::ToASCII ( uint8_t *  Data,
size_t  Size 
)

Definition at line 59 of file FuzzerUtil.cpp.

References llvm::AMDGPU::CodeObject::Kernel::Arg::Key::Size, and X.

void fuzzer::WriteToFile ( const Unit &  U,
const std::string &  Path 
)

Definition at line 61 of file FuzzerIO.cpp.

Variable Documentation

MallocFreeTracer fuzzer::AllocTracer
static

Definition at line 74 of file FuzzerLoop.cpp.

Referenced by fuzzer::Fuzzer::ExecuteCallback(), FreeHook(), and MallocHook().

ExternalFunctions * fuzzer::EF = nullptr

Definition at line 836 of file FuzzerDriver.cpp.

Referenced by DescribePC(), fuzzer::TracePC::DumpCoverage(), DupAndCloseStderr(), FreeHook(), fuzzer::Fuzzer::Fuzzer(), llvm::object::ELFObjectFile< ELFT >::getArch(), llvm::object::ELFObjectFile< ELFT >::getFileFormatName(), llvm::object::ELFObjectFile< ELFT >::getRel(), llvm::object::ELFObjectFile< ELFT >::getRela(), llvm::object::ELFObjectFile< ELFT >::getRelocatedSection(), llvm::object::ELFObjectFile< ELFT >::getRelocationOffset(), llvm::object::ELFObjectFile< ELFT >::getRelocationSymbol(), llvm::object::ELFObjectFile< ELFT >::getRelocationType(), llvm::object::ELFObjectFile< ELFT >::getRelocationTypeName(), llvm::object::ELFObjectFile< ELFT >::getSectionIndex(), llvm::object::ELFObjectFile< ELFT >::getSectionName(), llvm::object::ELFObjectFile< ELFT >::getSymbolAddress(), llvm::object::ELFObjectFile< ELFT >::getSymbolFlags(), llvm::object::ELFObjectFile< ELFT >::getSymbolName(), llvm::object::ELFObjectFile< ELFT >::getSymbolSection(), llvm::object::ELFObjectFile< ELFT >::getSymbolValueImpl(), fuzzer::Fuzzer::HandleMalloc(), llvm::object::ELFObjectFile< ELFT >::isRelocatableObject(), MallocHook(), fuzzer::MutationDispatcher::Mutate_Custom(), fuzzer::MutationDispatcher::Mutate_CustomCrossOver(), fuzzer::MutationDispatcher::MutationDispatcher(), fuzzer::TracePC::PrintCoverage(), PrintPC(), fuzzer::Fuzzer::RssLimitCallback(), llvm::object::ELFObjectFile< ELFT >::section_begin(), llvm::object::ELFObjectFile< ELFT >::section_end(), llvm::object::ELFObjectFile< ELFT >::section_rel_begin(), llvm::object::ELFObjectFile< ELFT >::section_rel_end(), TEST(), TestAddWordFromDictionary(), TestChangeASCIIInteger(), TestChangeBinaryInteger(), TestChangeBit(), TestChangeByte(), TestCopyPart(), TestEraseBytes(), TestInsertByte(), TestInsertRepeatedBytes(), TestShuffleBytes(), and fuzzer::Fuzzer::TryDetectingAMemoryLeak().

Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer fuzzer::Experimental

Definition at line 46 of file FuzzerDriver.cpp.

Fuzzer* fuzzer::F
static
fuzzer::FirstFeature = 0

Definition at line 188 of file FuzzerTracePC.h.

struct { ... } fuzzer::Flags
auto fuzzer::Handle8bitCounter
Initial value:
= [&](size_t Idx, uint8_t Counter) {
unsigned Bit = 0;
if (Counter >= 128) Bit = 7;
else if (Counter >= 32) Bit = 6;
else if (Counter >= 16) Bit = 5;
else if (Counter >= 8) Bit = 4;
else if (Counter >= 4) Bit = 3;
else if (Counter >= 3) Bit = 2;
else if (Counter >= 2) Bit = 1;
HandleFeature(Idx * 8 + Bit);
}
static int Counter
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())

Definition at line 175 of file FuzzerTracePC.h.

Referenced by for(), and ForEachNonZeroByte().

use fuzzer::help

Definition at line 247 of file FuzzerDriver.cpp.

Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If Reload the main corpus every< N > seconds to get new units discovered by other processes disabled generate only Write fuzzing Write the single artifact on print statistics on corpus elements at exit dump coverage information as a sancov file at exit and if LeakSanitizer is enabled try to detect memory leaks during fuzzer::If

Definition at line 18 of file FuzzerDriver.cpp.

Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If fuzzer::jobs
Initial value:
= 1 we spawn"
" this number of jobs in separate worker processes"
" with stdout/stderr redirected to fuzz-JOB.log.")
FUZZER_FLAG_UNSIGNED(workers, 0,
"Number of simultaneous worker processes to run the jobs."
" If zero
Maximum length of the test input If
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If jobs

Definition at line 72 of file FuzzerDriver.cpp.

const size_t fuzzer::kMaxUnitSizeToPrint = 256
static

Definition at line 39 of file FuzzerLoop.cpp.

const int fuzzer::kSHA1NumBytes = 20
static

Definition at line 22 of file FuzzerSHA1.h.

Referenced by Hash(), and Sha1ToString().

template<class Callback >
ATTRIBUTE_NO_SANITIZE_ALL __attribute__ ((noinline)) void TracePC size_t fuzzer::N = GetNumPCs()
FILE* fuzzer::OutputFile = stderr
static

Definition at line 24 of file FuzzerIO.cpp.

Referenced by DupAndCloseStderr(), Printf(), and printSymbolizedStackTrace().

Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If fuzzer::positive

Definition at line 36 of file FuzzerDriver.cpp.

fuzzer::return
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with fuzzer::runs
Initial value:
=N or -max_total_time=N to limit "
"the number attempts."
" Use with -exact_artifact_path to specify the output."
" Combine with ASAN_OPTIONS=dedup_token_length=3 (or similar) to ensure that"
" the minimized input triggers the same crash."
)
FUZZER_FLAG_INT(cleanse_crash, 0, "If 1
const size_t N

Definition at line 51 of file FuzzerDriver.cpp.

SharedMemoryRegion fuzzer::SMR
TracePC fuzzer::TPC