From: Gary Lockyer Date: Wed, 29 Jan 2020 19:53:10 +0000 (+1300) Subject: fuzzing: ndr set global_max_recursion. X-Git-Tag: ldb-2.2.0~1573 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ba2ce40f9cf00e3fd898c6dddf84d571028a00f;p=thirdparty%2Fsamba.git fuzzing: ndr set global_max_recursion. Set global_max_recursion to 128, to ensure the fuzzer does not trip the ASAN maximum stack depth which seems to be about 256? Credit to OSS-Fuzz REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19820 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14254 Signed-off-by: Gary Lockyer Reviewed-by: Andrew Bartlett --- diff --git a/lib/fuzzing/fuzz_ndr_X.c b/lib/fuzzing/fuzz_ndr_X.c index e8c3bb4cf76..fc940f3011b 100644 --- a/lib/fuzzing/fuzz_ndr_X.c +++ b/lib/fuzzing/fuzz_ndr_X.c @@ -262,6 +262,7 @@ int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) { memset(st, '\0', sizeof(st)); ndr_pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_pull->global_max_recursion = 128; if (type == TYPE_OUT) { status = pull_chunks(ndr_pull,