{"id":1902,"date":"2017-06-17T16:52:32","date_gmt":"2017-06-17T14:52:32","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=1902"},"modified":"2017-06-17T16:52:32","modified_gmt":"2017-06-17T14:52:32","slug":"lame-two-ubsan-crashes","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2017\/06\/17\/lame-two-ubsan-crashes\/","title":{"rendered":"lame: two UBSAN crashes"},"content":{"rendered":"<p><strong>Description<\/strong>:<br \/>\n<a href=\"http:\/\/lame.sourceforge.net\/\">lame<\/a> is a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL.<\/p>\n<p>Few notes before the details of this bug. Time ago a fuzz was done by Brian Carpenter and Jakub Wilk which posted the results on the debian bugtracker. In cases like this, when upstream is not active and people do not post on the upstream bugzilla is easy discover duplicates, so I downloaded all available testcases, and noone of the bug you will see on my blog is a duplicate of an existing issue. Upstream seems a bit dead, latest release was into 2011, so this blog post will probably forwarded on the upstream bugtracker just for the record.<\/p>\n<p>The complete ASan output of the issue:<\/p>\n<pre><font size=\"2\"># lame -f -V 9 $FILE out.wav\r\n\/var\/tmp\/portage\/media-sound\/lame-3.99.5-r1\/work\/lame-3.99.5\/frontend\/brhist.c:204:60: runtime error: signed integer overflow: 953447384 + 1908859798 cannot be represented in type 'int'\r\n<\/font><\/pre>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00298-lame-signintoverflow-brhist.c\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00298-lame-signintoverflow-brhist.c<\/a><br \/>\n<strong>CVE:<\/strong><br \/>\nN\/A<\/p>\n<p>#######################<\/p>\n<pre><font size=\"2\"># lame -f -V 9 $FILE out.wav\r\n\/var\/tmp\/portage\/media-sound\/lame-3.99.5-r1\/work\/lame-3.99.5\/frontend\/get_audio.c:1234:21: runtime error: value -nan is outside the range of representable values of type 'int'\r\n<\/font><\/pre>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00299-lame-outside-int-get_audio.c\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00299-lame-outside-int-get_audio.c<\/a><br \/>\n<strong>CVE:<\/strong><br \/>\nN\/A<\/p>\n<p>#######################<\/p>\n<p><strong>Affected version:<\/strong><br \/>\n3.99.5<\/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 \/>\nThese bugs were discovered by Agostino Sarubbo of Gentoo.<\/p>\n<p><strong>Timeline:<\/strong><br \/>\n2017-06-01: bug discovered<br \/>\n2017-06-17: blog post about the issue<\/p>\n<p><strong>Note:<\/strong><br \/>\nThese bugs were found with <a href=\"http:\/\/lcamtuf.coredump.cx\/afl\">American Fuzzy Lop<\/a>.<\/p>\n<p><strong>Permalink:<\/strong><\/p>\n<blockquote data-secret=\"sALRbd6Hna\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2017\/06\/17\/lame-two-ubsan-crashes\/\">lame: two UBSAN crashes<\/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\/06\/17\/lame-two-ubsan-crashes\/embed\/#?secret=sALRbd6Hna\" data-secret=\"sALRbd6Hna\" width=\"600\" height=\"338\" title=\"&#8220;lame: two UBSAN crashes&#8221; &#8212; agostino&#039;s blog\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: lame is a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL. Few notes before the details of this bug. Time ago a fuzz was done by Brian Carpenter and Jakub Wilk which posted the results &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2017\/06\/17\/lame-two-ubsan-crashes\/\">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-uG","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1902"}],"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=1902"}],"version-history":[{"count":2,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1902\/revisions"}],"predecessor-version":[{"id":1907,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1902\/revisions\/1907"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=1902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=1902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=1902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}