{"id":1828,"date":"2017-05-24T15:24:11","date_gmt":"2017-05-24T13:24:11","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=1828"},"modified":"2017-06-07T14:40:48","modified_gmt":"2017-06-07T12:40:48","slug":"ytnef-memory-allocation-failure-in-tneffillmapi-ytnef-c","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2017\/05\/24\/ytnef-memory-allocation-failure-in-tneffillmapi-ytnef-c\/","title":{"rendered":"ytnef: memory allocation failure in TNEFFillMapi (ytnef.c)"},"content":{"rendered":"<p><strong>Description<\/strong>:<br \/>\n<a href=\"https:\/\/github.com\/Yeraze\/ytnef\">ytnef<\/a> is Yeraze&#8217;s TNEF Stream Reader &#8211; for winmail.dat files.<\/p>\n<p>The complete ASan output of the issue:<\/p>\n<pre><font size=\"2\"># ytnefprint $FILE\r\n==11998==AddressSanitizer CHECK failed: \/tmp\/portage\/sys-libs\/compiler-rt-sanitizers-4.0.0\/work\/compiler-rt-4.0.0.src\/lib\/sanitizer_common\/sanitizer_common.cc:120 \"((0 &amp;&amp; \"unable to mmap\")) != (0)\" (0x0, 0x0)\r\n    #0 0x4d95cf in __asan::AsanCheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) \/tmp\/portage\/sys-libs\/compiler-rt-sanitizers-4.0.0\/work\/compiler-rt-4.0.0.src\/lib\/asan\/asan_rtl.cc:69\r\n    #1 0x4f4335 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) \/tmp\/portage\/sys-libs\/compiler-rt-sanitizers-4.0.0\/work\/compiler-rt-4.0.0.src\/lib\/sanitizer_common\/sanitizer_termination.cc:79\r\n    #2 0x4e3962 in __sanitizer::ReportMmapFailureAndDie(unsigned long, char const*, char const*, int, bool) \/tmp\/portage\/sys-libs\/compiler-rt-sanitizers-4.0.0\/work\/compiler-rt-4.0.0.src\/lib\/sanitizer_common\/sanitizer_common.cc:120\r\n    #3 0x4ed265 in __sanitizer::MmapOrDie(unsigned long, char const*, bool) \/tmp\/portage\/sys-libs\/compiler-rt-sanitizers-4.0.0\/work\/compiler-rt-4.0.0.src\/lib\/sanitizer_common\/sanitizer_posix.cc:132\r\n    #4 0x424c6a in __sanitizer::LargeMmapAllocator::Allocate(__sanitizer::AllocatorStats*, unsigned long, unsigned long) \/tmp\/portage\/sys-libs\/compiler-rt-sanitizers-4.0.0\/work\/compiler-rt-4.0.0.src\/lib\/asan\/..\/sanitizer_common\/sanitizer_allocator_secondary.h:41\r\n    #5 0x424c6a in __sanitizer::CombinedAllocator&lt;__sanitizer::SizeClassAllocator64, __sanitizer::SizeClassAllocatorLocalCache&lt;__sanitizer::SizeClassAllocator64 &gt;, __sanitizer::LargeMmapAllocator &gt;::Allocate(__sanitizer::SizeClassAllocatorLocalCache&lt;__sanitizer::SizeClassAllocator64 &gt;*, unsigned long, unsigned long, bool, bool) \/tmp\/portage\/sys-libs\/compiler-rt-sanitizers-4.0.0\/work\/compiler-rt-4.0.0.src\/lib\/asan\/..\/sanitizer_common\/sanitizer_allocator_combined.h:70\r\n    #6 0x424c6a in __asan::Allocator::Allocate(unsigned long, unsigned long, __sanitizer::BufferedStackTrace*, __asan::AllocType, bool) \/tmp\/portage\/sys-libs\/compiler-rt-sanitizers-4.0.0\/work\/compiler-rt-4.0.0.src\/lib\/asan\/asan_allocator.cc:407\r\n    #7 0x41f1fb in __asan::Allocator::Calloc(unsigned long, unsigned long, __sanitizer::BufferedStackTrace*) \/tmp\/portage\/sys-libs\/compiler-rt-sanitizers-4.0.0\/work\/compiler-rt-4.0.0.src\/lib\/asan\/asan_allocator.cc:605\r\n    #8 0x41f1fb in __asan::asan_calloc(unsigned long, unsigned long, __sanitizer::BufferedStackTrace*) \/tmp\/portage\/sys-libs\/compiler-rt-sanitizers-4.0.0\/work\/compiler-rt-4.0.0.src\/lib\/asan\/asan_allocator.cc:786\r\n    #9 0x4cf7ba in calloc \/tmp\/portage\/sys-libs\/compiler-rt-sanitizers-4.0.0\/work\/compiler-rt-4.0.0.src\/lib\/asan\/asan_malloc_linux.cc:75\r\n    #10 0x7fe45c3e4e53 in TNEFFillMapi \/tmp\/ytnef-1.9.2\/lib\/ytnef.c:424:19\r\n    #11 0x7fe45c3e1384 in TNEFMapiProperties \/tmp\/ytnef-1.9.2\/lib\/ytnef.c:396:7\r\n    #12 0x7fe45c3f6b47 in TNEFParse \/tmp\/ytnef-1.9.2\/lib\/ytnef.c:1184:15\r\n    #13 0x7fe45c3f59d3 in TNEFParseFile \/tmp\/ytnef-1.9.2\/lib\/ytnef.c:1042:10\r\n    #14 0x508814 in main \/tmp\/ytnef-1.9.2\/ytnefprint\/main.c:80:9\r\n    #15 0x7fe45b50b78f in __libc_start_main \/tmp\/portage\/sys-libs\/glibc-2.23-r3\/work\/glibc-2.23\/csu\/..\/csu\/libc-start.c:289\r\n    #16 0x419c38 in _start (\/usr\/bin\/ytnefprint+0x419c38)\r\n<\/font><\/pre>\n<p><strong>Affected version:<\/strong><br \/>\n1.9.2<\/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-9473<\/p>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00246-ytnef-memallocfailures\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00246-ytnef-memallocfailures<\/a><\/p>\n<p><strong>Timeline:<\/strong><br \/>\n2017-03-27: bug discovered and reported to upstream<br \/>\n2017-05-24: blog post about the issue<br \/>\n2017-06-07: 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=\"CUOMP8Q9t1\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2017\/05\/24\/ytnef-memory-allocation-failure-in-tneffillmapi-ytnef-c\/\">ytnef: memory allocation failure in TNEFFillMapi (ytnef.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\/24\/ytnef-memory-allocation-failure-in-tneffillmapi-ytnef-c\/embed\/#?secret=CUOMP8Q9t1\" data-secret=\"CUOMP8Q9t1\" width=\"600\" height=\"338\" title=\"&#8220;ytnef: memory allocation failure in TNEFFillMapi (ytnef.c)&#8221; &#8212; agostino&#039;s blog\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: ytnef is Yeraze&#8217;s TNEF Stream Reader &#8211; for winmail.dat files. The complete ASan output of the issue: # ytnefprint $FILE ==11998==AddressSanitizer CHECK failed: \/tmp\/portage\/sys-libs\/compiler-rt-sanitizers-4.0.0\/work\/compiler-rt-4.0.0.src\/lib\/sanitizer_common\/sanitizer_common.cc:120 &#8220;((0 &amp;&amp; &#8220;unable to mmap&#8221;)) != (0)&#8221; (0x0, 0x0) #0 0x4d95cf in __asan::AsanCheckFailed(char const*, int, &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2017\/05\/24\/ytnef-memory-allocation-failure-in-tneffillmapi-ytnef-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-tu","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1828"}],"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=1828"}],"version-history":[{"count":4,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1828\/revisions"}],"predecessor-version":[{"id":1871,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1828\/revisions\/1871"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=1828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=1828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=1828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}