<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Bytecode Analysis Is Not The Same As Binary Analysis</title>
	<atom:link href="http://www.veracode.com/blog/2009/07/bytecode-analysis-is-not-the-same-as-binary-analysis/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.veracode.com/blog/2009/07/bytecode-analysis-is-not-the-same-as-binary-analysis/</link>
	<description>Application security testing, analysis, and metrics</description>
	<lastBuildDate>Tue, 15 May 2012 22:16:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: kme</title>
		<link>http://www.veracode.com/blog/2009/07/bytecode-analysis-is-not-the-same-as-binary-analysis/comment-page-1/#comment-3015</link>
		<dc:creator>kme</dc:creator>
		<pubDate>Fri, 14 Aug 2009 12:01:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.veracode.com/blog/?p=892#comment-3015</guid>
		<description>For another example, there was a recent Linux kernel vulnerability where the code looked like:

foo = sk-&gt;bar;

if (!sk)
    error();

The compiler reasoned that the if() statement could be optimised out, because if sk was NULL then the earlier derefence would have faulted.  This created an exploitable NULL pointer dereference, because userspace can map pages at address zero and then call into the kernel.</description>
		<content:encoded><![CDATA[<p>For another example, there was a recent Linux kernel vulnerability where the code looked like:</p>
<p>foo = sk-&gt;bar;</p>
<p>if (!sk)<br />
    error();</p>
<p>The compiler reasoned that the if() statement could be optimised out, because if sk was NULL then the earlier derefence would have faulted.  This created an exploitable NULL pointer dereference, because userspace can map pages at address zero and then call into the kernel.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Wysopal</title>
		<link>http://www.veracode.com/blog/2009/07/bytecode-analysis-is-not-the-same-as-binary-analysis/comment-page-1/#comment-2983</link>
		<dc:creator>Chris Wysopal</dc:creator>
		<pubDate>Mon, 03 Aug 2009 19:54:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.veracode.com/blog/?p=892#comment-2983</guid>
		<description>Hi Terence,

There is a good paper by Thomas Reps from the University of Wisconsin that covers some of these differences.  It is WYSINWYX: What You See IS Not What You eXecute. Ref: http://www.cs.wisc.edu/wpis/papers/wysinwyx.submission.pdf

Here is an excerpt:

Less widely recognized is that even when the original source code is available,
source-code analysis has certain drawbacks [Howard 2002; WHDC 2007]. The reason is that computers do not execute source code; they execute machine-code programs that are generated from source code. The transformation from source code to machine code can introduce subtle but important differences between what a programmer intended and what is actually executed by the processor. For instance, the following compiler-induced vulnerability was discovered during the Windows security push in 2002 [Howard 2002]: the Microsoft C++ .NET compiler reasoned that because the program fragment shown below on the left never uses the values written by memset (intended to scrub the buffer pointed to by password), the memset call could be removed—thereby leaving sensitive information exposed in the freelist at runtime.

memset(password, ’’, len);
free(password);

=&gt;

free(password);

Such a vulnerability is invisible in the original source code; it can only be detected
by examining the low-level code emitted by the optimizing compiler. We call this
the WYSINWYX phenomenon (pronounced “wiz-in-wicks”): What You See [in
source code] Is NotWhat You eXecute [Reps et al. 2005; Balakrishnan et al. 2007;
Balakrishnan 2007]. 

WYSINWYX is not restricted to the presence or absence of procedure calls; on
the contrary, it is pervasive.



-Chris</description>
		<content:encoded><![CDATA[<p>Hi Terence,</p>
<p>There is a good paper by Thomas Reps from the University of Wisconsin that covers some of these differences.  It is WYSINWYX: What You See IS Not What You eXecute. Ref: <a href="http://www.cs.wisc.edu/wpis/papers/wysinwyx.submission.pdf" rel="nofollow">http://www.cs.wisc.edu/wpis/papers/wysinwyx.submission.pdf</a></p>
<p>Here is an excerpt:</p>
<p>Less widely recognized is that even when the original source code is available,<br />
source-code analysis has certain drawbacks [Howard 2002; WHDC 2007]. The reason is that computers do not execute source code; they execute machine-code programs that are generated from source code. The transformation from source code to machine code can introduce subtle but important differences between what a programmer intended and what is actually executed by the processor. For instance, the following compiler-induced vulnerability was discovered during the Windows security push in 2002 [Howard 2002]: the Microsoft C++ .NET compiler reasoned that because the program fragment shown below on the left never uses the values written by memset (intended to scrub the buffer pointed to by password), the memset call could be removed—thereby leaving sensitive information exposed in the freelist at runtime.</p>
<p>memset(password, ’’, len);<br />
free(password);</p>
<p>=&gt;</p>
<p>free(password);</p>
<p>Such a vulnerability is invisible in the original source code; it can only be detected<br />
by examining the low-level code emitted by the optimizing compiler. We call this<br />
the WYSINWYX phenomenon (pronounced “wiz-in-wicks”): What You See [in<br />
source code] Is NotWhat You eXecute [Reps et al. 2005; Balakrishnan et al. 2007;<br />
Balakrishnan 2007]. </p>
<p>WYSINWYX is not restricted to the presence or absence of procedure calls; on<br />
the contrary, it is pervasive.</p>
<p>-Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Terence</title>
		<link>http://www.veracode.com/blog/2009/07/bytecode-analysis-is-not-the-same-as-binary-analysis/comment-page-1/#comment-2955</link>
		<dc:creator>Terence</dc:creator>
		<pubDate>Tue, 28 Jul 2009 14:27:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.veracode.com/blog/?p=892#comment-2955</guid>
		<description>Thanks for the article.  Can you explain this in more detail  &quot;This means that any code generation decisions made by the compiler, which are in the executing software, will be missing from this model.&quot;.  What actually would be lost and how it would affect analysis?</description>
		<content:encoded><![CDATA[<p>Thanks for the article.  Can you explain this in more detail  &#8220;This means that any code generation decisions made by the compiler, which are in the executing software, will be missing from this model.&#8221;.  What actually would be lost and how it would affect analysis?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

