Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuraj Vijtiuk <juraj.vijtiuk@sartura.hr>2020-01-12 14:26:18 +0300
committerPetr Štetiar <ynezz@true.cz>2020-01-20 18:54:10 +0300
commit43a103ff17ee5872669f8712606578c90c14591d (patch)
tree481b3cb8ee8f3a712d00ca4ada52ad2e893284b9 /tests/fuzz
parent5c0faaf4f5e26180dcc31b7e8558d57426d84085 (diff)
blobmsg: blobmsg_parse and blobmsg_parse_array oob read fixes
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 >= 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->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 <luka.perkov@sartura.hr> Reviewed-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr> [refactored some checks, added fuzz inputs, adjusted unit test results] Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'tests/fuzz')
-rw-r--r--tests/fuzz/corpus/crash-a3585b70f1c7ffbdec10f6dadc964336118485c4bin0 -> 4 bytes
-rw-r--r--tests/fuzz/corpus/crash-b3585b70f1c7ffbdec10f6dadc964336118485c4bin0 -> 6 bytes
2 files changed, 0 insertions, 0 deletions
diff --git a/tests/fuzz/corpus/crash-a3585b70f1c7ffbdec10f6dadc964336118485c4 b/tests/fuzz/corpus/crash-a3585b70f1c7ffbdec10f6dadc964336118485c4
new file mode 100644
index 0000000..879ba4d
--- /dev/null
+++ b/tests/fuzz/corpus/crash-a3585b70f1c7ffbdec10f6dadc964336118485c4
Binary files differ
diff --git a/tests/fuzz/corpus/crash-b3585b70f1c7ffbdec10f6dadc964336118485c4 b/tests/fuzz/corpus/crash-b3585b70f1c7ffbdec10f6dadc964336118485c4
new file mode 100644
index 0000000..12b832b
--- /dev/null
+++ b/tests/fuzz/corpus/crash-b3585b70f1c7ffbdec10f6dadc964336118485c4
Binary files differ