{"id":1761,"date":"2017-05-07T20:09:25","date_gmt":"2017-05-07T18:09:25","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=1761"},"modified":"2017-05-09T09:59:27","modified_gmt":"2017-05-09T07:59:27","slug":"lrzip-null-pointer-dereference-in-bufreadget-libzpaq-h","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2017\/05\/07\/lrzip-null-pointer-dereference-in-bufreadget-libzpaq-h\/","title":{"rendered":"lrzip: NULL pointer dereference in bufRead::get (libzpaq.h)"},"content":{"rendered":"<p><strong>Description<\/strong>:<br \/>\n<a href=\"https:\/\/github.com\/ckolivas\/lrzip\">lrzip<\/a> is a compression utility that excels at compressing large files.<\/p>\n<p>The complete ASan output of the issue:<\/p>\n<pre><font size=\"2\"># lrzip -t $FILE\r\n==24966==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x0000005e7caa bp 0x7f7c755a58d0 sp 0x7f7c755a5870 T2)                                                                               \r\n==24966==The signal is caused by a READ memory access.                                                                                                                                                            \r\n==24966==Hint: address points to the zero page.                                                                                                                                                                   \r\n    #0 0x5e7ca9 in bufRead::get() \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/libzpaq\/libzpaq.h:485:24                                                                                                     \r\n    #1 0x5856f1 in libzpaq::Decompresser::findBlock(double*) \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/libzpaq\/libzpaq.cpp:1236:21                                                                       \r\n    #2 0x55f79a in libzpaq::decompress(libzpaq::Reader*, libzpaq::Writer*) \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/libzpaq\/libzpaq.cpp:1363:12                                                         \r\n    #3 0x55f4e2 in zpaq_decompress \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/libzpaq\/libzpaq.h:538:2                                                                                                     \r\n    #4 0x54b3a4 in zpaq_decompress_buf \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/stream.c:453:2                                                                                                          \r\n    #5 0x54b3a4 in ucompthread \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/stream.c:1534                                                                                                                   \r\n    #6 0x7f81b7a434a3 in start_thread \/tmp\/portage\/sys-libs\/glibc-2.23-r3\/work\/glibc-2.23\/nptl\/pthread_create.c:333\r\n    #7 0x7f81b6d6e66c in clone \/tmp\/portage\/sys-libs\/glibc-2.23-r3\/work\/glibc-2.23\/misc\/..\/sysdeps\/unix\/sysv\/linux\/x86_64\/clone.S:109\r\n\r\nAddressSanitizer can not provide additional info.\r\nSUMMARY: AddressSanitizer: SEGV \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/libzpaq\/libzpaq.h:485:24 in bufRead::get()\r\nThread T2 created by T0 here:\r\n    #0 0x42d49d in pthread_create \/tmp\/portage\/sys-devel\/llvm-3.9.1-r1\/work\/llvm-3.9.1.src\/projects\/compiler-rt\/lib\/asan\/asan_interceptors.cc:245\r\n    #1 0x53e70f in create_pthread \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/stream.c:133:6\r\n    #2 0x53e70f in fill_buffer \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/stream.c:1673\r\n    #3 0x53e70f in read_stream \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/stream.c:1755\r\n    #4 0x531075 in unzip_literal \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/runzip.c:162:16\r\n    #5 0x531075 in runzip_chunk \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/runzip.c:320\r\n    #6 0x531075 in runzip_fd \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/runzip.c:382\r\n    #7 0x519b41 in decompress_file \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/lrzip.c:826:6\r\n    #8 0x511074 in main \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/main.c:669:4\r\n    #9 0x7f81b6ca778f in __libc_start_main \/tmp\/portage\/sys-libs\/glibc-2.23-r3\/work\/glibc-2.23\/csu\/..\/csu\/libc-start.c:289\r\n\r\n==24966==ABORTING\r\n<\/font><\/pre>\n<p><strong>Affected version:<\/strong><br \/>\n0.631<\/p>\n<p><strong>Fixed version:<\/strong><br \/>\nN\/A<\/p>\n<p><strong>Commit fix:<\/strong><br \/>\nN\/A<\/p>\n<p><strong>Credit:<\/strong><br \/>\nThis bug was discovered by Agostino Sarubbo of Gentoo.<\/p>\n<p><strong>CVE:<\/strong><br \/>\nCVE-2017-8847<\/p>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00229-lrzip-nullptr-bufRead-get\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00229-lrzip-nullptr-bufRead-get<\/a><\/p>\n<p><strong>Timeline:<\/strong><br \/>\n2017-03-24: bug discovered and reported to upstream<br \/>\n2017-05-07: blog post about the issue<br \/>\n2017-05-08: CVE assigned<\/p>\n<p><strong>Note:<\/strong><br \/>\nThis bug was found with <a href=\"http:\/\/lcamtuf.coredump.cx\/afl\">American Fuzzy Lop<\/a>.<\/p>\n<p><strong>Permalink:<\/strong><\/p>\n<blockquote data-secret=\"JkyiCfK1eY\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2017\/05\/07\/lrzip-null-pointer-dereference-in-bufreadget-libzpaq-h\/\">lrzip: NULL pointer dereference in bufRead::get (libzpaq.h)<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/blogs.gentoo.org\/ago\/2017\/05\/07\/lrzip-null-pointer-dereference-in-bufreadget-libzpaq-h\/embed\/#?secret=JkyiCfK1eY\" data-secret=\"JkyiCfK1eY\" width=\"600\" height=\"338\" title=\"&#8220;lrzip: NULL pointer dereference in bufRead::get (libzpaq.h)&#8221; &#8212; agostino&#039;s blog\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: lrzip is a compression utility that excels at compressing large files. The complete ASan output of the issue: # lrzip -t $FILE ==24966==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x0000005e7caa bp 0x7f7c755a58d0 sp 0x7f7c755a5870 T2) ==24966==The signal is &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2017\/05\/07\/lrzip-null-pointer-dereference-in-bufreadget-libzpaq-h\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":140,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[12,10],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2EaBc-sp","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1761"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/users\/140"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/comments?post=1761"}],"version-history":[{"count":5,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1761\/revisions"}],"predecessor-version":[{"id":1795,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1761\/revisions\/1795"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=1761"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=1761"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=1761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}