{"id":1763,"date":"2017-05-07T20:13:32","date_gmt":"2017-05-07T18:13:32","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=1763"},"modified":"2017-05-09T10:04:23","modified_gmt":"2017-05-09T08:04:23","slug":"lrzip-invalid-memory-read-in-lzo_decompress_buf-stream-c","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2017\/05\/07\/lrzip-invalid-memory-read-in-lzo_decompress_buf-stream-c\/","title":{"rendered":"lrzip: invalid memory read in lzo_decompress_buf (stream.c)"},"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==3311==ERROR: AddressSanitizer: SEGV on unknown address 0x602000010000 (pc 0x7f75cabe8834 bp 0x62100002c11f sp 0x7f7085ab4d78 T5)\r\n==3311==The signal is caused by a READ memory access.\r\n    #0 0x7f75cabe8833 in lzo1x_decompress \/tmp\/portage\/dev-libs\/lzo-2.08\/work\/lzo-2.08\/src\/lzo1x_d.ch:108\r\n    #1 0x54af2f in lzo_decompress_buf \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/stream.c:590:10\r\n    #2 0x54af2f in ucompthread \/tmp\/portage\/app-arch\/lrzip-0.631\/work\/lrzip-0.631\/stream.c:1525\r\n    #3 0x7f75ca2944a3 in start_thread \/tmp\/portage\/sys-libs\/glibc-2.23-r3\/work\/glibc-2.23\/nptl\/pthread_create.c:333\r\n    #4 0x7f75c95bf66c 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\/dev-libs\/lzo-2.08\/work\/lzo-2.08\/src\/lzo1x_d.ch:108 in lzo1x_decompress\r\nThread T5 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 0x7f75c94f878f 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\nDunno wtf decompression type to use!\r\n==3311==AddressSanitizer: while reporting a bug found another one. Ignoring.\r\nFatal error - exiting\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-8845<\/p>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00230-lrzip-invalidread-lzo1x_decompress\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00230-lrzip-invalidread-lzo1x_decompress<\/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=\"0tUr0RnnIC\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2017\/05\/07\/lrzip-invalid-memory-read-in-lzo_decompress_buf-stream-c\/\">lrzip: invalid memory read in lzo_decompress_buf (stream.c)<\/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-invalid-memory-read-in-lzo_decompress_buf-stream-c\/embed\/#?secret=0tUr0RnnIC\" data-secret=\"0tUr0RnnIC\" width=\"600\" height=\"338\" title=\"&#8220;lrzip: invalid memory read in lzo_decompress_buf (stream.c)&#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 ==3311==ERROR: AddressSanitizer: SEGV on unknown address 0x602000010000 (pc 0x7f75cabe8834 bp 0x62100002c11f sp 0x7f7085ab4d78 T5) ==3311==The signal is &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2017\/05\/07\/lrzip-invalid-memory-read-in-lzo_decompress_buf-stream-c\/\">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-sr","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1763"}],"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=1763"}],"version-history":[{"count":6,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1763\/revisions"}],"predecessor-version":[{"id":1797,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1763\/revisions\/1797"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=1763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=1763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=1763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}