"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "netbsd/trace.c" between
honggfuzz-2.1.tar.gz and honggfuzz-2.2.tar.gz

About: honggfuzz is a security oriented, feedback-driven, evolutionary, easy-to-use fuzzer with powerful analysis options.

trace.c  (honggfuzz-2.1):trace.c  (honggfuzz-2.2)
skipping to change at line 297 skipping to change at line 297
PLOG_W("Couldn't get siginfo for pid %d", pid); PLOG_W("Couldn't get siginfo for pid %d", pid);
} }
arch_getInstrStr(pid, info.psi_lwpid, &pc, instr); arch_getInstrStr(pid, info.psi_lwpid, &pc, instr);
LOG_D("Pid: %d, signo: %d, errno: %d, code: %d, addr: %p, pc: %" PRIxREGISTE R ", instr: '%s'", LOG_D("Pid: %d, signo: %d, errno: %d, code: %d, addr: %p, pc: %" PRIxREGISTE R ", instr: '%s'",
pid, info.psi_siginfo.si_signo, info.psi_siginfo.si_errno, info.psi_sigi nfo.si_code, pid, info.psi_siginfo.si_signo, info.psi_siginfo.si_errno, info.psi_sigi nfo.si_code,
info.psi_siginfo.si_addr, pc, instr); info.psi_siginfo.si_addr, pc, instr);
if (!SI_FROMUSER(&info.psi_siginfo) && pc && if (!SI_FROMUSER(&info.psi_siginfo) && pc &&
info.psi_siginfo.si_addr < run->global->netbsd.ignoreAddr) { info.psi_siginfo.si_addr < run->global->arch_netbsd.ignoreAddr) {
LOG_I("Input is interesting (%s), but the si.si_addr is %p (below %p), s kipping", LOG_I("Input is interesting (%s), but the si.si_addr is %p (below %p), s kipping",
util_sigName(info.psi_siginfo.si_signo), info.psi_siginfo.si_addr, util_sigName(info.psi_siginfo.si_signo), info.psi_siginfo.si_addr,
run->global->netbsd.ignoreAddr); run->global->arch_netbsd.ignoreAddr);
return; return;
} }
/* /*
* Unwind and resolve symbols * Unwind and resolve symbols
*/ */
funcs_t* funcs = util_Malloc(_HF_MAX_FUNCS * sizeof(funcs_t)); funcs_t* funcs = util_Malloc(_HF_MAX_FUNCS * sizeof(funcs_t));
defer { defer {
free(funcs); free(funcs);
}; };
skipping to change at line 372 skipping to change at line 372
} }
/* Increase global crashes counter */ /* Increase global crashes counter */
ATOMIC_POST_INC(run->global->cnts.crashesCnt); ATOMIC_POST_INC(run->global->cnts.crashesCnt);
/* /*
* Check if backtrace contains whitelisted symbol. Whitelist overrides * Check if backtrace contains whitelisted symbol. Whitelist overrides
* both stackhash and symbol blacklist. Crash is always kept regardless * both stackhash and symbol blacklist. Crash is always kept regardless
* of the status of uniqueness flag. * of the status of uniqueness flag.
*/ */
if (run->global->netbsd.symsWl) { if (run->global->arch_netbsd.symsWl) {
char* wlSymbol = arch_btContainsSymbol( char* wlSymbol = arch_btContainsSymbol(
run->global->netbsd.symsWlCnt, run->global->netbsd.symsWl, funcCnt, funcs); run->global->arch_netbsd.symsWlCnt, run->global->arch_netbsd.symsWl, funcCnt, funcs);
if (wlSymbol != NULL) { if (wlSymbol != NULL) {
saveUnique = false; saveUnique = false;
LOG_D("Whitelisted symbol '%s' found, skipping blacklist checks", wl Symbol); LOG_D("Whitelisted symbol '%s' found, skipping blacklist checks", wl Symbol);
} }
} else { } else {
/* /*
* Check if stackhash is blacklisted * Check if stackhash is blacklisted
*/ */
if (run->global->feedback.blacklist && if (run->global->feedback.blacklist &&
(fastArray64Search(run->global->feedback.blacklist, run->global->fee dback.blacklistCnt, (fastArray64Search(run->global->feedback.blacklist, run->global->fee dback.blacklistCnt,
run->backtrace) != -1)) { run->backtrace) != -1)) {
LOG_I("Blacklisted stack hash '%" PRIx64 "', skipping", run->backtra ce); LOG_I("Blacklisted stack hash '%" PRIx64 "', skipping", run->backtra ce);
ATOMIC_POST_INC(run->global->cnts.blCrashesCnt); ATOMIC_POST_INC(run->global->cnts.blCrashesCnt);
return; return;
} }
/* /*
* Check if backtrace contains blacklisted symbol * Check if backtrace contains blacklisted symbol
*/ */
char* blSymbol = arch_btContainsSymbol( char* blSymbol = arch_btContainsSymbol(
run->global->netbsd.symsBlCnt, run->global->netbsd.symsBl, funcCnt, funcs); run->global->arch_netbsd.symsBlCnt, run->global->arch_netbsd.symsBl, funcCnt, funcs);
if (blSymbol != NULL) { if (blSymbol != NULL) {
LOG_I("Blacklisted symbol '%s' found, skipping", blSymbol); LOG_I("Blacklisted symbol '%s' found, skipping", blSymbol);
ATOMIC_POST_INC(run->global->cnts.blCrashesCnt); ATOMIC_POST_INC(run->global->cnts.blCrashesCnt);
return; return;
} }
} }
/* If non-blacklisted crash detected, zero set two MSB */ /* If non-blacklisted crash detected, zero set two MSB */
ATOMIC_POST_ADD(run->global->cfg.dynFileIterExpire, _HF_DYNFILE_SUB_MASK); ATOMIC_POST_ADD(run->global->cfg.dynFileIterExpire, _HF_DYNFILE_SUB_MASK);
skipping to change at line 418 skipping to change at line 418
sig_addr = NULL; sig_addr = NULL;
/* User-induced signals don't set si.si_addr */ /* User-induced signals don't set si.si_addr */
if (SI_FROMUSER(&info.psi_siginfo)) { if (SI_FROMUSER(&info.psi_siginfo)) {
sig_addr = NULL; sig_addr = NULL;
} }
/* If dry run mode, copy file with same name into workspace */ /* If dry run mode, copy file with same name into workspace */
if (run->global->mutate.mutationsPerRun == 0U && run->global->cfg.useVerifie r) { if (run->global->mutate.mutationsPerRun == 0U && run->global->cfg.useVerifie r) {
snprintf(run->crashFileName, sizeof(run->crashFileName), "%s/%s", run->g lobal->io.crashDir, snprintf(run->crashFileName, sizeof(run->crashFileName), "%s/%s", run->g lobal->io.crashDir,
run->origFileName); run->dynfile->path);
} else if (saveUnique) { } else if (saveUnique) {
snprintf(run->crashFileName, sizeof(run->crashFileName), snprintf(run->crashFileName, sizeof(run->crashFileName),
"%s/%s.PC.%" PRIxREGISTER ".STACK.%" PRIx64 ".CODE.%d.ADDR.%p.INSTR. %s.%s", "%s/%s.PC.%" PRIxREGISTER ".STACK.%" PRIx64 ".CODE.%d.ADDR.%p.INSTR. %s.%s",
run->global->io.crashDir, util_sigName(info.psi_siginfo.si_signo), p c, run->backtrace, run->global->io.crashDir, util_sigName(info.psi_siginfo.si_signo), p c, run->backtrace,
info.psi_siginfo.si_code, sig_addr, instr, run->global->io.fileExtn) ; info.psi_siginfo.si_code, sig_addr, instr, run->global->io.fileExtn) ;
} else { } else {
char localtmstr[PATH_MAX]; char localtmstr[PATH_MAX];
util_getLocalTime("%F.%H:%M:%S", localtmstr, sizeof(localtmstr), time(NU LL)); util_getLocalTime("%F.%H:%M:%S", localtmstr, sizeof(localtmstr), time(NU LL));
snprintf(run->crashFileName, sizeof(run->crashFileName), snprintf(run->crashFileName, sizeof(run->crashFileName),
"%s/%s.PC.%" PRIxREGISTER ".STACK.%" PRIx64 ".CODE.%d.ADDR.%p.INSTR. %s.%s.%d.%s", "%s/%s.PC.%" PRIxREGISTER ".STACK.%" PRIx64 ".CODE.%d.ADDR.%p.INSTR. %s.%s.%d.%s",
skipping to change at line 440 skipping to change at line 440
info.psi_siginfo.si_code, sig_addr, instr, localtmstr, pid, run->glo bal->io.fileExtn); info.psi_siginfo.si_code, sig_addr, instr, localtmstr, pid, run->glo bal->io.fileExtn);
} }
if (files_exists(run->crashFileName)) { if (files_exists(run->crashFileName)) {
LOG_I("Crash (dup): '%s' already exists, skipping", run->crashFileName); LOG_I("Crash (dup): '%s' already exists, skipping", run->crashFileName);
// Clear filename so that verifier can understand we hit a duplicate // Clear filename so that verifier can understand we hit a duplicate
memset(run->crashFileName, 0, sizeof(run->crashFileName)); memset(run->crashFileName, 0, sizeof(run->crashFileName));
return; return;
} }
if (!files_writeBufToFile(run->crashFileName, run->dynamicFile, run->dynamic FileSz, if (!files_writeBufToFile(run->crashFileName, run->dynfile->data, run->dynfi le->size,
O_CREAT | O_EXCL | O_WRONLY | O_CLOEXEC)) { O_CREAT | O_EXCL | O_WRONLY | O_CLOEXEC)) {
LOG_E("Couldn't write to '%s'", run->crashFileName); LOG_E("Couldn't write to '%s'", run->crashFileName);
return; return;
} }
LOG_I("Crash: saved as '%s'", run->crashFileName); LOG_I("Crash: saved as '%s'", run->crashFileName);
ATOMIC_POST_INC(run->global->cnts.uniqueCrashesCnt); ATOMIC_POST_INC(run->global->cnts.uniqueCrashesCnt);
/* If unique crash found, reset dynFile counter */ /* If unique crash found, reset dynFile counter */
ATOMIC_CLEAR(run->global->cfg.dynFileIterExpire); ATOMIC_CLEAR(run->global->cfg.dynFileIterExpire);
 End of changes. 7 change blocks. 
7 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)