Browse Source

tests: add fuzzer seed file for crash in blob_len

Following regression was introduced in commit 5e75160f48 ("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 <ynezz@true.cz>
master
Petr Štetiar 9 months ago
parent
commit
cf2e8eb485
3 changed files with 6 additions and 0 deletions
  1. +2
    -0
      tests/cram/test_blob_parse.t
  2. +4
    -0
      tests/cram/test_blobmsg_parse.t
  3. BIN
      tests/fuzz/corpus/crash-e0f8ecc694d96a09a1fced27b2a0838b670d34a0

+ 2
- 0
tests/cram/test_blob_parse.t View File

@ -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

+ 4
- 0
tests/cram/test_blobmsg_parse.t View File

@ -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)

BIN
tests/fuzz/corpus/crash-e0f8ecc694d96a09a1fced27b2a0838b670d34a0 View File


Loading…
Cancel
Save