{"id":924,"date":"2016-11-19T17:11:37","date_gmt":"2016-11-19T15:11:37","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=924"},"modified":"2016-12-01T15:56:40","modified_gmt":"2016-12-01T13:56:40","slug":"libdwarf-negation-overflow-in-dwarf_leb-c","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2016\/11\/19\/libdwarf-negation-overflow-in-dwarf_leb-c\/","title":{"rendered":"libdwarf: negation overflow in dwarf_leb.c"},"content":{"rendered":"<p><strong>Description<\/strong>:<br \/>\n<a href=\"https:\/\/www.prevanders.net\/dwarf.html\">libdwarf<\/a> is a library to consume and produce DWARF debug information.<\/p>\n<p>A fuzz with the Undefined Behavior Sanitizer shows a negation that cannot be represented as long long.<\/p>\n<p>The complete UBSan output:<\/p>\n<pre><font size=\"2\"># dwarfdump $FILE\r\ndwarf_leb.c:306:19: runtime error: negation of -9223372036854775808 cannot be represented in type 'Dwarf_Signed' (aka 'long long'); cast to an unsigned type to negate this value to itself\r\n<\/font><\/pre>\n<p><strong>Affected version:<\/strong><br \/>\n20161021<\/p>\n<p><strong>Fixed version:<\/strong><br \/>\n20161124<\/p>\n<p><strong>Commit fix:<\/strong><br \/>\n<a href=\"https:\/\/sourceforge.net\/p\/libdwarf\/code\/ci\/4f19e1050cd8e9ddf2cb6caa061ff2fec4c9b5f9\/#diff-5\">https:\/\/sourceforge.net\/p\/libdwarf\/code\/ci\/4f19e1050cd8e9ddf2cb6caa061ff2fec4c9b5f9\/#diff-5<\/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-2016-9558<\/p>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00050-libdwarf-negate-itself\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00050-libdwarf-negate-itself<\/a><\/p>\n<p><strong>Timeline:<\/strong><br \/>\n2016-11-11: bug discovered and reported to upstream<br \/>\n2016-11-11: upstream released a patch<br \/>\n2016-11-19: blog post about the issue<br \/>\n2016-11-23: CVE assigned<br \/>\n2016-11-24: upstream released 20161124<\/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=\"cY8dTFsylw\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2016\/11\/19\/libdwarf-negation-overflow-in-dwarf_leb-c\/\">libdwarf: negation overflow in dwarf_leb.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\/2016\/11\/19\/libdwarf-negation-overflow-in-dwarf_leb-c\/embed\/#?secret=cY8dTFsylw\" data-secret=\"cY8dTFsylw\" width=\"600\" height=\"338\" title=\"&#8220;libdwarf: negation overflow in dwarf_leb.c&#8221; &#8212; agostino&#039;s blog\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: libdwarf is a library to consume and produce DWARF debug information. A fuzz with the Undefined Behavior Sanitizer shows a negation that cannot be represented as long long. The complete UBSan output: # dwarfdump $FILE dwarf_leb.c:306:19: runtime error: negation &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2016\/11\/19\/libdwarf-negation-overflow-in-dwarf_leb-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-eU","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/924"}],"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=924"}],"version-history":[{"count":7,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/924\/revisions"}],"predecessor-version":[{"id":1003,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/924\/revisions\/1003"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}