mirror of
https://github.com/clearml/dropbear
synced 2025-04-22 15:17:27 +00:00
don't longjmp for fuzzer-preauth (temporary to debug asan)
--HG-- branch : fuzz
This commit is contained in:
parent
4d07aa315b
commit
ea0e23c172
@ -19,35 +19,39 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get prefix. input format is
|
// get prefix. input format is
|
||||||
// string prefix
|
// string prefix
|
||||||
// uint32 wrapfd seed
|
// uint32 wrapfd seed
|
||||||
// ... to be extended later
|
// ... to be extended later
|
||||||
// [bytes] ssh input stream
|
// [bytes] ssh input stream
|
||||||
|
|
||||||
// be careful to avoid triggering buffer.c assertions
|
// be careful to avoid triggering buffer.c assertions
|
||||||
if (fuzz.input->len < 8) {
|
if (fuzz.input->len < 8) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
size_t prefix_size = buf_getint(fuzz.input);
|
size_t prefix_size = buf_getint(fuzz.input);
|
||||||
if (prefix_size != 4) {
|
if (prefix_size != 4) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
uint32_t wrapseed = buf_getint(fuzz.input);
|
uint32_t wrapseed = buf_getint(fuzz.input);
|
||||||
wrapfd_setseed(wrapseed);
|
wrapfd_setseed(wrapseed);
|
||||||
|
|
||||||
int fakesock = 20;
|
int fakesock = 20;
|
||||||
wrapfd_add(fakesock, fuzz.input, PLAIN);
|
wrapfd_add(fakesock, fuzz.input, PLAIN);
|
||||||
|
|
||||||
m_malloc_set_epoch(1);
|
m_malloc_set_epoch(1);
|
||||||
|
// temporarily disable setjmp to debug asan segv
|
||||||
|
svr_session(fakesock, fakesock);
|
||||||
|
#if 0
|
||||||
if (setjmp(fuzz.jmp) == 0) {
|
if (setjmp(fuzz.jmp) == 0) {
|
||||||
svr_session(fakesock, fakesock);
|
svr_session(fakesock, fakesock);
|
||||||
m_malloc_free_epoch(1, 0);
|
m_malloc_free_epoch(1, 0);
|
||||||
} else {
|
} else {
|
||||||
m_malloc_free_epoch(1, 1);
|
m_malloc_free_epoch(1, 1);
|
||||||
TRACE(("dropbear_exit longjmped"))
|
TRACE(("dropbear_exit longjmped"))
|
||||||
// dropbear_exit jumped here
|
// dropbear_exit jumped here
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user