# HG changeset patch # User Matt Johnston # Date 1496323826 -28800 # Node ID 6c92e97553f1e7e4a7baf8081ef37264e1042b24 # Parent ecdd4e8ae4274a384c6372e926eff4b648a4c3b5 Add a flag whether to longjmp, missed that last commit diff -r ecdd4e8ae427 -r 6c92e97553f1 dbutil.c --- a/dbutil.c Tue May 30 22:50:52 2017 +0800 +++ b/dbutil.c Thu Jun 01 21:30:26 2017 +0800 @@ -122,7 +122,7 @@ #ifdef DROPBEAR_FUZZ // longjmp before cleaning up svr_opts - if (fuzz.fuzzing) { + if (fuzz.do_jmp) { longjmp(fuzz.jmp, 1); } #endif diff -r ecdd4e8ae427 -r 6c92e97553f1 fuzz-common.c --- a/fuzz-common.c Tue May 30 22:50:52 2017 +0800 +++ b/fuzz-common.c Thu Jun 01 21:30:26 2017 +0800 @@ -17,6 +17,7 @@ void common_setup_fuzzer(void) { fuzz.fuzzing = 1; fuzz.wrapfds = 1; + fuzz.do_jmp = 1; fuzz.input = m_malloc(sizeof(buffer)); _dropbear_log = fuzz_dropbear_log; crypto_init(); diff -r ecdd4e8ae427 -r 6c92e97553f1 fuzz.h --- a/fuzz.h Tue May 30 22:50:52 2017 +0800 +++ b/fuzz.h Thu Jun 01 21:30:26 2017 +0800 @@ -49,6 +49,7 @@ int wrapfds; // dropbear_exit() jumps back + int do_jmp; sigjmp_buf jmp; uid_t pw_uid; diff -r ecdd4e8ae427 -r 6c92e97553f1 fuzzer-preauth.c --- a/fuzzer-preauth.c Tue May 30 22:50:52 2017 +0800 +++ b/fuzzer-preauth.c Thu Jun 01 21:30:26 2017 +0800 @@ -12,6 +12,8 @@ static int once = 0; if (!once) { setup_fuzzer(); + // XXX temporarily disable setjmp to debug asan segv + fuzz.do_jmp = 0; once = 1; } @@ -40,7 +42,7 @@ wrapfd_add(fakesock, fuzz.input, PLAIN); m_malloc_set_epoch(1); - // temporarily disable setjmp to debug asan segv + // XXX temporarily disable setjmp to debug asan segv svr_session(fakesock, fakesock); #if 0 if (setjmp(fuzz.jmp) == 0) { diff -r ecdd4e8ae427 -r 6c92e97553f1 svr-session.c --- a/svr-session.c Tue May 30 22:50:52 2017 +0800 +++ b/svr-session.c Thu Jun 01 21:30:26 2017 +0800 @@ -185,7 +185,7 @@ #ifdef DROPBEAR_FUZZ // longjmp before cleaning up svr_opts - if (fuzz.fuzzing) { + if (fuzz.do_jmp) { longjmp(fuzz.jmp, 1); } #endif