From: Petr Štetiar Date: Tue, 26 May 2020 07:22:13 +0000 (+0200) Subject: tests: add fuzzer seed file for crash in blob_len X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cf2e8eb485abc30ed8acc51ba5cb50d2bbc8e3d1;p=oweals%2Flibubox.git tests: add fuzzer seed file for crash in blob_len Following regression was introduced in commit 5e75160f4878 ("blobmsg: fix attrs iteration in the blobmsg_check_array_len()"): Thread 1 "test-fuzz" received signal SIGSEGV, Segmentation fault. in blob_len (attr=0x6020000100d4) at libubox/blob.h:102 102 return (be32_to_cpu(attr->id_len) & BLOB_ATTR_LEN_MASK) - sizeof(struct blob_attr); blob_len (attr=0x6020000100d4) at /libubox/blob.h:102 blob_raw_len (attr=0x6020000100d4) at /libubox/blob.h:111 blob_pad_len (attr=0x6020000100d4) at /libubox/blob.h:120 blobmsg_check_array_len (attr=0x6020000000d0, type=0, blob_len=10) at /libubox/blobmsg.c:145 fuzz_blobmsg_parse (data=0x6020000000d0 "\001\004", size=10) at /libubox/tests/fuzz/test-fuzz.c:57 Signed-off-by: Petr Štetiar --- diff --git a/tests/cram/test_blob_parse.t b/tests/cram/test_blob_parse.t index 5e8b5ff..32c1b65 100644 --- a/tests/cram/test_blob_parse.t +++ b/tests/cram/test_blob_parse.t @@ -122,6 +122,8 @@ check that blob_parse is producing expected results: cannot parse cert crash-d0f3aa7d60a094b021f635d4edb7807c055a4ea1 cannot parse cert crash-df9d1243057b27bbad6211e5a23d1cb699028aa2 cannot parse cert crash-df9d1243057b27bbad6211e5a23d1cb699028aa2 + cannot parse cert crash-e0f8ecc694d96a09a1fced27b2a0838b670d34a0 + cannot parse cert crash-e0f8ecc694d96a09a1fced27b2a0838b670d34a0 cannot parse cert crash-e2fd5ecb3b37926743256f1083f47a07c39e10c2 cannot parse cert crash-e2fd5ecb3b37926743256f1083f47a07c39e10c2 cannot parse cert valid-blobmsg.bin diff --git a/tests/cram/test_blobmsg_parse.t b/tests/cram/test_blobmsg_parse.t index afed22c..ded4d08 100644 --- a/tests/cram/test_blobmsg_parse.t +++ b/tests/cram/test_blobmsg_parse.t @@ -63,6 +63,10 @@ check that blobmsg_parse is producing expected results: crash-df9d1243057b27bbad6211e5a23d1cb699028aa2: blobmsg_parse_array: ... (0) crash-df9d1243057b27bbad6211e5a23d1cb699028aa2: blobmsg_parse: ... (-1) crash-df9d1243057b27bbad6211e5a23d1cb699028aa2: blobmsg_parse_array: ... (0) + crash-e0f8ecc694d96a09a1fced27b2a0838b670d34a0: blobmsg_parse: ... (0) + crash-e0f8ecc694d96a09a1fced27b2a0838b670d34a0: blobmsg_parse_array: ... (0) + crash-e0f8ecc694d96a09a1fced27b2a0838b670d34a0: blobmsg_parse: ... (0) + crash-e0f8ecc694d96a09a1fced27b2a0838b670d34a0: blobmsg_parse_array: ... (0) crash-e2fd5ecb3b37926743256f1083f47a07c39e10c2: blobmsg_parse: ... (-1) crash-e2fd5ecb3b37926743256f1083f47a07c39e10c2: blobmsg_parse_array: ... (-1) crash-e2fd5ecb3b37926743256f1083f47a07c39e10c2: blobmsg_parse: ... (-1) diff --git a/tests/fuzz/corpus/crash-e0f8ecc694d96a09a1fced27b2a0838b670d34a0 b/tests/fuzz/corpus/crash-e0f8ecc694d96a09a1fced27b2a0838b670d34a0 new file mode 100644 index 0000000..edb6bc7 Binary files /dev/null and b/tests/fuzz/corpus/crash-e0f8ecc694d96a09a1fced27b2a0838b670d34a0 differ