]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
fuzzing: ndr set global_max_recursion.
authorGary Lockyer <gary@catalyst.net.nz>
Wed, 29 Jan 2020 19:53:10 +0000 (08:53 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 27 Feb 2020 01:02:32 +0000 (01:02 +0000)
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 <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/fuzzing/fuzz_ndr_X.c

index e8c3bb4cf769ff3b71cddbd8d82a64634ffbae5f..fc940f3011b43dd9205c2664c40eb338bf722a08 100644 (file)
@@ -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,