mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-13 18:48:08 +00:00
blacklist -> ignore renaming
This commit is contained in:
@ -44,13 +44,13 @@ char *getBBName(const llvm::BasicBlock *BB) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Function that we never instrument or analyze */
|
/* Function that we never instrument or analyze */
|
||||||
/* Note: this blacklist check is also called in isInWhitelist() */
|
/* Note: this ignore check is also called in isInWhitelist() */
|
||||||
bool isBlacklisted(const llvm::Function *F) {
|
bool isIgnoreFunction(const llvm::Function *F) {
|
||||||
|
|
||||||
// Starting from "LLVMFuzzer" these are functions used in libfuzzer based
|
// Starting from "LLVMFuzzer" these are functions used in libfuzzer based
|
||||||
// fuzzing campaign installations, e.g. oss-fuzz
|
// fuzzing campaign installations, e.g. oss-fuzz
|
||||||
|
|
||||||
static const char *Blacklist[] = {
|
static const char *ignoreList[] = {
|
||||||
|
|
||||||
"asan.",
|
"asan.",
|
||||||
"llvm.",
|
"llvm.",
|
||||||
@ -73,9 +73,9 @@ bool isBlacklisted(const llvm::Function *F) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for (auto const &BlacklistFunc : Blacklist) {
|
for (auto const &ignoreListFunc : ignoreList) {
|
||||||
|
|
||||||
if (F->getName().startswith(BlacklistFunc)) { return true; }
|
if (F->getName().startswith(ignoreListFunc)) { return true; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,8 +107,8 @@ void initWhitelist() {
|
|||||||
bool isInWhitelist(llvm::Function *F) {
|
bool isInWhitelist(llvm::Function *F) {
|
||||||
|
|
||||||
// is this a function with code? If it is external we dont instrument it
|
// is this a function with code? If it is external we dont instrument it
|
||||||
// anyway and cant be in the whitelist. Or if it is blacklisted.
|
// anyway and cant be in the whitelist. Or if it is ignored.
|
||||||
if (!F->size() || isBlacklisted(F)) return false;
|
if (!F->size() || isIgnoreFunction(F)) return false;
|
||||||
|
|
||||||
// if we do not have a whitelist return true
|
// if we do not have a whitelist return true
|
||||||
if (myWhitelist.empty()) return true;
|
if (myWhitelist.empty()) return true;
|
||||||
|
@ -33,7 +33,7 @@ typedef long double max_align_t;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
char * getBBName(const llvm::BasicBlock *BB);
|
char * getBBName(const llvm::BasicBlock *BB);
|
||||||
bool isBlacklisted(const llvm::Function *F);
|
bool isIgnoreFunction(const llvm::Function *F);
|
||||||
void initWhitelist();
|
void initWhitelist();
|
||||||
bool isInWhitelist(llvm::Function *F);
|
bool isInWhitelist(llvm::Function *F);
|
||||||
unsigned long long int calculateCollisions(uint32_t edges);
|
unsigned long long int calculateCollisions(uint32_t edges);
|
||||||
|
@ -562,7 +562,7 @@ struct InsTrimLTO : public ModulePass {
|
|||||||
|
|
||||||
// if the function below our minimum size skip it (1 or 2)
|
// if the function below our minimum size skip it (1 or 2)
|
||||||
if (F.size() < function_minimum_size) continue;
|
if (F.size() < function_minimum_size) continue;
|
||||||
if (isBlacklisted(&F)) continue;
|
if (isIgnoreFunction(&F)) continue;
|
||||||
|
|
||||||
functions++;
|
functions++;
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ bool AFLLTOPass::runOnModule(Module &M) {
|
|||||||
// fprintf(stderr, "DEBUG: Function %s\n", F.getName().str().c_str());
|
// fprintf(stderr, "DEBUG: Function %s\n", F.getName().str().c_str());
|
||||||
|
|
||||||
if (F.size() < function_minimum_size) continue;
|
if (F.size() < function_minimum_size) continue;
|
||||||
if (isBlacklisted(&F)) continue;
|
if (isIgnoreFunction(&F)) continue;
|
||||||
|
|
||||||
// whitelist check
|
// whitelist check
|
||||||
AttributeList Attrs = F.getAttributes();
|
AttributeList Attrs = F.getAttributes();
|
||||||
|
@ -126,7 +126,7 @@ bool AFLwhitelist::runOnModule(Module &M) {
|
|||||||
|
|
||||||
if (F.size() < 1) continue;
|
if (F.size() < 1) continue;
|
||||||
// fprintf(stderr, "F:%s\n", F.getName().str().c_str());
|
// fprintf(stderr, "F:%s\n", F.getName().str().c_str());
|
||||||
if (isBlacklisted(&F)) continue;
|
if (isIgnoreFunction(&F)) continue;
|
||||||
|
|
||||||
BasicBlock::iterator IP = F.getEntryBlock().getFirstInsertionPt();
|
BasicBlock::iterator IP = F.getEntryBlock().getFirstInsertionPt();
|
||||||
IRBuilder<> IRB(&(*IP));
|
IRBuilder<> IRB(&(*IP));
|
||||||
|
@ -435,7 +435,7 @@ static u8 cmp_fuzz(afl_state_t *afl, u32 key, u8 *orig_buf, u8 *buf, u32 len) {
|
|||||||
u32 fails;
|
u32 fails;
|
||||||
u8 found_one = 0;
|
u8 found_one = 0;
|
||||||
|
|
||||||
/* loop cmps are useless, detect and blacklist them */
|
/* loop cmps are useless, detect and ignores them */
|
||||||
u64 s_v0, s_v1;
|
u64 s_v0, s_v1;
|
||||||
u8 s_v0_fixed = 1, s_v1_fixed = 1;
|
u8 s_v0_fixed = 1, s_v1_fixed = 1;
|
||||||
u8 s_v0_inc = 1, s_v1_inc = 1;
|
u8 s_v0_inc = 1, s_v1_inc = 1;
|
||||||
@ -743,7 +743,7 @@ u8 input_to_state_stage(afl_state_t *afl, u8 *orig_buf, u8 *buf, u32 len,
|
|||||||
afl->pass_stats[k].faileds ||
|
afl->pass_stats[k].faileds ||
|
||||||
afl->pass_stats[k].total == 0xff)) {
|
afl->pass_stats[k].total == 0xff)) {
|
||||||
|
|
||||||
afl->shm.cmp_map->headers[k].hits = 0; // blacklist this cmp
|
afl->shm.cmp_map->headers[k].hits = 0; // ignores this cmp
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user