<feed xmlns='http://www.w3.org/2005/Atom'>
<title>libubox/tests/cram/test_blobmsg_parse.t, branch master</title>
<subtitle>C utility functions for OpenWrt</subtitle>
<id>https://git-03.infra.openwrt.org/project/libubox/atom?h=master</id>
<link rel='self' href='https://git-03.infra.openwrt.org/project/libubox/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/libubox/'/>
<updated>2020-05-26T07:48:07Z</updated>
<entry>
<title>tests: add fuzzer seed file for crash in blob_len</title>
<updated>2020-05-26T07:48:07Z</updated>
<author>
<name>Petr Štetiar</name>
</author>
<published>2020-05-26T07:22:13Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/libubox/commit/?id=cf2e8eb485abc30ed8acc51ba5cb50d2bbc8e3d1'/>
<id>urn:sha1:cf2e8eb485abc30ed8acc51ba5cb50d2bbc8e3d1</id>
<content type='text'>
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-&gt;id_len) &amp; 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 &lt;ynezz@true.cz&gt;
</content>
</entry>
<entry>
<title>blobmsg: blobmsg_parse and blobmsg_parse_array oob read fixes</title>
<updated>2020-01-20T15:54:10Z</updated>
<author>
<name>Juraj Vijtiuk</name>
</author>
<published>2020-01-12T11:26:18Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/libubox/commit/?id=43a103ff17ee5872669f8712606578c90c14591d'/>
<id>urn:sha1:43a103ff17ee5872669f8712606578c90c14591d</id>
<content type='text'>
Fix out of bounds read in blobmsg_parse and blobmsg_check_name. The
out of bounds read happens because blob_attr and blobmsg_hdr have
flexible array members, whose size is 0 in the corresponding sizeofs.
For example the __blob_for_each_attr macro checks whether rem &gt;=
sizeof(struct blob_attr). However, what LibFuzzer discovered was,
if the input data was only 4 bytes, the data would be casted to blob_attr,
and later on blob_data(attr) would be called even though attr-&gt;data was empty.
The same issue could appear with data larger than 4 bytes, where data
wasn't empty, but contained only the start of the blobmsg_hdr struct,
and blobmsg_hdr name was empty. The bugs were discovered by fuzzing
blobmsg_parse and blobmsg_array_parse with LibFuzzer.

CC: Luka Perkov &lt;luka.perkov@sartura.hr&gt;
Reviewed-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
Signed-off-by: Juraj Vijtiuk &lt;juraj.vijtiuk@sartura.hr&gt;
[refactored some checks, added fuzz inputs, adjusted unit test results]
Signed-off-by: Petr Štetiar &lt;ynezz@true.cz&gt;
</content>
</entry>
<entry>
<title>tests: add test cases for blobmsg parsing</title>
<updated>2019-12-25T09:31:58Z</updated>
<author>
<name>Petr Štetiar</name>
</author>
<published>2019-12-10T10:51:43Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/libubox/commit/?id=2df6d35e3299ecce7975502a007c1ca456f4b8bb'/>
<id>urn:sha1:2df6d35e3299ecce7975502a007c1ca456f4b8bb</id>
<content type='text'>
Increasing test coverage.

Signed-off-by: Petr Štetiar &lt;ynezz@true.cz&gt;
</content>
</entry>
</feed>
